界面修改,拆零新增损耗出库

20240912_adapter_z
yewj 10 months ago
parent 4e42bcb419
commit 6ed14e5e29

@ -41,3 +41,11 @@ export function destroyOutByCode(query) {
data: query data: query
}); });
} }
export function destroySplitOut(query) {
return axios({
url: "/udiwms/collect/split/desOrder/destroyOut",
method: "post",
data: query
});
}

@ -11,7 +11,7 @@
<el-col :span="18" style="margin-left: 0px" > <el-col :span="18" style="margin-left: 0px" >
<span style="font-size: 16px;color: #409EFF">当前工位:&nbsp&nbsp&nbsp&nbsp<span style="font-size: 16px;color: #000000">{{this.formData.workplaceName}}</span> <span style="font-size: 16px;color: #409EFF">当前工位:&nbsp&nbsp&nbsp&nbsp<span style="font-size: 16px;color: #000000">{{this.formData.workplaceName}}</span>
&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp
<span :style="{ color: formData.workplaceStatus === 0 ? 'green' : 'red' }"> ({{ formData.workplaceStatus === 0 ? '服务中' : '服务暂停' }} ) </span> <!-- <span :style="{ color: formData.workplaceStatus === 0 ? 'green' : 'red' }"> ({{ formData.workplaceStatus === 0 ? '服务中' : '服务暂停' }} ) </span>-->
<!-- <el-button type="primary" @click="toggleWorkplaceStatus" style="margin-left: 10px;" >切换状态</el-button>--> <!-- <el-button type="primary" @click="toggleWorkplaceStatus" style="margin-left: 10px;" >切换状态</el-button>-->
</span> </span>

@ -224,6 +224,22 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<el-dialog
title="损耗出库"
:visible.sync="destroyOutDialogVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="60%"
v-if="destroyOutDialogVisible"
>
<destroyOutDialog
:prescribeData="prescribeData"
:destroyType="destroyType"
:closeDialog="closeDialog"
>
</destroyOutDialog>
</el-dialog>
</div> </div>
</template> </template>
@ -233,13 +249,13 @@
import A from '../../plugins/KeyScaner' import A from '../../plugins/KeyScaner'
import PanelDestroyDetail from '@/views/collect/PanelDestroyDetail' import PanelDestroyDetail from '@/views/collect/PanelDestroyDetail'
import PanelDestroyCodeDetail from '@/views/collect/PanelDestroyCodeDetail' import PanelDestroyCodeDetail from '@/views/collect/PanelDestroyCodeDetail'
import { findInvRemind } from '@/api/inout/splitCode' import {findInvRemind} from '@/api/inout/splitCode'
import { enterCodeWeb, saveOrderWeb } from '@/api/inout/order' import {enterCodeWeb, saveOrderWeb} from '@/api/inout/order'
import { getUserBindWork } from '@/api/basic/collectPoint/userWorkplace' import {getUserBindWork} from '@/api/basic/collectPoint/userWorkplace'
import chooseDraftOrderDialog from './chooseDraftOrderDialog' import chooseDraftOrderDialog from './chooseDraftOrderDialog'
import dialogInvProduct from '@/views/inout/DialogSelectInvProduct' import dialogInvProduct from '@/views/inout/DialogSelectInvProduct'
import { executeFuc, getHead } from '@/utils/customConfig' import {executeFuc, getHead} from '@/utils/customConfig'
import { getSplitCode } from '@/api/collect/collectOrder' import {getSplitCode} from '@/api/collect/collectOrder'
export default { export default {
name: 'IoDestroyOrder', name: 'IoDestroyOrder',
@ -293,7 +309,12 @@ export default {
}, },
], ],
}, },
list: [] list: [],
showType: 1,
isLinkDisabled: false,
destroyOutDialogVisible: false,
prescribeData: {},
destroyType: 3,//1 2.code3
} }
}, },
components: {}, components: {},
@ -316,15 +337,15 @@ export default {
this.filterQuery.orderBy = column.prop; this.filterQuery.orderBy = column.prop;
this.getList(); this.getList();
}, },
getWorkPlaceList(_this){ getWorkPlaceList(_this) {
getUserBindWork({ getUserBindWork({
autoUserId: 1, autoUserId: 1,
page: 1, page: 1,
limit: 200, limit: 200,
}).then((response) => { }).then((response) => {
let getWorkPlaceList = [] let getWorkPlaceList = []
if(response.code == 20000 && response.data.list.length > 0){ if (response.code == 20000 && response.data.list.length > 0) {
response.data.list.forEach( item => { response.data.list.forEach(item => {
let post = { let post = {
code: item.workplaceId, code: item.workplaceId,
label: item.workplaceName label: item.workplaceName
@ -364,9 +385,9 @@ export default {
this.filterQuery.page = 1; this.filterQuery.page = 1;
this.getList(); this.getList();
}, },
getList(){ getList() {
getSplitCode(this.filterQuery).then(res => { getSplitCode(this.filterQuery).then(res => {
if (res.code == 20000){ if (res.code == 20000) {
if (res.code === 20000) { if (res.code === 20000) {
this.list = res.data.list || []; this.list = res.data.list || [];
this.total = res.data.total || 0; this.total = res.data.total || 0;
@ -381,13 +402,30 @@ export default {
this.list = []; this.list = [];
this.total = 0; this.total = 0;
}); });
} },
//
destroyOut(_this, row) {
_this.prescribeData = row
_this.destroyType = 3
_this.destroyOutDialogVisible = true;
},
closeDialog() {
this.destroyOutDialogVisible = false
this.getList()
},
}, },
filters: {}, filters: {},
mounted() { mounted() {
this.getWorkPlaceList(this); this.getWorkPlaceList(this);
}, },
created() { created() {
if (this.$route.query.workplaceId != null) {
this.isLinkDisabled = true
this.filterQuery.workPlaceCode = this.$route.query.workplaceId
this.showType = 2
}
getHead("ioSplitCode", "1").then((re) => { getHead("ioSplitCode", "1").then((re) => {
// //
this.tableObj = re.data; this.tableObj = re.data;

@ -458,7 +458,6 @@
:destroyType="destroyType" :destroyType="destroyType"
:closeDialog="closeDialog" :closeDialog="closeDialog"
> >
</destroyOutDialog> </destroyOutDialog>
</el-dialog> </el-dialog>

@ -325,7 +325,9 @@ export default {
options: { options: {
findWorkPlace: [] findWorkPlace: []
}, },
showType: 1 showType: 1,
isLinkDisabled: false,
} }
}, },
@ -420,6 +422,7 @@ export default {
}, },
created() { created() {
if (this.$route.query.workplaceId != null) { if (this.$route.query.workplaceId != null) {
this.isLinkDisabled = true
this.filterQuery.workPlaceCode = this.$route.query.workplaceId this.filterQuery.workPlaceCode = this.$route.query.workplaceId
this.showType = 2 this.showType = 2
} }

@ -10,15 +10,15 @@
<!--</div>--> <!--</div>-->
<el-descriptions title="产品信息" :column="2" border style="margin-top: 5px"> <el-descriptions title="产品信息" :column="2" border style="margin-top: 5px">
<el-descriptions-item label="UDI码" v-if="destroyType == 2"> <el-descriptions-item label="UDI码" v-if="destroyType == 2">
{{prescribeData.code}} {{ prescribeData.code }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="产品名称" >{{ prescribeData.cpmctymc }}</el-descriptions-item> <el-descriptions-item label="产品名称">{{ prescribeData.cpmctymc }}</el-descriptions-item>
<el-descriptions-item label="产品标识">{{ prescribeData.nameCode }}</el-descriptions-item> <el-descriptions-item label="产品标识">{{ prescribeData.nameCode }}</el-descriptions-item>
<el-descriptions-item label="产品规格">{{ prescribeData.ggxh }}</el-descriptions-item> <el-descriptions-item label="产品规格">{{ prescribeData.ggxh }}</el-descriptions-item>
<el-descriptions-item label="批次号">{{ prescribeData.batchNo }}</el-descriptions-item> <el-descriptions-item label="批次号">{{ prescribeData.batchNo }}</el-descriptions-item>
<el-descriptions-item label="计量单位">{{ prescribeData.measname }}</el-descriptions-item> <el-descriptions-item label="计量单位">{{ prescribeData.measname }}</el-descriptions-item>
<el-descriptions-item label="剩余数量" custom-style class="custom-label"> <el-descriptions-item label="剩余数量" custom-style class="custom-label">
<el-tag size="small">{{prescribeData.reCount}}</el-tag> <el-tag size="small">{{ prescribeData.reCount }}</el-tag>
<!--<el-tag type="danger">{{ prescribeData.reCount}}</el-tag>--> <!--<el-tag type="danger">{{ prescribeData.reCount}}</el-tag>-->
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="生产日期">{{ produceDate }}</el-descriptions-item> <el-descriptions-item label="生产日期">{{ produceDate }}</el-descriptions-item>
@ -29,11 +29,13 @@
</el-descriptions> </el-descriptions>
<!--<el-button type="primary" icon="el-icon-plus" sty>提交</el-button>--> <!--<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"> <el-form :inline="true" :model="formData" class="demo-form-inline" style="margin-top: 30px" :rules="rules"
ref="formRef">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="损耗出库数量" prop="count"> <el-form-item label="损耗出库数量" prop="count">
<el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1" @input="checkCount"></el-input> <el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1"
@input="checkCount"></el-input>
<!--<span v-if="countExceeded" class="exceeded-message">10</span>--> <!--<span v-if="countExceeded" class="exceeded-message">10</span>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -58,7 +60,7 @@
</template> </template>
<script> <script>
import { destroyOut, destroyOutByCode } from '@/api/collect/IoDestroy' import {destroyOut, destroyOutByCode, destroySplitOut} from '@/api/collect/IoDestroy'
export default { export default {
name: 'destroyOutDialog', name: 'destroyOutDialog',
@ -78,22 +80,22 @@ export default {
}, },
data() { data() {
return { return {
formData:{}, formData: {},
produceDate: null, produceDate: null,
expireDate: null, expireDate: null,
saveLoading: false, saveLoading: false,
rules: { rules: {
count: [ count: [
{ validator: this.validateCount,message: '损耗出库数量不能超出剩余数量',trigger: 'blur' } {validator: this.validateCount, message: '损耗出库数量不能超出剩余数量', trigger: 'blur'}
] ]
}, },
} }
}, },
methods: { methods: {
conversionDate(dateString){ conversionDate(dateString) {
const parts = dateString.split(''); const parts = dateString.split('');
const year = '20' + parts.slice(0, 2).join('') ; const year = '20' + parts.slice(0, 2).join('');
const month = parts[2] + parts[3]; const month = parts[2] + parts[3];
const day = parts[4] + parts[5]; const day = parts[4] + parts[5];
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
@ -109,13 +111,13 @@ export default {
// //
this.$refs.formRef.validateField('count'); this.$refs.formRef.validateField('count');
}, },
closeAddDialog(){ closeAddDialog() {
this.closeDialog() this.closeDialog()
}, },
// //
destroyOutOrder(){ destroyOutOrder() {
if ( this.formData.count == null){ if (this.formData.count == null) {
return this.$message.error("请输入损耗数量") return this.$message.error("请输入损耗数量")
} }
let query = { let query = {
@ -123,32 +125,34 @@ export default {
remark: this.formData.remark, remark: this.formData.remark,
updateUser: this.$store.getters.adminId, updateUser: this.$store.getters.adminId,
createUser: this.$store.getters.adminId, createUser: this.$store.getters.adminId,
splitFifoInv : this.prescribeData, splitFifoInv: this.prescribeData,
code:this.prescribeData.code, code: this.prescribeData.code,
} }
if (this.destroyType == 1){ if (this.destroyType == 1) {
destroyOut(query).then(res => { destroyOut(query).then(res => {
if (res.code == 20000){ if (res.code == 20000) {
this.closeDialog() this.closeDialog()
return this.$message.success("损耗出库成功") return this.$message.success("损耗出库成功")
}else { } else {
return this.$message.error(res.message) return this.$message.error(res.message)
} }
}) })
}else { } else if (this.destroyType == 1) {
destroyOutByCode(query).then(res => { destroySplitOut(query).then(res => {
if (res.code == 20000){ if (res.code == 20000) {
this.closeDialog() this.closeDialog()
return this.$message.success("损耗出库成功") return this.$message.success("损耗出库成功")
}else { } else {
return this.$message.error("损耗出库失败") return this.$message.error("损耗出库失败")
} }
}) })
} else if (this.destroyType == 3) {
} }
}, },
destroyOutByCodeOrder(){ destroyOutByCodeOrder() {
if ( this.formData.count == null){ if (this.formData.count == null) {
return this.$message.error("请输入损耗数量") return this.$message.error("请输入损耗数量")
} }
let query = { let query = {
@ -156,21 +160,21 @@ export default {
remark: this.formData.remark, remark: this.formData.remark,
updateUser: this.$store.getters.adminId, updateUser: this.$store.getters.adminId,
createUser: this.$store.getters.adminId, createUser: this.$store.getters.adminId,
splitFifoInv : this.prescribeData, splitFifoInv: this.prescribeData,
code:this.formData.code, code: this.formData.code,
} }
} }
}, },
created() { created() {
if (this.prescribeData.produceDate != null){ if (this.prescribeData.produceDate != null) {
this.produceDate = this.conversionDate(this.prescribeData.produceDate) this.produceDate = this.conversionDate(this.prescribeData.produceDate)
} }
if (this.prescribeData.expireDate != null){ if (this.prescribeData.expireDate != null) {
this.expireDate = this.conversionDate(this.prescribeData.expireDate) this.expireDate = this.conversionDate(this.prescribeData.expireDate)
} }
if (this.destroyType == 2){ if (this.destroyType == 2) {
this.prescribeData.reCount = this.prescribeData.totalCount this.prescribeData.reCount = this.prescribeData.totalCount
} }
} }

Loading…
Cancel
Save