From 93b80ffb7f7ffc02bc414271b8ebeac82be6bcb9 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期一, 11 十一月 2024 16:29:00 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue | 123 +++++++++++++++++++++++++++++++---------
1 files changed, 95 insertions(+), 28 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
index d99fc74..9caaeb7 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -103,6 +103,10 @@
titleSelectJson.value = res.data.basic
layer= res.data.layer
+ //娣诲姞琛ョ墖鐘舵�佸垪
+ let column = {field: 'patchStatusOther', width: 90,title: t('reportingWorks.patchCondition')}
+ gridOptions.columns.push(column)
+
const s01Values = [];
for (let i = 0; i < res.data.reportingWorkDetails.length; i++) {
const s01Values = [];
@@ -145,7 +149,6 @@
})
const data = [{id:1,num:2},{id:1,num:3},{id:2,num:2},{id:1,num:2}];
-
//琛ㄥ熬姹傚拰
const sumNum = (list, field) => {
@@ -239,7 +242,14 @@
},
{
code: 'SecondaryBreakage',
- name: "娆$牬鐩稿悓",
+ name: "搴忓彿娆$牬鐩稿悓",
+ prefixIcon: 'vxe-icon-indicator',
+ visible: true,
+ disabled: false
+ },
+ {
+ code: 'checkedBreakage',
+ name: "閫変腑娆$牬鐩稿悓",
prefixIcon: 'vxe-icon-indicator',
visible: true,
disabled: false
@@ -345,8 +355,12 @@
return new Error(t('reportingWorks.enterIntegerGreaterThanEqualTo'))
}else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){
return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`))
+ }else if(row.quantity_card<row.completedQuantity){
+ return new Error(t('reportingWorks.pleaseNumber10'))
}
- if(titleUploadData.value.reportingWorkId!=null && row.completedQuantity<row.minQuantity){
+ const completedNum =
+ (row.completedQuantity === undefined || row.completedQuantity===null || row.completedQuantity==='') ? 0 : row.completedQuantity
+ if(titleUploadData.value.reportingWorkId!=null && completedNum>row.minQuantity){
return new Error(`${t('reportingWorks.pleaseGreaterThanOrEqual1')}
${row.minQuantity}
${t('reportingWorks.pleaseGreaterThanOrEqual2')}`)
@@ -421,12 +435,12 @@
}
case 'update': {
//鏍规嵁琛ョ墖鐘舵�佸垽鏂槸鍚﹁兘淇敼
- request.post(`/reportingWork/getPatchCondition/${route.query.reportingWorkId}`).then(async (res) => {
- if (res.code == 200) {
- if (res.data > 0) {
- ElMessage.error("璇ユ姤宸ュ寘鍚凡琛ョ墖鏁版嵁锛屼笉鍙慨鏀�!")
- return
- } else {
+ // request.post(`/reportingWork/getPatchCondition/${route.query.reportingWorkId}`).then(async (res) => {
+ // if (res.code == 200) {
+ // if (res.data > 0) {
+ // ElMessage.error("璇ユ姤宸ュ寘鍚凡琛ョ墖鏁版嵁锛屼笉鍙慨鏀�!")
+ // return
+ // } else {
getQuantity()
const errMap = await $grid.validate(true)
if (errMap) {
@@ -434,11 +448,11 @@
return
}
saveReportingWork(0, 'update')
- }
- } else {
- ElMessage.warning(res.msg)
- }
- })
+ // }
+ // } else {
+ // ElMessage.warning(res.msg)
+ // }
+ // })
break
}
@@ -456,7 +470,9 @@
const { rows, column, cell } = params; // 瑙f瀯鑾峰彇琛屻�佸垪鍜屽崟鍏冩牸淇℃伅
//鐐瑰嚮娆$牬鏁伴噺鏃舵墦寮�鏄庣粏鐣岄潰
if(column.field=="breakageQuantity"){
- brokenVisible.value = true
+ if (row.patchStatusOther!="宸茶ˉ鐗�"){
+ brokenVisible.value = true
+ }
}
},
menuClick({menu, row, column}) {
@@ -510,7 +526,7 @@
}
case 'SecondaryBreakage' : {
let result = toolbarButtonClickEvent()
- if (result.cell === "breakageQuantity"){
+ if (result.cell === "breakageQuantity" || result.cell === "completedQuantity"){
if (result) {
const dataList = xGrid.value.getTableData().visibleData
const seenOrders = {}
@@ -533,7 +549,27 @@
}
})
- console.log(dataList)
+ }
+ }
+ break
+ }
+ case 'checkedBreakage' : {
+ let result = toolbarButtonClickEvent()
+ if (result.cell === "breakageQuantity" || result.cell === "completedQuantity"){
+ if (result) {
+ const dataList = xGrid.value.getTableData().visibleData
+ const val = dataList[result.start].damageDetails
+ const quantity = dataList[result.start].breakageQuantity
+ dataList.forEach((item, index) => {
+ if (index >= result.start && index <= result.end) {
+ item.damageDetails = val
+ item.breakageQuantity = quantity
+ if (index!=result.start){
+ item.completedQuantity = item.completedQuantity - quantity
+ }
+
+ }
+ })
}
}
break
@@ -744,8 +780,12 @@
return row.order_number === brokenRow.value.order_number
})
const maxQuantity = Math.max(...equalByOrderNum.map(item =>item.breakageQuantity || 0))
+ let process = titleUploadData.value.thisProcess
equalByOrderNum.forEach((row) =>{
- row.completedQuantity= brokenRow.value.quantity*1-maxQuantity
+ if (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�'){
+ row.completedQuantity= brokenRow.value.quantity*1-maxQuantity
+ }
+
})
@@ -757,13 +797,16 @@
//绗竴娆″姞杞芥暟鎹�
let groupChangeProcess = ref(false)//鐢ㄤ簬鏈彮缁勬樉绀洪棶棰�
-request.post(`/reportingWork/selectProcess`).then((res) => {
+request.post(`/reportingWork/selectProcess/${user.user.userId}`).then((res) => {
if (res.code == 200) {
titleSelectJson.value.processType = res.data.process
if(user.user.address!==null && user.user.address!==''){
titleUploadData.value.thisProcess = user.user.address
titleUploadData.value.teamsGroupsName = user.user.userName
groupChangeProcess.value = true
+ if (user.user.address==='鎶�鏈儴澶氭洸' || user.user.address==='澶硅兌'){
+ groupChangeProcess.value = false
+ }
gridOptions.toolbarConfig.buttons[1].visible=false
}
@@ -830,9 +873,9 @@
const notFinishList = xGrid.value.getTableData().fullData.filter(item =>{
return item.saveFlag === 0
})
-
+ let process = titleUploadData.value.thisProcess
for(let item of uniqueByOrderNum){
- if(!checkSameNumForId(notFinishList,item.order_number )){
+ if(!checkSameNumForId(notFinishList,item.order_number ) && (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�')){
ElMessage.error(`${t('reportingWorks.pleaseCheckTheOrderNumber1')}':'
${item.order_number}
${t('reportingWorks.pleaseCheckTheOrderNumber1')}`)
@@ -851,13 +894,14 @@
ElMessage.warning(t('reportingWorks.atLeastOneFinishedAndWornEligible'))
return false
}
-
+ let status=company.qualityInsStatus
const requestData = {
title:titleUploadData.value,
detail:xGrid.value.getTableData().fullData,
type:state,//瀹℃牳鐘舵��
userId:user.user.userId,
userName:user.user.userName,
+ qualityInsStatus:status
}
gridOptions.toolbarConfig.buttons[0].disabled=true
gridOptions.toolbarConfig.buttons[1].disabled=true
@@ -886,7 +930,7 @@
ElMessage.error(msg)
}
}).catch(err =>{
- ElMessage.error(err.message)
+ ElMessage.error('鎻愪氦澶辫触锛岃鍒锋柊鍚庨噸璇�')
}).finally(()=>{
gridOptions.toolbarConfig.buttons[0].disabled=false
@@ -964,10 +1008,20 @@
ElMessage.warning(t('reportingWorks.firstProcessNotReview'))
return
}
+ //鍖归厤鈥�/鈥濆墠鍚庡瓧绗︿覆
+ const regex = /([^\/]+)\/([^\/]+)/;
+ //鏌ユ壘鍖归厤鐨勫瓧绗︿覆
+ const result = processId.match(regex);
+ //娴佺▼鍗″彿
+ let processIdStr = result[1];
+ //灞傚彿
+ let technologyStr = result[2];
const reportWork = {
process: titleUploadData.value.previousProcess,
processId:processId,
- thisProcess:titleUploadData.value.thisProcess
+ thisProcess:titleUploadData.value.thisProcess,
+ technologyStr:technologyStr,
+ userName:user.user.userName
}
loadingFlag.value= true
request.post("/reportingWork/reviewReportingWork",reportWork).then((res) =>{
@@ -1030,7 +1084,6 @@
let technologyStr = result[2];
let reportType= company.reportType
- console.log(reportType)
request.post(`/reportingWork/addSelectLastWork/${processIdStr}/${technologyStr}/${process}/${reportType}`).then((res) => {
if (res.code == 200) {
if(res.data.data==null){
@@ -1045,7 +1098,7 @@
//璁惧涓嬫媺妗�
titleSelectJson.value.deviceType = res.data.device
//鐝粍涓嬫媺妗�
- titleSelectJson.value.teamsType = res.data.teams
+ //titleSelectJson.value.teamsType = res.data.teams
//褰撳墠娴佺▼鍗″伐搴�
titleSelectJson.value.thisProcessType = res.data.thisProcess
//鍘嗗彶鐝粍
@@ -1148,9 +1201,10 @@
}
const editClosedEvent = ({ row, column }) => {
+ let process = titleUploadData.value.thisProcess
if (column.property==='completedQuantity') {
xGrid.value.getTableData().fullData.forEach((item, index) =>{
- if(item.order_number===row.order_number){
+ if(item.order_number===row.order_number && (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�')){
item.completedQuantity=row.completedQuantity
}
})
@@ -1249,6 +1303,16 @@
return row?.rowClass
}
+const editConfigDisable = reactive({
+ trigger: 'click',
+ mode: 'cell',
+ beforeEditMethod ({ row }) {
+ if (row.patchStatusOther === '宸茶ˉ鐗�') {
+ return false
+ }
+ return true
+ }
+})
</script>
@@ -1426,6 +1490,7 @@
v-on="gridEvents"
@edit-closed="editClosedEvent"
:cell-class-name="cellClassName"
+ :edit-config="editConfigDisable"
>
@@ -1433,7 +1498,9 @@
<template #num1_filter="{ column, $panel }">
<div>
<div v-for="(option, index) in column.filters" :key="index">
- <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/>
+ <input v-model="option.data" type="type"
+ @keyup.enter.native="$panel.confirmFilter()"
+ @input="changeFilterEvent($event, option, $panel)"/>
</div>
</div>
</template>
--
Gitblit v1.8.0