parent
b53d05b4a1
commit
e62b2a1eb9
7 changed files with 696 additions and 451 deletions
@ -1,212 +1,281 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 镀后入库 --> |
<!-- 镀后入库 --> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item name="allegation"><input type="text" v-model="value" @confirm="confirm" |
<uni-forms-item name="allegation" |
||||||
class="uni-input-border" placeholder="流程卡" /></uni-forms-item> |
><input |
||||||
</uni-forms> |
type="text" |
||||||
<t-table style="margin-top:20rpx"> |
v-model="value" |
||||||
<t-tr> |
@confirm="confirm" |
||||||
<t-td>移交类型</t-td> |
class="uni-input-border" |
||||||
<t-td> |
placeholder="流程卡" |
||||||
<picker @change="bindPickerChange" :value="index" :range="array"> |
/></uni-forms-item> |
||||||
<view style="font-size: 32rpx;">{{array[index]}}</view> |
</uni-forms> |
||||||
</picker> |
<t-table style="margin-top: 20rpx"> |
||||||
</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>移交类型</t-td> |
||||||
<t-tr> |
<t-td> |
||||||
<t-td>流程卡号</t-td> |
<picker @change="bindPickerChange" :value="index" :range="array"> |
||||||
<t-td>{{ prWorkOrder.cardNo }}</t-td> |
<view style="font-size: 32rpx">{{ array[index] }}</view> |
||||||
</t-tr> |
</picker> |
||||||
<t-tr> |
</t-td> |
||||||
<t-td>车间订单号</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.woCode }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>流程卡号</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.cardNo }}</t-td> |
||||||
<t-td>批次号</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.batchNo }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>车间订单号</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.woCode }}</t-td> |
||||||
<t-td>需求部门</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.pjYieldOrder.useDept }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>批次号</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.batchNo }}</t-td> |
||||||
<t-td>零件编码</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.pjYieldOrder.partCode }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>需求部门</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.useDept }}</t-td> |
||||||
<t-td>零件名称</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.pjYieldOrder.partName }}</t-td> |
<!-- <t-tr> |
||||||
</t-tr> |
<t-td>零件编码</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.partCode }}</t-td> |
||||||
<t-td>工序号</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkPlan.orders }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>零件名称</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.partName }}</t-td> |
||||||
<t-td>工序名称</t-td> |
</t-tr> --> |
||||||
<t-td>{{ prWorkPlan.procedureSet.ppsName }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>工序号</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkPlan.processCode }}</t-td> |
||||||
<t-td>班组/供应商</t-td> |
</t-tr> |
||||||
<t-td>{{ makeTeam.tsName || oemCustomer.ocName }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>工序名称</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkPlan.processName }}</t-td> |
||||||
<t-td>入库数量</t-td> |
</t-tr> |
||||||
<t-td>{{ prWorkOrder.makeQty }}</t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>班组/供应商</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkPlan.teamCode || prWorkPlan.ocName }}</t-td> |
||||||
<t-td>移交部门</t-td> |
</t-tr> |
||||||
<t-td><input type="text" v-model="useDept" /></t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>入库数量</t-td> |
||||||
<t-tr> |
<t-td>{{ prWorkOrder.inQuantity }}</t-td> |
||||||
<t-td style="color:red">重量</t-td> |
</t-tr> |
||||||
<t-td><input type="number" v-model="weight" /></t-td> |
<t-tr> |
||||||
</t-tr> |
<t-td>移交部门</t-td> |
||||||
</t-table> |
<t-td><input type="text" v-model="useDept" /></t-td> |
||||||
<view class="buttonBox"><button class="button" type="primary" |
</t-tr> |
||||||
:disabled="!(Object.keys(prWorkOrder.pjYieldOrder).length)>0" @click="submitClick">入库</button></view> |
<t-tr> |
||||||
</ifrm> |
<t-td style="color: red">重量</t-td> |
||||||
|
<t-td><input type="number" v-model="weight" /></t-td> |
||||||
|
</t-tr> |
||||||
|
</t-table> |
||||||
|
<view class="buttonBox" |
||||||
|
><button |
||||||
|
class="button" |
||||||
|
type="primary" |
||||||
|
:disabled="Object.keys(prWorkOrder).length <= 0" |
||||||
|
@click="submitClick" |
||||||
|
> |
||||||
|
入库 |
||||||
|
</button></view |
||||||
|
> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import tTable from '@/components/t-table/t-table.vue'; |
import tTable from "@/components/t-table/t-table.vue"; |
||||||
import tTh from '@/components/t-table/t-th.vue'; |
import tTh from "@/components/t-table/t-th.vue"; |
||||||
import tTr from '@/components/t-table/t-tr.vue'; |
import tTr from "@/components/t-table/t-tr.vue"; |
||||||
import tTd from '@/components/t-table/t-td.vue'; |
import tTd from "@/components/t-table/t-td.vue"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
export default { |
||||||
mixins: [scan], |
mixins: [scan], |
||||||
components: { |
components: { |
||||||
ifrm, |
ifrm, |
||||||
tTable, |
tTable, |
||||||
tTh, |
tTh, |
||||||
tTr, |
tTr, |
||||||
tTd |
tTd, |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
value: '', |
value: "", |
||||||
prWorkPlan: {}, |
prWorkPlan: {}, |
||||||
prWorkOrder: {}, |
prWorkOrder: {}, |
||||||
quantity: null, |
quantity: null, |
||||||
makeTeam: {}, |
makeTeam: {}, |
||||||
oemCustomer: {}, |
oemCustomer: {}, |
||||||
weight: 0, |
weight: 0, |
||||||
useDept: null, |
useDept: null, |
||||||
array: ['转工', '入库'], |
array: ["转工", "入库"], |
||||||
index: 1, |
index: 1, |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
onLoad() { |
onLoad() { |
||||||
this.setData(); |
this.setData(); |
||||||
}, |
}, |
||||||
onShow() {}, |
onShow() {}, |
||||||
|
|
||||||
methods: { |
methods: { |
||||||
bindPickerChange(e) { |
bindPickerChange(e) { |
||||||
this.index = e.detail.value |
this.index = e.detail.value; |
||||||
if (e.detail.value == 1) { |
if (e.detail.value == 1) { |
||||||
this.prWorkPlan.prWorkOrder.hrTypeBool = false |
this.prWorkPlan.hrTypeBool = false; |
||||||
} else { |
} else { |
||||||
this.prWorkPlan.prWorkOrder.hrTypeBool = true |
this.prWorkPlan.hrTypeBool = true; |
||||||
} |
} |
||||||
this.useDept = '' |
this.useDept = ""; |
||||||
}, |
}, |
||||||
getBarCode(code, isConfirm = false) { |
getBarCode(code, isConfirm = false) { |
||||||
this.getData(code); |
this.getData(code); |
||||||
}, |
}, |
||||||
confirm(e) { |
confirm(e) { |
||||||
this.getBarCode(e.target.value, true); |
this.getBarCode(e.target.value, true); |
||||||
}, |
}, |
||||||
getData(code) { |
getData(code) { |
||||||
if (!code) return; |
if (!code) return; |
||||||
this.value = code; |
this.value = code; |
||||||
this.$ajax.request({ |
uni.showLoading({ |
||||||
url: 'pdaLoad/loadPlateAe/' + code, |
title: "加载中...", |
||||||
method: 'GET', |
}); |
||||||
success: data => { |
this.$u.api.getAfterPlatInCardNo({ cardNo: code }).then((res) => { |
||||||
this.value = ''; |
uni.hideLoading(); |
||||||
this.prWorkPlan = data; |
let data = res.data; |
||||||
this.prWorkOrder = data.prWorkOrder; |
this.value = ""; |
||||||
if (data.prWorkOrder.hrTypeBool) { |
this.prWorkPlan = data; |
||||||
this.index = 0 |
this.prWorkOrder = data; |
||||||
} else { |
if (data.hrTypeBool) { |
||||||
this.index = 1 |
this.index = 0; |
||||||
} |
} else { |
||||||
// 有为空 没有为useDept |
this.index = 1; |
||||||
if (data.prWorkOrder.pjYieldOrder.nextRoam) { |
|
||||||
this.useDept = ''; |
|
||||||
} else { |
|
||||||
this.useDept = data.prWorkOrder.pjYieldOrder.useDept; |
|
||||||
} |
|
||||||
this.quantity = data.prWorkOrder.makeQty; |
|
||||||
if (!data.oem) { |
|
||||||
this.makeTeam = data.makeTeam; |
|
||||||
} |
|
||||||
if (data.oemCustomer) { |
|
||||||
this.oemCustomer = data.oemCustomer; |
|
||||||
} |
|
||||||
uni.showToast({ |
|
||||||
title: '数据获取成功' |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
submitClick() { |
|
||||||
if (this.useDept == '' || this.useDept == null) { |
|
||||||
return uni.showToast({ |
|
||||||
icon: 'none', |
|
||||||
title: '请填写移交部门!!!' |
|
||||||
}); |
|
||||||
} |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaSave/savePlateAe', |
|
||||||
method: 'POST', |
|
||||||
data: { |
|
||||||
prWorkPlan: this.prWorkPlan, |
|
||||||
quantity: this.quantity, |
|
||||||
makeTeam: this.makeTeam, |
|
||||||
weight: this.weight, |
|
||||||
useDept: this.useDept, |
|
||||||
hrTypeBool: this.prWorkPlan.prWorkOrder.hrTypeBool |
|
||||||
}, |
|
||||||
success: data => { |
|
||||||
uni.showToast({ |
|
||||||
title: '入库成功' |
|
||||||
}); |
|
||||||
this.value = ''; |
|
||||||
this.setData(); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
setData() { |
|
||||||
this.prWorkPlan = { |
|
||||||
procedureSet: {} |
|
||||||
}; |
|
||||||
this.prWorkOrder = { |
|
||||||
pjYieldOrder: {}, |
|
||||||
nextProcedureSet: {}, |
|
||||||
nextMakeTeam: {}, |
|
||||||
nextBsOemCustomer: {} |
|
||||||
}; |
|
||||||
this.quantity = null; |
|
||||||
this.makeTeam = {}; |
|
||||||
this.oemCustomer = {}; |
|
||||||
this.useDept = null; |
|
||||||
this.weight = null; |
|
||||||
} |
|
||||||
}, |
|
||||||
onNavigationBarButtonTap(btn) { |
|
||||||
this.$refs.ifrm.topMenuClick(btn); |
|
||||||
} |
} |
||||||
}; |
// 有为空 没有为useDept |
||||||
|
if (data.nextRoam) { |
||||||
|
this.useDept = ""; |
||||||
|
} else { |
||||||
|
this.useDept = data.useDept; |
||||||
|
} |
||||||
|
this.quantity = data.makeQty; |
||||||
|
if (!data.oem) { |
||||||
|
this.makeTeam = data.makeTeam; |
||||||
|
} |
||||||
|
if (data.oemCustomer) { |
||||||
|
this.oemCustomer = data.oemCustomer; |
||||||
|
} |
||||||
|
uni.showToast({ |
||||||
|
title: "数据获取成功", |
||||||
|
}); |
||||||
|
}); |
||||||
|
// this.$ajax.request({ |
||||||
|
// url: "pdaLoad/loadPlateAe/" + code, |
||||||
|
// method: "GET", |
||||||
|
// success: (data) => { |
||||||
|
// this.value = ""; |
||||||
|
// this.prWorkPlan = data; |
||||||
|
// this.prWorkOrder = data.prWorkOrder; |
||||||
|
// if (data.prWorkOrder.hrTypeBool) { |
||||||
|
// this.index = 0; |
||||||
|
// } else { |
||||||
|
// this.index = 1; |
||||||
|
// } |
||||||
|
// // 有为空 没有为useDept |
||||||
|
// if (data.prWorkOrder.pjYieldOrder.nextRoam) { |
||||||
|
// this.useDept = ""; |
||||||
|
// } else { |
||||||
|
// this.useDept = data.prWorkOrder.pjYieldOrder.useDept; |
||||||
|
// } |
||||||
|
// this.quantity = data.prWorkOrder.makeQty; |
||||||
|
// if (!data.oem) { |
||||||
|
// this.makeTeam = data.makeTeam; |
||||||
|
// } |
||||||
|
// if (data.oemCustomer) { |
||||||
|
// this.oemCustomer = data.oemCustomer; |
||||||
|
// } |
||||||
|
// uni.showToast({ |
||||||
|
// title: "数据获取成功", |
||||||
|
// }); |
||||||
|
// }, |
||||||
|
// }); |
||||||
|
}, |
||||||
|
submitClick() { |
||||||
|
if (this.useDept == "" || this.useDept == null) { |
||||||
|
return uni.showToast({ |
||||||
|
icon: "none", |
||||||
|
title: "请填写移交部门!!!", |
||||||
|
}); |
||||||
|
} |
||||||
|
// let query_ = { |
||||||
|
// prWorkPlan: this.prWorkPlan, |
||||||
|
// quantity: this.quantity, |
||||||
|
// makeTeam: this.makeTeam, |
||||||
|
// weight: this.weight, |
||||||
|
// useDept: this.useDept, |
||||||
|
// hrTypeBool: this.prWorkPlan.prWorkOrder.hrTypeBool, |
||||||
|
// }; |
||||||
|
uni.showLoading({ |
||||||
|
title: "加载中...", |
||||||
|
}); |
||||||
|
let query = []; |
||||||
|
query.push({ |
||||||
|
wpId: this.prWorkPlan.wpId, |
||||||
|
tsId: this.prWorkPlan.teamId, |
||||||
|
ocId: this.prWorkPlan.ocId ? this.prWorkPlan.ocId : null, |
||||||
|
quantity: this.prWorkPlan.inQuantity, |
||||||
|
hrTypeBool: this.prWorkPlan.hrTypeBool, |
||||||
|
useDept: this.useDept, |
||||||
|
weight: this.weight, |
||||||
|
}); |
||||||
|
console.log(9898989, query); |
||||||
|
this.$u.api.saveAfterPlatIn(query).then((res) => { |
||||||
|
uni.hideLoading(); |
||||||
|
uni.showToast({ |
||||||
|
title: "入库成功", |
||||||
|
}); |
||||||
|
this.value = ""; |
||||||
|
this.setData(); |
||||||
|
}); |
||||||
|
// this.$ajax.request({ |
||||||
|
// url: "pdaSave/savePlateAe", |
||||||
|
// method: "POST", |
||||||
|
// data: { |
||||||
|
// prWorkPlan: this.prWorkPlan, |
||||||
|
// quantity: this.quantity, |
||||||
|
// makeTeam: this.makeTeam, |
||||||
|
// weight: this.weight, |
||||||
|
// useDept: this.useDept, |
||||||
|
// hrTypeBool: this.prWorkPlan.prWorkOrder.hrTypeBool, |
||||||
|
// }, |
||||||
|
// success: (data) => { |
||||||
|
// uni.showToast({ |
||||||
|
// title: "入库成功", |
||||||
|
// }); |
||||||
|
// this.value = ""; |
||||||
|
// this.setData(); |
||||||
|
// }, |
||||||
|
// }); |
||||||
|
}, |
||||||
|
setData() { |
||||||
|
this.prWorkPlan = {}; |
||||||
|
this.prWorkOrder = {}; |
||||||
|
this.quantity = null; |
||||||
|
this.makeTeam = {}; |
||||||
|
this.oemCustomer = {}; |
||||||
|
this.useDept = null; |
||||||
|
this.weight = null; |
||||||
|
}, |
||||||
|
}, |
||||||
|
onNavigationBarButtonTap(btn) { |
||||||
|
this.$refs.ifrm.topMenuClick(btn); |
||||||
|
}, |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped> |
<style scoped> |
||||||
.tabsBox { |
.tabsBox { |
||||||
margin-top: 40rpx; |
margin-top: 40rpx; |
||||||
} |
} |
||||||
|
|
||||||
.contentBox {} |
.contentBox { |
||||||
|
} |
||||||
</style> |
</style> |
||||||
@ -1,246 +1,345 @@ |
|||||||
<template> |
<template> |
||||||
<ifrm ref="ifrm"> |
<ifrm ref="ifrm"> |
||||||
<!-- 工序检验 --> |
<!-- 工序检验 --> |
||||||
<u-sticky offset-top="10"> |
<u-sticky offset-top="10"> |
||||||
<uni-forms ref="form" err-show-type="toast"> |
<uni-forms ref="form" err-show-type="toast"> |
||||||
<uni-forms-item name="allegation"><input type="text" v-model="value" @confirm="proConfrim" |
<uni-forms-item name="allegation" |
||||||
class="uni-input-border" placeholder="流程卡" /></uni-forms-item> |
><input |
||||||
</uni-forms> |
type="text" |
||||||
</u-sticky> |
v-model="value" |
||||||
|
@confirm="proConfrim" |
||||||
|
class="uni-input-border" |
||||||
|
placeholder="流程卡" |
||||||
|
/></uni-forms-item> |
||||||
|
</uni-forms> |
||||||
|
</u-sticky> |
||||||
|
|
||||||
<t-table> |
<t-table> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>流程卡号</t-td> |
<t-td>流程卡号</t-td> |
||||||
<t-td>{{ tableObj.cardNo }}</t-td> |
<t-td>{{ tableObj.cardNo }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>车间订单号</t-td> |
<t-td>车间订单号</t-td> |
||||||
<t-td>{{ tableObj.woCode }}</t-td> |
<t-td>{{ tableObj.woCode }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>批单号</t-td> |
<t-td>批单号</t-td> |
||||||
<t-td>{{ tableObj.batchNo }}</t-td> |
<t-td>{{ tableObj.batchNo }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>零件编码</t-td> |
<t-td>零件编码</t-td> |
||||||
<t-td>{{ tableObj.partCode }}</t-td> |
<t-td>{{ tableObj.partCode }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<!-- <t-tr> |
||||||
<t-td>零件名称</t-td> |
<t-td>零件名称</t-td> |
||||||
<t-td>{{ tableObj.partName }}</t-td> |
<t-td>{{ tableObj.partName }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>上序号</t-td> |
<t-td>上序号</t-td> |
||||||
<t-td>{{ tableObj.frontOrders }}</t-td> |
<t-td>{{ tableObj.frontOrders }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>上序名称</t-td> |
<t-td>上序名称</t-td> |
||||||
<t-td>{{ tableObj.frontPpsName }}</t-td> |
<t-td>{{ tableObj.frontPpsName }}</t-td> |
||||||
</t-tr> |
</t-tr> --> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>工序号</t-td> |
<t-td>工序号</t-td> |
||||||
<t-td>{{ tableObj.orders }}</t-td> |
<t-td>{{ tableObj.orders }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>工序名称</t-td> |
<t-td>工序名称</t-td> |
||||||
<t-td>{{ tableObj.ppsName }}</t-td> |
<t-td>{{ tableObj.ppsName }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>班组</t-td> |
<t-td>班组</t-td> |
||||||
<t-td>{{ tableObj.makeTeam }}</t-td> |
<t-td>{{ tableObj.makeTeam }}</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>检验数量</t-td> |
<t-td>检验数量</t-td> |
||||||
<t-td><input type="number" v-model="tableObj.makeQty" /></t-td> |
<t-td><input type="number" v-model="tableObj.makeQty" /></t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>是否合格</t-td> |
<t-td>是否合格</t-td> |
||||||
<t-td> |
<t-td> |
||||||
<picker @change="bindPickerChange" :value="pickerIndex" :range="array"> |
<picker |
||||||
<view>{{ array[pickerIndex] }}</view> |
@change="bindPickerChange" |
||||||
</picker> |
:value="pickerIndex" |
||||||
</t-td> |
:range="array" |
||||||
</t-tr> |
> |
||||||
<t-tr> |
<view>{{ array[pickerIndex] || "请选择" }}</view> |
||||||
<t-td>合格数量</t-td> |
</picker> |
||||||
<t-td><input :disabled="pickerIndex > 0" type="number" v-model="fillInObj.qualifiedQty" /></t-td> |
</t-td> |
||||||
</t-tr> |
</t-tr> |
||||||
<t-tr> |
<t-tr> |
||||||
<t-td>不合格数量</t-td> |
<t-td>合格数量</t-td> |
||||||
<t-td><input :disabled="pickerIndex > 0" type="number" v-model="fillInObj.unqualifiedQty" /></t-td> |
<t-td |
||||||
</t-tr> |
><input |
||||||
<t-tr> |
:disabled="pickerIndex > 0" |
||||||
<t-td style="color: red;">比例(%)</t-td> |
type="number" |
||||||
<t-td><input type="" type="number" v-model="fillInObj.scale" /></t-td> |
v-model="fillInObj.qualifiedQty" |
||||||
</t-tr> |
/></t-td> |
||||||
<t-tr> |
</t-tr> |
||||||
<t-td>不良原因</t-td> |
<t-tr> |
||||||
<t-td><uni-data-select v-model="fillInObj.poorReason" :localdata="reasonArr"></uni-data-select></t-td> |
<t-td>不合格数量</t-td> |
||||||
</t-tr> |
<t-td |
||||||
<t-tr> |
><input |
||||||
<t-td>不良描述</t-td> |
:disabled="pickerIndex > 0" |
||||||
<t-td><uni-easyinput type="textarea" v-model="fillInObj.poorMemo"></uni-easyinput></t-td> |
type="number" |
||||||
</t-tr> |
v-model="fillInObj.unqualifiedQty" |
||||||
</t-table> |
/></t-td> |
||||||
<view class="buttonBox"><button class="button" type="primary" :disabled="!(Object.keys(tableObj).length>1)" |
</t-tr> |
||||||
@click="submitClick">保存</button></view> |
<t-tr> |
||||||
</ifrm> |
<t-td style="color: red">比例(%)</t-td> |
||||||
|
<t-td><input type="" type="number" v-model="fillInObj.scale" /></t-td> |
||||||
|
</t-tr> |
||||||
|
<t-tr> |
||||||
|
<t-td>不良原因</t-td> |
||||||
|
<t-td |
||||||
|
><uni-data-select |
||||||
|
v-model="fillInObj.poorReason" |
||||||
|
:localdata="reasonArr" |
||||||
|
></uni-data-select |
||||||
|
></t-td> |
||||||
|
</t-tr> |
||||||
|
<t-tr> |
||||||
|
<t-td>不良描述</t-td> |
||||||
|
<t-td |
||||||
|
><uni-easyinput |
||||||
|
type="textarea" |
||||||
|
v-model="fillInObj.poorMemo" |
||||||
|
></uni-easyinput |
||||||
|
></t-td> |
||||||
|
</t-tr> |
||||||
|
</t-table> |
||||||
|
<view class="buttonBox" |
||||||
|
><button |
||||||
|
class="button" |
||||||
|
type="primary" |
||||||
|
:disabled="!(Object.keys(tableObj).length > 1)" |
||||||
|
@click="submitClick" |
||||||
|
> |
||||||
|
保存 |
||||||
|
</button></view |
||||||
|
> |
||||||
|
</ifrm> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import ifrm from '@/pages/index/ifrm'; |
import ifrm from "@/pages/index/ifrm"; |
||||||
import tTable from '@/components/t-table/t-table.vue'; |
import tTable from "@/components/t-table/t-table.vue"; |
||||||
import tTh from '@/components/t-table/t-th.vue'; |
import tTh from "@/components/t-table/t-th.vue"; |
||||||
import tTr from '@/components/t-table/t-tr.vue'; |
import tTr from "@/components/t-table/t-tr.vue"; |
||||||
import tTd from '@/components/t-table/t-td.vue'; |
import tTd from "@/components/t-table/t-td.vue"; |
||||||
import scan from '../../mixin/scan.js'; |
import scan from "../../mixin/scan.js"; |
||||||
export default { |
export default { |
||||||
mixins: [scan], |
mixins: [scan], |
||||||
components: { |
components: { |
||||||
ifrm, |
ifrm, |
||||||
tTable, |
tTable, |
||||||
tTh, |
tTh, |
||||||
tTr, |
tTr, |
||||||
tTd |
tTd, |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
value: '', |
value: "", |
||||||
tableObj: { |
tableObj: { |
||||||
makeQty: null, |
makeQty: null, |
||||||
}, |
}, |
||||||
fillInObj: { |
fillInObj: { |
||||||
qualifiedQty: null, |
qualifiedQty: null, |
||||||
unqualifiedQty: null, |
unqualifiedQty: null, |
||||||
poorReason: '', |
poorReason: "", |
||||||
poorMemo: '' |
poorMemo: "", |
||||||
}, |
}, |
||||||
pickerIndex: null, |
pickerIndex: null, |
||||||
array: ['合格', '不合格', 'NA'], |
array: ["合格", "不合格", "NA"], |
||||||
reasonArr: [] |
reasonArr: [], |
||||||
}; |
|
||||||
}, |
|
||||||
onLoad() { |
|
||||||
this.reasonArr = []; |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'comBox/product/queryPoorReason', |
|
||||||
method: 'POST', |
|
||||||
data: { |
|
||||||
filterValue: null, |
|
||||||
paging: { |
|
||||||
pageSize: 9999999, |
|
||||||
pageNumber: 1 |
|
||||||
}, |
|
||||||
baseParams: {} |
|
||||||
}, |
|
||||||
success: data => { |
|
||||||
data.list.forEach(item => { |
|
||||||
this.reasonArr.push({ |
|
||||||
value: item.bcId, |
|
||||||
text: item.name |
|
||||||
}); |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
bindPickerChange: function(e) { |
|
||||||
if (e.detail.value == 1) { |
|
||||||
this.fillInObj.unqualifiedQty = this.tableObj.makeQty; |
|
||||||
this.fillInObj.qualifiedQty = 0; |
|
||||||
} else { |
|
||||||
this.fillInObj.unqualifiedQty = 0; |
|
||||||
this.fillInObj.qualifiedQty = this.tableObj.makeQty; |
|
||||||
} |
|
||||||
this.pickerIndex = e.detail.value; |
|
||||||
}, |
|
||||||
getBarCode(code) { |
|
||||||
this.getData(code); |
|
||||||
}, |
|
||||||
proConfrim(e) { |
|
||||||
this.getBarCode(e.target.value); |
|
||||||
}, |
|
||||||
getData(code) { |
|
||||||
if (!code) return; |
|
||||||
this.value = code; |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaLoad/loadProTest/' + code, |
|
||||||
method: 'GET', |
|
||||||
success: data => { |
|
||||||
this.value = ''; |
|
||||||
this.tableObj = data.pdaProRelevant; |
|
||||||
this.pickerIndex = 0; |
|
||||||
this.fillInObj = { |
|
||||||
unqualifiedQty: 0, |
|
||||||
qualifiedQty: this.tableObj.makeQty, |
|
||||||
poorReason: '', |
|
||||||
poorMemo: '' |
|
||||||
}; |
|
||||||
uni.showToast({ |
|
||||||
title: '数据获取成功' |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
submitClick() { |
|
||||||
const num = Number(this.fillInObj.unqualifiedQty) + Number(this.fillInObj.qualifiedQty); |
|
||||||
if (num > this.tableObj.makeQty) { |
|
||||||
return uni.showToast({ |
|
||||||
title: '合格与不合格数量之和不能大于检验数量', |
|
||||||
icon: 'none' |
|
||||||
}); |
|
||||||
} |
|
||||||
if (this.pickerIndex == 1) { |
|
||||||
if (this.fillInObj.poorReason == '' || this.fillInObj.poorMemo == '') { |
|
||||||
return uni.showToast({ |
|
||||||
title: '请填写原因或描述!!!', |
|
||||||
icon: 'none' |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
|
||||||
if (Number(this.fillInObj.scale) > 100 || Number(this.fillInObj.scale) < 0) { |
|
||||||
return uni.showToast({ |
|
||||||
title: '比例所填值的范围在 0~100!!!', |
|
||||||
icon: 'none' |
|
||||||
}); |
|
||||||
} |
|
||||||
this.fillInObj.checkResult = this.pickerIndex + 1; |
|
||||||
this.fillInObj.makeQty = this.tableObj.makeQty; |
|
||||||
this.fillInObj.wpId = this.tableObj.wpId; |
|
||||||
this.$ajax.request({ |
|
||||||
url: 'pdaSave/saveProCheck', |
|
||||||
method: 'POST', |
|
||||||
data: this.fillInObj, |
|
||||||
success: data => { |
|
||||||
uni.showToast({ |
|
||||||
title: '检验成功' |
|
||||||
}); |
|
||||||
this.pickerIndex = null; |
|
||||||
this.tableObj = { |
|
||||||
makeQty: null |
|
||||||
}; |
|
||||||
this.fillInObj = { |
|
||||||
qualifiedQty: null, |
|
||||||
unqualifiedQty: null, |
|
||||||
poorReason: '', |
|
||||||
poorMemo: '' |
|
||||||
}; |
|
||||||
this.value = ''; |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
}, |
|
||||||
onNavigationBarButtonTap(btn) { |
|
||||||
this.$refs.ifrm.topMenuClick(btn); |
|
||||||
}, |
|
||||||
onShow() {} |
|
||||||
}; |
}; |
||||||
|
}, |
||||||
|
onLoad() { |
||||||
|
this.reasonArr = []; |
||||||
|
uni.showLoading({ |
||||||
|
title: "加载中...", |
||||||
|
}); |
||||||
|
this.$u.api.dictionaryNew({ code: "defective_cause" }).then((res) => { |
||||||
|
let data = res.data; |
||||||
|
data.forEach((item) => { |
||||||
|
this.reasonArr.push({ |
||||||
|
value: item.dictKey, |
||||||
|
text: item.dictValue, |
||||||
|
}); |
||||||
|
uni.hideLoading(); |
||||||
|
}); |
||||||
|
}); |
||||||
|
// this.$ajax.request({ |
||||||
|
// url: "comBox/product/queryPoorReason", |
||||||
|
// method: "POST", |
||||||
|
// data: { |
||||||
|
// filterValue: null, |
||||||
|
// paging: { |
||||||
|
// pageSize: 9999999, |
||||||
|
// pageNumber: 1, |
||||||
|
// }, |
||||||
|
// baseParams: {}, |
||||||
|
// }, |
||||||
|
// success: (data) => { |
||||||
|
// data.list.forEach((item) => { |
||||||
|
// this.reasonArr.push({ |
||||||
|
// value: item.bcId, |
||||||
|
// text: item.name, |
||||||
|
// }); |
||||||
|
// }); |
||||||
|
// }, |
||||||
|
// }); |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
bindPickerChange: function (e) { |
||||||
|
if (e.detail.value == 1) { |
||||||
|
this.fillInObj.unqualifiedQty = this.tableObj.makeQty; |
||||||
|
this.fillInObj.qualifiedQty = 0; |
||||||
|
} else { |
||||||
|
this.fillInObj.unqualifiedQty = 0; |
||||||
|
this.fillInObj.qualifiedQty = this.tableObj.makeQty; |
||||||
|
} |
||||||
|
this.pickerIndex = e.detail.value; |
||||||
|
}, |
||||||
|
getBarCode(code) { |
||||||
|
this.getData(code); |
||||||
|
}, |
||||||
|
proConfrim(e) { |
||||||
|
uni.showLoading({ |
||||||
|
title: "加载中...", |
||||||
|
}); |
||||||
|
this.getBarCode(e.target.value); |
||||||
|
}, |
||||||
|
getData(code) { |
||||||
|
if (!code) return; |
||||||
|
this.value = code; |
||||||
|
this.$u.api |
||||||
|
.loadProTest({ cardNo: code }) |
||||||
|
.then((res) => { |
||||||
|
let data = res.data; |
||||||
|
this.value = ""; |
||||||
|
this.tableObj = data; |
||||||
|
this.pickerIndex = 0; |
||||||
|
this.fillInObj = { |
||||||
|
unqualifiedQty: 0, |
||||||
|
qualifiedQty: this.tableObj.makeQty, |
||||||
|
poorReason: "", |
||||||
|
poorMemo: "", |
||||||
|
}; |
||||||
|
uni.showToast({ |
||||||
|
title: "数据获取成功", |
||||||
|
}); |
||||||
|
uni.hideLoading(); |
||||||
|
}) |
||||||
|
.catch((err) => {}); |
||||||
|
// this.$ajax.request({ |
||||||
|
// url: "pdaLoad/loadProTest/" + code, |
||||||
|
// method: "GET", |
||||||
|
// success: (data) => { |
||||||
|
// this.value = ""; |
||||||
|
// this.tableObj = data.pdaProRelevant; |
||||||
|
// this.pickerIndex = 0; |
||||||
|
// this.fillInObj = { |
||||||
|
// unqualifiedQty: 0, |
||||||
|
// qualifiedQty: this.tableObj.makeQty, |
||||||
|
// poorReason: "", |
||||||
|
// poorMemo: "", |
||||||
|
// }; |
||||||
|
// uni.showToast({ |
||||||
|
// title: "数据获取成功", |
||||||
|
// }); |
||||||
|
// }, |
||||||
|
// }); |
||||||
|
}, |
||||||
|
submitClick() { |
||||||
|
const num = |
||||||
|
Number(this.fillInObj.unqualifiedQty) + |
||||||
|
Number(this.fillInObj.qualifiedQty); |
||||||
|
if (num > this.tableObj.makeQty) { |
||||||
|
return uni.showToast({ |
||||||
|
title: "合格与不合格数量之和不能大于检验数量", |
||||||
|
icon: "none", |
||||||
|
}); |
||||||
|
} |
||||||
|
if (this.pickerIndex == 1) { |
||||||
|
if (this.fillInObj.poorReason == "" || this.fillInObj.poorMemo == "") { |
||||||
|
return uni.showToast({ |
||||||
|
title: "请填写原因或描述!!!", |
||||||
|
icon: "none", |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
if ( |
||||||
|
Number(this.fillInObj.scale) > 100 || |
||||||
|
Number(this.fillInObj.scale) < 0 |
||||||
|
) { |
||||||
|
return uni.showToast({ |
||||||
|
title: "比例所填值的范围在 0~100!!!", |
||||||
|
icon: "none", |
||||||
|
}); |
||||||
|
} |
||||||
|
uni.showLoading({ |
||||||
|
title: "加载中...", |
||||||
|
}); |
||||||
|
this.fillInObj.checkResult = this.pickerIndex + 1; |
||||||
|
this.fillInObj.makeQty = this.tableObj.makeQty; |
||||||
|
this.fillInObj.wpId = this.tableObj.wpId; |
||||||
|
this.$u.api.saveProCheck(this.fillInObj).then((res) => { |
||||||
|
uni.showToast({ |
||||||
|
title: "检验成功", |
||||||
|
}); |
||||||
|
this.pickerIndex = null; |
||||||
|
this.tableObj = { |
||||||
|
makeQty: null, |
||||||
|
}; |
||||||
|
this.fillInObj = { |
||||||
|
qualifiedQty: null, |
||||||
|
unqualifiedQty: null, |
||||||
|
poorReason: "", |
||||||
|
poorMemo: "", |
||||||
|
}; |
||||||
|
this.value = ""; |
||||||
|
uni.hideLoading(); |
||||||
|
}); |
||||||
|
// this.$ajax.request({ |
||||||
|
// url: "pdaSave/saveProCheck", |
||||||
|
// method: "POST", |
||||||
|
// data: this.fillInObj, |
||||||
|
// success: (data) => { |
||||||
|
// uni.showToast({ |
||||||
|
// title: "检验成功", |
||||||
|
// }); |
||||||
|
// this.pickerIndex = null; |
||||||
|
// this.tableObj = { |
||||||
|
// makeQty: null, |
||||||
|
// }; |
||||||
|
// this.fillInObj = { |
||||||
|
// qualifiedQty: null, |
||||||
|
// unqualifiedQty: null, |
||||||
|
// poorReason: "", |
||||||
|
// poorMemo: "", |
||||||
|
// }; |
||||||
|
// this.value = ""; |
||||||
|
// }, |
||||||
|
// }); |
||||||
|
}, |
||||||
|
}, |
||||||
|
onNavigationBarButtonTap(btn) { |
||||||
|
this.$refs.ifrm.topMenuClick(btn); |
||||||
|
}, |
||||||
|
onShow() {}, |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped> |
<style scoped> |
||||||
.tabsBox { |
.tabsBox { |
||||||
margin-top: 40rpx; |
margin-top: 40rpx; |
||||||
} |
} |
||||||
|
|
||||||
.contentBox {} |
.contentBox { |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 29 KiB |
Loading…
Reference in new issue