9/8 优化1.0

20240912_adapter_z
wangwei 7 months ago
parent 2bb48e087b
commit 1fd70fb642

@ -10,9 +10,15 @@
<!-- </el-form-item>-->
<!--</el-col>-->
<el-col :span="10">
<el-form-item label="当前部门:" class="query-form-item">
<deptSelect :value.sync="userQuery.deptCode"/>
<!--<deptSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/>-->
<el-select v-model="userQuery.deptCode" class="width-full" placeholder="请选择" filterable clearable @change="changeUsers">
<el-option v-for="item in DeptList" :key="item.id" :label="item.name" :value="item.code"/>
</el-select>
<!--<el-option v-for="item in " :key="item.id" :label="item.name" :value="item.code"/>-->
<!-- <deptSelect :value.sync="userQuery.deptCode"-->
<!-- :changeValue.sync="changeUsers"/>-->
<!-- &lt;!&ndash;<deptSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/>&ndash;&gt;-->
</el-form-item>
</el-col>
<!--<el-col :span="6">-->
@ -354,6 +360,7 @@
import { getUserBindWork, getUsers,delUserBindWork } from '@/api/basic/collectPoint/userWorkplace'
import selectWorkplace from './selectWorkplace'
import { authAdminList } from '@/api/auth/authAdmin'
import { filterList } from '@/api/system/invWarehouse'
export default {
components: { selectWorkplace },
@ -421,7 +428,8 @@ export default {
formData: null,
userTotal: 0,
workTotal: 0,
employeeName: '用户'
employeeName: '用户',
DeptList: []
}
},
methods: {
@ -539,10 +547,24 @@ export default {
workDetail(row){
this.formData = row
this.addWorkplaceDialogVisible = true
},
getDepts() {
let data =
{enable: true,
}
filterList(data).then(res => {
if (res.code == 20000) {
this.DeptList = res.data.list || []
}
})
},
changeUsers(){
this.getUsers()
}
},
created() {
this.getUsers()
this.getDepts()
}
}

@ -226,6 +226,7 @@ import {getCollectBusType} from '@/api/basic/collectPoint/gatherOrderType'
import {getBusTypeList} from '@/api/basic/busType'
import {addBusType, updateType} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import {getOriginBusType} from '@/api/thrsys/busOriginType'
import {isBlank} from '@/utils/strUtil'
export default {
props: {
@ -264,6 +265,7 @@ export default {
workplaceType: 3,
autoTag: 0,
monopoly: 0,
invCode: ''
},
invList: [],
busTypes: [],
@ -462,7 +464,9 @@ export default {
created() {
if (this.upData != null) {
this.formData = this.upData
this.formData.invCode = this.upData.invCode + ''
if (this.formData.invCode != null){
this.formData.invCode = this.upData.invCode + ''
}
if (this.formData.isMatching == 0) {
this.getBusType()
} else {

@ -1110,6 +1110,7 @@ export default {
this.rowData = row
this.workplaceName = row.workplaceName
this.userQuery.workplaceCode = row.workplaceId
this.workplaceId = row.workplaceId
this.getUserBindWork(this.userQuery)
this.getWorkBindBusTypes()
},

@ -18,7 +18,10 @@
<el-descriptions-item label="批次号">{{ prescribeData.batchNo }}</el-descriptions-item>
<el-descriptions-item label="计量单位">{{ prescribeData.measname }}</el-descriptions-item>
<el-descriptions-item label="剩余数量" custom-style class="custom-label">
<el-tag size="small">{{ prescribeData.reCount }}</el-tag>
<span :style="{ color: 'red' }">
{{ prescribeData.reCount }}
</span>
<!--{{ prescribeData.reCount }}-->
<!--<el-tag type="danger">{{ prescribeData.reCount}}</el-tag>-->
</el-descriptions-item>
<el-descriptions-item label="生产日期">{{ produceDate }}</el-descriptions-item>
@ -30,12 +33,14 @@
<!--<el-button type="primary" icon="el-icon-plus" sty>提交</el-button>-->
<el-form :inline="true" :model="formData" class="demo-form-inline" style="margin-top: 30px" :rules="rules"
ref="formRef">
ref="formRef"
>
<el-row :gutter="24">
<el-col :span="10">
<el-form-item label="损耗出库数量:" prop="count">
<el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1"
@input="checkCount"></el-input>
@input="checkCount"
></el-input>
<!--<span v-if="countExceeded" class="exceeded-message">10</span>-->
</el-form-item>
</el-col>
@ -60,7 +65,7 @@
</template>
<script>
import {destroyOut, destroyOutByCode, destroySplitOut} from '@/api/collect/IoDestroy'
import { destroyOut, destroyOutByCode, destroySplitOut } from '@/api/collect/IoDestroy'
export default {
name: 'destroyOutDialog',
@ -86,30 +91,30 @@ export default {
saveLoading: false,
rules: {
count: [
{validator: this.validateCount, message: '损耗出库数量不能超出剩余数量', trigger: 'blur'}
{ validator: this.validateCount, message: '损耗出库数量不能超出剩余数量', trigger: 'blur' }
]
},
}
}
},
methods: {
conversionDate(dateString) {
const parts = dateString.split('');
const year = '20' + parts.slice(0, 2).join('');
const month = parts[2] + parts[3];
const day = parts[4] + parts[5];
return `${year}-${month}-${day}`;
const parts = dateString.split('')
const year = '20' + parts.slice(0, 2).join('')
const month = parts[2] + parts[3]
const day = parts[4] + parts[5]
return `${year}-${month}-${day}`
},
validateCount(rule, value, callback) {
if (value > this.prescribeData.reCount) {
callback(new Error('损耗出库数量超出剩余数量'));
callback(new Error('损耗出库数量超出剩余数量'))
} else {
callback();
callback()
}
},
checkCount() {
//
this.$refs.formRef.validateField('count');
this.$refs.formRef.validateField('count')
},
closeAddDialog() {
this.closeDialog()
@ -118,10 +123,10 @@ export default {
//
destroyOutOrder() {
if (this.formData.count == null) {
return this.$message.error("请输入损耗数量")
return this.$message.error('请输入损耗数量')
}
if (this.formData.count > this.prescribeData.reCount) {
return this.$message.error("损耗出库数量不能超出剩余数量")
return this.$message.error('损耗出库数量不能超出剩余数量')
}
let query = {
outCount: this.formData.count,
@ -129,13 +134,13 @@ export default {
updateUser: this.$store.getters.adminId,
createUser: this.$store.getters.adminId,
splitFifoInv: this.prescribeData,
code: this.prescribeData.code,
code: this.prescribeData.code
}
if (this.destroyType == 1) {
destroyOut(query).then(res => {
if (res.code == 20000) {
this.closeDialog()
return this.$message.success("损耗出库成功")
return this.$message.success('损耗出库成功')
} else {
return this.$message.error(res.message)
}
@ -144,17 +149,17 @@ export default {
destroyOutByCode(query).then(res => {
if (res.code == 20000) {
this.closeDialog()
return this.$message.success("损耗出库成功")
return this.$message.success('损耗出库成功')
} else {
return this.$message.error(res.message)
}
})
} else if (this.destroyType == 3) {
destroySplitOut(query).then(res => {
if (res.code == 20000){
if (res.code == 20000) {
this.closeDialog()
this.$message.success("损耗出库成功")
}else {
this.$message.success('损耗出库成功')
} else {
this.$message.error(res.message)
}
}).catch(() => {
@ -165,7 +170,7 @@ export default {
},
destroyOutByCodeOrder() {
if (this.formData.count == null) {
return this.$message.error("请输入损耗数量")
return this.$message.error('请输入损耗数量')
}
let query = {
outCount: this.formData.count,
@ -173,7 +178,7 @@ export default {
updateUser: this.$store.getters.adminId,
createUser: this.$store.getters.adminId,
splitFifoInv: this.prescribeData,
code: this.formData.code,
code: this.formData.code
}
}

Loading…
Cancel
Save