|
@@ -281,23 +281,6 @@
|
|
|
console.log(auxiliaryDayworkItem.value)
|
|
|
}
|
|
|
|
|
|
- //查询咨询列表
|
|
|
- function getInspecion() {
|
|
|
- auxiliaryDayworkItem.value = store.processInspection
|
|
|
- selectInspecion(auxiliaryDayworkItem.value).then(res => {
|
|
|
- console.log("咨询", res);
|
|
|
- if (res.code == 200) {
|
|
|
- console.log("res", res);
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
//结束报工按钮
|
|
|
function endWork() {
|
|
|
let unf = unfitInfos.value;
|
|
@@ -305,7 +288,7 @@
|
|
|
if (unf[i].rejectNum > unf[i].prodNum) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: '检查量不能大于投产量'
|
|
|
+ title: '废品量不能大于合格量'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
@@ -317,8 +300,6 @@
|
|
|
})
|
|
|
auxiliaryDayworkItem.value.rejectNum = sumReject
|
|
|
endSave();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// 暂停报工按钮
|
|
@@ -347,11 +328,8 @@
|
|
|
finishedDaywork(auxiliaryDayworkItem.value).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
let index = 0;
|
|
|
-
|
|
|
for (let i = 0; i < pages.length; i++) {
|
|
|
-
|
|
|
if (pages[i].$page.fullPath == "/pages/auxiliaryDaywork/index") {
|
|
|
-
|
|
|
index = pages.length - i - 1;
|
|
|
}
|
|
|
}
|
|
@@ -410,14 +388,6 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- //咨询样式
|
|
|
- function selectType(item) {
|
|
|
- for (var i = 0; i < consul.length; i++) {
|
|
|
- if (item.status == consul[i].value) {
|
|
|
- return consul[i].type
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
function addReject(row, index) {
|
|
|
// console.log('reject', row)
|
|
@@ -426,77 +396,16 @@
|
|
|
}
|
|
|
|
|
|
function handleResFlushItem(data) {
|
|
|
- currentItem.value.rejectList = data
|
|
|
- }
|
|
|
-
|
|
|
- const addWasteInfo = (data) => {
|
|
|
- const info = {
|
|
|
- title: data.title,
|
|
|
- checkStandard: data.standard
|
|
|
- }
|
|
|
- unfitInfos.value.push(info)
|
|
|
- }
|
|
|
- const addConsultation = (data) => {
|
|
|
- console.log(data)
|
|
|
- let info = data
|
|
|
- info.forEach(item => {
|
|
|
- item.status = 0
|
|
|
- })
|
|
|
- consultations.value = info
|
|
|
- isEventTriggered.value = true; // 更新标志位状态
|
|
|
- }
|
|
|
-
|
|
|
- /***************************** 定义了一些事件 *****************************/
|
|
|
- // 添加不合格信息
|
|
|
- const handleAddWaste = () => {
|
|
|
- let info = {}
|
|
|
- unfitInfos.value.push(info)
|
|
|
-
|
|
|
- // 监听事件,暂时不用,后续会使用
|
|
|
- // uni.$once('addWasteInfoEvent', (data) => {
|
|
|
- // addWasteInfo(data)
|
|
|
- // })
|
|
|
- // uni.navigateTo({
|
|
|
- // url: "/pages/processInspection/options"
|
|
|
- // })
|
|
|
- }
|
|
|
- // 删除不合格信息
|
|
|
- const handleDelWaste = (index) => {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定删除该项?',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- unfitInfos.value.splice(index, 1)
|
|
|
- rejectNumberChange()
|
|
|
- } else if (res.cancel) {
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ currentItem.value.rejectList = data.filter(e => e.reason != null && e.reason != '')
|
|
|
+ let rejectNum = 0
|
|
|
+ currentItem.value.rejectList.forEach(l => {
|
|
|
+ rejectNum += Number(l.rejectNum)
|
|
|
})
|
|
|
+ currentItem.value.rejectNum = rejectNum
|
|
|
+ rejectNumberChange()
|
|
|
+ // console.log(currentItem.value)
|
|
|
}
|
|
|
|
|
|
- // 咨询
|
|
|
- const handleAddConsultation = () => {
|
|
|
- isEventTriggered.value = false;
|
|
|
- // 监听事件
|
|
|
- uni.$once('wasteConsultationEvent', (data) => {
|
|
|
- if (!isEventTriggered.value) {
|
|
|
- // 如果事件尚未触发,则执行事件触发逻辑
|
|
|
- addConsultation(data)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/outsourcedInspection/consultation",
|
|
|
- success: (res) => {
|
|
|
- // 通过eventChannel向被打开页面传送数据
|
|
|
- res.eventChannel.emit("outsourcedInspectionConsultation", {
|
|
|
- data: auxiliaryDayworkItem.value.lot
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|