From b2ee05eb9357bf9d2441a10abc267bc234708f2a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 08 十二月 2025 14:53: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 | 501 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 422 insertions(+), 79 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 3d21bdd..47d70ab 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
@@ -2,7 +2,7 @@
import {computed, nextTick, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {useRouter,useRoute} from 'vue-router'
import request from "@/utils/request";
-import {ElMessage} from "element-plus";
+import {ElCheckbox, ElMessage} from "element-plus";
import {changeFilterEvent, filterChanged} from "@/hook"
import domZIndex from 'dom-zindex'
import {indexOf} from "xe-utils";
@@ -21,8 +21,13 @@
const router = useRouter()
const route = useRoute()
const user=userInfo()
+//鏄惁澶嶅悎宸ュ簭
+const laminating = ref(null)
+
//瀹氫箟琛ㄥご鏁版嵁
const titleUploadData = ref({
+ //鏄惁鍚堢墖宸ュ簭
+ laminating:'',
reportingWorkId: null,
//娴佺▼鍗″彿
processId: null,
@@ -53,6 +58,8 @@
classes: '',
//璐d换宸ュ簭
responsibleProcess: '',
+ //鍖呰鏂瑰紡
+ packagingMethod:'',
order: {
//瀹㈡埛缂栧彿
customerId: '',
@@ -71,6 +78,10 @@
let detail = ref([])
let layer=''
let technologicalProcess=''
+let processName = ref([])
+
+//闅愯棌鍏ㄩ儴瀹屽伐搴忓彿
+let hiddenVal = ref(1)
//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
const titleSelectJson = ref({
@@ -87,6 +98,39 @@
})
+let btnValue=company.storageBtn
+let teamsTypeValue=company.teamsType
+//鏄惁鐐瑰嚮鎶ュ伐鍏ュ簱
+let storageBtn = ref(false)
+//绠卞彿 搴撲綅 澶囨敞
+const storageRegion = ref(null);
+const container = ref(null);
+const remark = ref(null);
+
+//鍖呰鏂瑰紡
+const mannerPacking = ref(null)
+const mannerPackingOp = [
+ // {
+ // value: t('reportingWorks.early'),
+ // label: t('reportingWorks.early'),
+ // },
+ // {
+ // value: t('reportingWorks.nightShift'),
+ // label: t('reportingWorks.nightShift'),
+ // },
+ {
+ value: t('reportingWorks.woodenBox'),
+ label: t('reportingWorks.woodenBox'),
+ },
+ {
+ value: t('reportingWorks.brandreth'),
+ label: t('reportingWorks.brandreth'),
+ },
+ {
+ value: t('reportingWorks.tilting'),
+ label: t('reportingWorks.tilting'),
+ },
+]
let inputDisabled = ref(false)
@@ -95,18 +139,20 @@
if(route.query.processId !== undefined && route.query.processId!=='' && route.query.processId!=null ){
titleUploadData.value.processId = route.query.processId
//褰撹川妫�瀹℃牳鍚庡姞杞芥槑缁嗕俊鎭�
- /*if(route.query.reviewStatus === '1'){
+ if(route.query.reviewStatus === '1'){
if(titleUploadData.value.thisProcess !== undefined
&& titleUploadData.value.thisProcess!==''
&& titleUploadData.value.thisProcess!=null){
getWork()
getQuantity()
+
}
- }*/
+ }
}
//route.query.reportingWorkId = 'BG2403150004'
//鍒ゆ柇鏄惁浼犲叆鎶ュ伐缂栧彿
if(route.query.reportingWorkId !== '' && route.query.reportingWorkId!=null){
+ gridOptions.loading = true
request.post(`reportingWork/selectUpdateReportingWork/${route.query.reportingWorkId}`).then(res=>{
if(res.code === '200'){
titleUploadData.value = res.data.reportingWork
@@ -143,14 +189,25 @@
code: 'update',
name: t('basicData.update'),
status: 'primary',
+ disabled:'false'
}
if(route.query.reviewStatus === "1"){
button.name=t('basicData.review')
titleUploadData.value.qualityInspector=user.user.userName
}
gridOptions.toolbarConfig.buttons.push(button)
+ for (let i = 0; i < res.data.reportingWorkDetails.length; i++) {
+ if (res.data.reportingWorkDetails[i].patchStatusOther === '宸茶ˉ鐗�') {
+ gridOptions.toolbarConfig.buttons[2].disabled=true
+ break
+ }
+ else{
+ gridOptions.toolbarConfig.buttons[2].disabled=false
+ }
+ }
}
// getQuantity()
+ gridOptions.loading = false
inputDisabled.value = true
})
}
@@ -203,7 +260,7 @@
useKey: true
},
filterConfig: { //绛涢�夐厤缃」
- // remote: true
+ // remote: true
},
customConfig: {
storage: true
@@ -224,7 +281,7 @@
},
menuConfig: {
body: {
- //鍙抽敭鑿滃崟
+ //鍙抽敭鑿滃崟
options: [
[
{
@@ -250,14 +307,14 @@
},
{
code: 'SecondaryBreakage',
- name: "搴忓彿娆$牬鐩稿悓",
+ name: t('reportingWorks.secondaryBreakage'),
prefixIcon: 'vxe-icon-indicator',
visible: true,
disabled: false
},
{
code: 'checkedBreakage',
- name: "閫変腑娆$牬鐩稿悓",
+ name: t('reportingWorks.checkedBreakage'),
prefixIcon: 'vxe-icon-indicator',
visible: true,
disabled: false
@@ -362,42 +419,92 @@
editRules: {
completedQuantity: [
{
- validator ({ row }) {
+ validator ({ row ,cellValue }) {
const regex = /^[0-9]\d*$/
const brokenNum =
(row.breakageQuantity === undefined || row.breakageQuantity===null) ? 0 : row.breakageQuantity
+ //鏁存暟楠岃瘉
if (row.completedQuantity && !regex.test(row.completedQuantity)) {
return new Error(t('reportingWorks.enterIntegerGreaterThanEqualTo'))
+ //瀹屽伐+娆$牬鏁伴噺涓嶈兘澶т簬鍙畬宸ユ暟閲�
}else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){
- return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`))
+ return new Error(t('reportingWorks.pleaseNumber11'))
+ //鏈瀹屽伐鏁伴噺涓嶈兘澶т簬瀹屽伐鏁伴噺
}else if(row.quantity_card<row.completedQuantity){
return new Error(t('reportingWorks.pleaseNumber10'))
}
+ const nextProcess = titleUploadData.value.nextProcess//涓嬪伐搴�
+
+ const completedSum = Number(row.thisQuantitySum) //鎬诲畬宸ユ暟閲�
+ let nextQuantitySum = ''
+ if (nextProcess!=''){
+ nextQuantitySum = Number(row.nextQuantitySum) //鎬讳笅宸ュ簭瀹屽伐鏁伴噺
+ }else {
+ nextQuantitySum = Number(row.received_quantity) //鎬讳笅宸ュ簭瀹屽伐鏁伴噺
+ }
+ const totalQuantity = Number(row.quantity) //鍙畬宸ユ暟閲�
+ const val = Number(cellValue) //杈撳叆鍊�
+
+ //瀹屽伐鏁�
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')}`)
- }
+ //
+ const okVal = completedSum - totalQuantity + row.breakageQuantity
+ //褰撳彲鎿嶄綔鏁伴噺涓�0锛屽苟涓斿畬宸ユ暟閲忎笉绛変簬鍙畬宸ユ暟閲忔椂
+ if(row.minQuantity===0 && val!==(totalQuantity-row.breakageQuantity) ){
+ return new Error(`${t('reportingWorks.pleaseNumber12')} ${okVal}+${val}=${okVal+val}\n
+ ${t('reportingWorks.pleaseNumber13')} ${nextQuantitySum}\n
+ ${t('reportingWorks.pleaseNumber14')}
+ `)
+ }
+ if(titleUploadData.value.reportingWorkId!=null){
+ if (nextProcess!=''){//闈炴渶鍚庝竴閬撳伐搴�
+ if(row.completedQuantityComputed>=row.minQuantity ){
+ if((val<(row.completedQuantityComputed-row.minQuantity || val>=row.completedQuantityComputed))){
+ return new Error(`${row.completedQuantityComputed-row.minQuantity}
+ <=val<=
+ ${row.completedQuantityComputed}`)
+ }
+ }else{
+ if((val>row.completedQuantityComputed)){
+ return new Error(`val
+ <=
+ ${row.completedQuantityComputed}`)
+ }
+ }
+ }else {//鏈�鍚庝竴閬撳伐搴�
+ if (val<row.completedQuantityComputed){
+ //搴撳瓨鏁伴噺銆佸凡鍏ュ簱鏁伴噺
+ if (val>(row.inventory_quantity-row.received_quantity)){
+ return new Error(`val
+ <=
+ ${row.inventory_quantity-row.received_quantity}`)
+ }else {
+ if (val < (row.inventory_quantity-row.received_quantity)){
+ //瀹屽伐鎬绘暟銆佹湰娆″畬宸ユ暟銆佸凡鍏ュ簱鏁伴噺
+ if (completedSum-row.completedQuantityComputed <row.received_quantity){
+ return new Error(`${t('reportingWorks.pleaseNumber15')}`)
+ }
+ }
+ }
+ }
+ }
+
+ }
}
}
]
},
toolbarConfig: {//琛ㄥご鎸夐挳
buttons: [
- // {code: 'empty', name: '娓呯┖鎶ュ伐鏁伴噺'},
- // {code: 'sameCompletion', name: '瀹屽伐鐩稿悓'},
- // {code: 'sameDamage', name: '娆$牬鐩稿悓'},
- // {code: 'sameOneCompletion', name: '瀹屽伐涓�鍒楃浉鍚�'},
- // {code: 'sameOneDamage', name: '娆$牬涓�鍒楃浉鍚�'},
{code: 'saveReportingWork', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save',disabled:true},
{code: 'saveReportingWorkReview', name: t('reportingWorks.saveAndReview'), status: 'primary', icon: 'vxe-icon-save',disabled:true},
+ {code: 'saveWorkStorage', name: t('reportingWorks.saveWorkStorage'), status: 'primary', icon: 'vxe-icon-save'},
],
- // import: false,
- // export: true,
- // print: true,
+ // slots: {
+ // tools: 'toolbar_buttons'
+ // },
zoom: true,
custom: true
},
@@ -471,10 +578,50 @@
break
}
+ case 'saveWorkStorage':{
+ if(xGrid.value.getTableData().fullData.length===0){
+ ElMessage.warning(t('reportingWorks.selectProcessCardData'))
+ return
+ }
+ const device = titleUploadData.value.deviceName
+ if(device === null || device === undefined || device === ''){
+ ElMessage.error(t('reportingWorks.selectWorkReportingEquipment'))
+ return
+ }
+ const teamsGroupsName = titleUploadData.value.teamsGroupsName
+ if(teamsGroupsName === null || teamsGroupsName === undefined || teamsGroupsName === ''){
+ ElMessage.error(t('reportingWorks.selectWorkReportingTeam'))
+ return
+ }
+
+ if (mannerPacking.value === null || mannerPacking.value === undefined || mannerPacking.value === ''){
+ ElMessage.error(t('reportingWorks.msgMannerPacking'))
+ return
+ }
+ const parts = technologicalProcess.split('->');
+ const last = parts[parts.length - 1];
+ let processId = titleUploadData.value.processId
+ //鍖归厤鈥�/鈥濆墠鍚庡瓧绗︿覆
+ const regex = /([^\/]+)\/([^\/]+)/;
+ //鏌ユ壘鍖归厤鐨勫瓧绗︿覆
+ const resultProcessId = processId.match(regex);
+ //娴佺▼鍗″彿
+ let processIdStr = resultProcessId[1];
+ //灞傚彿
+ let technologyStr = resultProcessId[2];
+ if (last != titleUploadData.value.thisProcess){
+ ElMessage.error(t('reportingWorks.pleaseNumber16'))
+ return
+ }
+ storageBtn.value = true
+ //鎶ュ伐鏂板
+ saveReportingWork(0,'save')
+
+ }
}
}
},
- cellDblclick (params) {//琛ㄦ牸鍐呭鍙屽嚮鎵撳紑浜у搧鐣岄潰
+ cellDblclick (params) {//琛ㄦ牸鍐呭鍙屽嚮鎵撳紑娆$牬鐣岄潰
const { row } = params
brokenRow.value = row
if(brokenRow.value.damageDetails=== undefined){
@@ -485,9 +632,9 @@
const { rows, column, cell } = params; // 瑙f瀯鑾峰彇琛屻�佸垪鍜屽崟鍏冩牸淇℃伅
//鐐瑰嚮娆$牬鏁伴噺鏃舵墦寮�鏄庣粏鐣岄潰
if(column.field=="breakageQuantity"){
- if (row.patchStatusOther!="宸茶ˉ鐗�"){
+ // if (row.patchStatusOther!="宸茶ˉ鐗�"){
brokenVisible.value = true
- }
+ //}
}
},
menuClick({menu, row, column}) {//鍙抽敭鑿滃崟
@@ -675,7 +822,7 @@
},
{
field: 'responsiblePersonnel',
- title: '璐d换淇℃伅',
+ title: t('rework.responsibilityInformation'),
editRender: {name: 'input', attrs: {placeholder: ''}}
},
@@ -752,7 +899,13 @@
}
}
}
-const openedBrokenTable = () => {
+
+const brokenGridKey = ref(0)
+const openedBrokenTable = async () => {
+ brokenGridKey.value++
+ await nextTick()
+ console.log('breakageType:', titleSelectJson.value.breakageType)
+ console.log('breakageReason:', titleSelectJson.value.breakageReason)
//addListener(brokenGrid.value,brokenGridOptions)
let damage =ref(brokenRow.value.damageDetails)
brokenGrid.value.reloadData(damage.value)
@@ -796,11 +949,11 @@
})
const maxQuantity = Math.max(...equalByOrderNum.map(item =>item.breakageQuantity || 0))
let process = titleUploadData.value.thisProcess
+ let laminating = titleUploadData.value.laminating
equalByOrderNum.forEach((row) =>{
- if (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�'){
+ if (laminating != ''){
row.completedQuantity= brokenRow.value.quantity*1-maxQuantity
}
-
})
@@ -813,9 +966,11 @@
//绗竴娆″姞杞芥暟鎹�
let groupChangeProcess = ref(false)//鐢ㄤ簬鏈彮缁勬樉绀洪棶棰�
const initTiltle = async () => {
+ hideButton()
await request.post(`/reportingWork/selectProcess/${user.user.userId}`).then((res) => {
if (res.code == 200) {
titleSelectJson.value.processType = res.data.process
+ processName = res.data.processNameList
if(user.user.address!==null && user.user.address!==''){
titleUploadData.value.thisProcess = user.user.address
titleUploadData.value.teamsGroupsName = user.user.userName
@@ -877,6 +1032,23 @@
return
}
+ const reportingWorkTime = titleUploadData.value.reportingWorkTime
+ const currentTime = new Date()
+ const targetTime = new Date(reportingWorkTime)
+ //鏈潵鏃堕棿
+ if (targetTime > currentTime) {
+ ElMessage.error(t('reportingWorks.futureTime'))
+ return
+ }
+ // 涓や釜鏃堕棿鐨勬绉掑樊
+ const diffMs = currentTime - targetTime
+ // 杞崲涓哄ぉ鏁�
+ const diffDays = diffMs / (1000 * 60 * 60 * 24)
+ if (diffDays > 396 && saveType!="update") {
+ ElMessage.error(t('reportingWorks.longTime'))
+ return
+ }
+
const seenIds = {}
const uniqueByOrderNum = xGrid.value.getTableData().fullData.filter(item => {
// 妫�鏌tem鐨刬d鏄惁宸茬粡鍦╯eenIds涓�
@@ -894,14 +1066,17 @@
let process = titleUploadData.value.thisProcess
//鏆傛椂鍙栨秷
for(let item of uniqueByOrderNum){
- if(!checkSameNumForId(notFinishList,item.order_number ) && (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�')){
- ElMessage.error(`${t('reportingWorks.pleaseCheckTheOrderNumber1')}':'
+ const result = processName.find(item => item.basic_name === process);
+ const nickname = result ? result.nickname : null;
+ if(!checkSameNumForId(notFinishList,item.order_number ) && nickname && nickname.includes('step')){
+ ElMessage.error(`${t('reportingWorks.pleaseCheckTheOrderNumber1')}:
${item.order_number}
- ${t('reportingWorks.pleaseCheckTheOrderNumber1')}`)
+ ${t('reportingWorks.pleaseCheckTheOrderNumber2')}`)
return false
}
}
-
+//鍖呰鏂瑰紡
+ titleUploadData.value.packagingMethod = mannerPacking.value
titleUploadData.value.creator = user.user.userName
titleUploadData.value.creatorId = user.user.userId
const requestDetailData = xGrid.value.getTableData().fullData.filter((row) => {
@@ -924,6 +1099,7 @@
}
gridOptions.toolbarConfig.buttons[0].disabled=true
gridOptions.toolbarConfig.buttons[1].disabled=true
+ gridOptions.loading=true
//鍒ゆ柇淇濆瓨杩樻槸淇敼
if(saveType==='save'){
saveReportingWorkRequest(requestData)
@@ -937,6 +1113,11 @@
request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{
if (res.code == 200){
ElMessage.success(t('reportingWorks.successfulJobApplication'))
+ //鎶ュ伐鍏ュ簱
+ if(storageBtn.value == true){
+ getStorageWork();
+ }
+ gridOptions.loading=false
router.push({path:'/main/reportingWorks/AddReportingWork',query:{processId:titleUploadData.value.processId,random:Math.random()}})
}else{
const errorObj = JSON.parse(res.msg)
@@ -945,15 +1126,16 @@
+t('reportingWorks.pleaseNumber3')+'锛�'+errorObj.processNum+'<'+
+t('reportingWorks.pleaseNumber4')+'锛�'+errorObj.sumNum+'\n'
+t('reportingWorks.pleaseNumber5')
-
+ gridOptions.loading=false
ElMessage.error(msg)
}
}).catch(err =>{
- ElMessage.error('鎻愪氦澶辫触锛岃鍒锋柊鍚庨噸璇�')
+ ElMessage.error(t('basicData.msg.ServerConnectionError'))
+ gridOptions.loading=false
}).finally(()=>{
-
gridOptions.toolbarConfig.buttons[0].disabled=false
gridOptions.toolbarConfig.buttons[1].disabled=false
+ gridOptions.loading=false
})
}
@@ -1065,7 +1247,6 @@
//涓嬫媺娆鹃�夋嫨宸ュ簭鏃舵煡璇�
const getWork = () => {
-
let processId = titleUploadData.value.processId
if (processId == "" || processId == null) {
ElMessage.warning(t('reportingWorks.theProcessCardNumberCannotBeEmpty'))
@@ -1117,10 +1298,14 @@
titleUploadData.value = res.data.data
titleUploadData.value.processId = processId
titleUploadData.value.teamsGroupsName = user.user.userName
+ titleUploadData.value.laminating = res.data.laminating
//璁惧涓嬫媺妗�
titleSelectJson.value.deviceType = res.data.device
//鐝粍涓嬫媺妗�
- //titleSelectJson.value.teamsType = res.data.teams
+ if (teamsTypeValue==true){
+ titleSelectJson.value.teamsType = res.data.teams
+ }
+
//褰撳墠娴佺▼鍗″伐搴�
titleSelectJson.value.thisProcessType = res.data.thisProcess
//鍘嗗彶鐝粍
@@ -1145,46 +1330,30 @@
//鍒ゆ柇鏃╂櫄鐝�
titleUploadData.value.classes=t('reportingWorks.early')
- titleUploadData.value.reportingWorkTime = formatCurrentTime()
-
- //澶勭悊缂栧彿鍒�
- //瀹氫箟瀛樻斁缂栧彿鏁扮粍
- const s01Values = [];
- for (let i = 0; i < res.data.Detail.length; i++) {
- const s01Values = [];
- // 閬嶅巻 detailList 鏁扮粍锛屾彁鍙� S01 鍊煎埌 s01Values 鏁扮粍
- if (res.data.Detail[i].other_columns!=null|| res.data.Detail[i].other_columns!=undefined){
- res.data.Detail.forEach(element => {
- const otherColumnsObject = JSON.parse(element.other_columns);
- const s01Value = otherColumnsObject.S01;
- s01Values.push(s01Value || ''); // 濡傛灉 S01 鍊间负绌猴紝娣诲姞绌哄瓧绗︿覆鎴栬�呭叾浠栭粯璁ゅ��
- });
-
- // 灏� s01Values 涓殑鍊艰祴缁欐瘡涓鍗曡鎯呭璞$殑 s01Value 灞炴��
- res.data.Detail.forEach((detail, index) => {
- detail.s01Value = index < s01Values.length ? s01Values[index] : ''; // 璧嬪�肩粰 s01Value 灞炴��
- });
- }
-
- }
+ titleUploadData.value.reportingWorkTime = res.data.reportingWorkTiem
//缁戝畾涓嬫柟琛ㄦ牸
- detail.value = res.data.Detail
+
// 浣跨敤map鏂规硶鏉ュ鐞嗘瘡涓璞�
- let modifiedCollection = detail.value.map(item => {
+ let modifiedCollection = res.data.Detail.map(item => {
if (item.reviewed_state === 1) {
- return { ...item, reviewed_state: "宸插鏍�" };
+ return { ...item, reviewed_state: t('productStock.approved') };
}
else if (item.reviewed_state === 0) {
- return { ...item, reviewed_state: "鏈鏍�" };
+ return { ...item, reviewed_state: t('reportingWorks.unreviewed') };
}
else {
// 鍏朵粬鎯呭喌淇濇寔涓嶅彉
return item;
}
});
- xGrid.value.reloadData(modifiedCollection)
+ detail.value = modifiedCollection
+ xGrid.value.reloadData(detail.value)
+ hideButton()
+ // nextTick(() => {
+ // hiddenCompletedOk()
+ // })
} else {
ElMessage.warning(res.msg)
}
@@ -1237,9 +1406,10 @@
const editClosedEvent = ({ row, column }) => {
let process = titleUploadData.value.thisProcess
+ let laminating = titleUploadData.value.laminating
if (column.property==='completedQuantity') {
xGrid.value.getTableData().fullData.forEach((item, index) =>{
- if(item.order_number===row.order_number && (process=='澶硅兌' || process=='涓┖' || process=='鍖呰' ||process=='鎵撹兌鍜岀矘妗�')){
+ if(item.order_number===row.order_number && laminating != ''){
item.completedQuantity=row.completedQuantity
}
})
@@ -1249,12 +1419,15 @@
const getQuantity = () => {
titleUploadData.value.thisCompletedQuantity = 0
titleUploadData.value.thisWornQuantity = 0
+ let laminating = titleUploadData.value.laminating
const arr = xGrid.value.getTableData().fullData
- const returnArr = arr.filter((obj, index, self) =>
- self.findIndex((t) => t.order_number === obj.order_number) === index
- )
-
-
+ //鏍规嵁鏄惁鍚堢墖宸ュ簭杩囨护
+ const returnArr =
+ laminating != ""
+ ? arr.filter((obj, index, self) =>
+ self.findIndex((t) => t.order_number === obj.order_number) === index
+ )
+ : arr;
let sumBreak = 0
let sumQuantity = 0
returnArr.forEach((item)=>{
@@ -1349,6 +1522,151 @@
}
})
+
+//鎶ュ伐鍏ュ簱鏂规硶
+const getStorageWork = () => {
+ let processId = titleUploadData.value.processId
+ //鍖归厤鈥�/鈥濆墠鍚庡瓧绗︿覆
+ const regex = /([^\/]+)\/([^\/]+)/;
+ //鏌ユ壘鍖归厤鐨勫瓧绗︿覆
+ const resultProcessId = processId.match(regex);
+ //娴佺▼鍗″彿
+ let processIdStr = resultProcessId[1];
+ //灞傚彿
+ let technologyStr = resultProcessId[2];
+ //寮�濮嬪鐞嗗叆搴撻渶瑕佺殑鏁版嵁
+ let rawData = xGrid.value.getTableData().fullData
+ const seen = new Set();
+ const result = rawData.filter(item => {
+ // 1. 鍏堟妸 completedQuantity 涓� 0 鐨勫墧闄�
+ if (item.completedQuantity === 0 || item.completedQuantity =="0" || item.completedQuantity =="") {
+ return false;
+ }
+ // 2. 閬囧埌鐩稿悓 order_number锛屽彧淇濈暀绗竴娆★紝鍚庨潰閮戒涪寮�
+ if (seen.has(item.order_number)) {
+ return false;
+ }
+ seen.add(item.order_number);
+ return true;
+ });
+
+ // 缁欐瘡鏉¤褰曡拷鍔� order 瀛楁
+ const resultData = result.map(item => ({
+ ...item,
+ order: {
+ orderId: titleUploadData.value.orderId
+ },
+ processId:processIdStr,
+ orderNumber:item.order_number,
+ inventoryQuantity:item.completedQuantity
+ }));
+ let flowData = ref({
+ decValue:company.decValue,
+ userId: user.user.userId,
+ userName: user.user.userName,
+ storageRegion: storageRegion.value,
+ remark: remark.value,
+ container: container.value,
+ flowCard: resultData,
+ createTime: titleUploadData.value.reportingWorkTime
+ })
+ //璋冪敤鍏ュ簱鎺ュ彛
+ request.post("/finishedGoodsInventory/addSelectWarehousing",flowData.value).then((res) => {
+ if(res.code==200 && res.data==="true"){
+ ElMessage.success(t('productStock.receivedSuccessfully'))
+ // router.push({path:'/maiggn/productStock/CreateProductStock',query:{random:Math.random()}})
+ }else if(res.data==="false1"){
+ ElMessage.warning(t('basicData.msg.quantityError'))
+ }else if(res.data==="false2"){
+ ElMessage.warning(t('basicData.msg.dataDoesNotExist'))
+ }else{
+ ElMessage.warning(t('productStock.entryFailure'))
+ }
+ }).catch((err)=>{
+ ElMessage.error(t('basicData.msg.ServerConnectionError'))
+ router.push("/login")
+ })
+}
+
+const hideButton = () => {
+ // 鑾峰彇鏈�鍚庝竴閬撳伐搴�
+ const parts = technologicalProcess.split('->');
+ let last = parts[parts.length - 1];
+ if (last === '') {
+ last = null;
+ }
+ const els = document.querySelectorAll('.inventory_content');
+
+ // 鏄惁鏄剧ず鎶ュ伐鍏ュ簱鐩稿叧鎸夐挳鍐呭
+ if (btnValue == false || last != titleUploadData.value.thisProcess) {
+ els.forEach(el => {
+ el.style.display = 'none';
+ });
+ } else {
+ els.forEach(el => {
+ el.style.display = '';
+ });
+ // 閬垮厤閲嶅娣诲姞鎸夐挳
+ const exists = gridOptions.toolbarConfig.buttons.some(btn => btn.code === 'saveWorkStorage');
+ if (!exists) {
+ let buttons = {
+ code: 'saveWorkStorage',
+ name: t('reportingWorks.saveWorkStorage'),
+ status: 'primary',
+ icon: 'vxe-icon-save'
+ };
+ gridOptions.toolbarConfig.buttons.push(buttons);
+ }
+ }
+
+ // 杩囨护鎸夐挳锛岄殣钘� saveWorkStorage 鎸夐挳鏃舵満
+ gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
+ if ((btnValue == false || last != titleUploadData.value.thisProcess) && button.code === 'saveWorkStorage') {
+ return false;
+ }
+ return true;
+ });
+};
+
+
+
+const changeGroup = (value)=> {
+ //鍒ゆ柇鍘嗗彶鐝粍鏄惁鏈夋鐝粍淇℃伅
+ const exists = titleSelectJson.value.historyTeams.some(item => item.basic_name === value)
+ if(! exists){
+ titleSelectJson.value.historyTeams.push({
+ basic_name: value,
+ process: titleUploadData.value.thisProcess,
+ basic_type: 'teamsgroups',
+ id: 555
+ })
+ }
+
+
+}
+
+const onHiddenChange = (checked) => {
+ hiddenVal.value = checked ? 1 : 0
+ hiddenCompletedOk()
+}
+
+const hiddenCompletedOk = () => {
+ const $grid = xGrid.value
+ const data = $grid.getTableData().fullData
+ const laminating = titleUploadData.value.laminating
+ const filteredData = data.filter(row => {
+ return row.completedQuantity>0 //杩囨护鍙畬宸ユ暟閲忎负0鐨�
+ })
+ if (laminating == ''){
+ if (hiddenVal.value == 1){
+ // 閲嶆柊鍔犺浇杩囨护鍚庣殑鏁版嵁
+ $grid.loadData(filteredData)
+ }else {
+ //鍘熷鏁版嵁
+ $grid.loadData(detail.value);
+ }
+ }
+}
</script>
<template>
@@ -1373,6 +1691,23 @@
<el-button :disabled="disabledFlag" :loading="loadingFlag" @click="reviewReportingWork" type="primary">{{$t('reportingWorks.passAudit')}}
</el-button>
+
+ <span class="inventory_content">
+ <el-select style="width: 100px" v-model="mannerPacking" class="processesSt" :placeholder="$t('reportingWorks.mannerPacking')">
+ <el-option
+ v-for="item in mannerPackingOp"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ <el-input style="width: 100px" v-model="container" class="m-2" :placeholder="$t('productStock.pleaseEnterTheBoxNumber')">
+ </el-input>
+ <el-input style="width: 100px" v-model="storageRegion" class="m-2" :placeholder="$t('productStock.pleaseEnterTheStorageLocation')">
+ </el-input>
+ <el-input style="width: 200px" v-model="remark" class="m-2" :placeholder="$t('productStock.pleaseEnterANote')">
+ </el-input>
+ </span>
<!-- <el-button type="primary">瀹℃牳涓嶉�氳繃</el-button>-->
<label>{{technologicalProcess}}</label>
@@ -1461,13 +1796,14 @@
<el-col :span="3">
<el-select :disabled="groupChangeProcess"
v-model="titleUploadData.teamsGroupsName"
+ @change="changeGroup"
clearable
:placeholder="$t('reportingWorks.selectTeam')">
<el-option
v-for="item in titleSelectJson['teamsType']"
:key="item.id"
- :label="item.basicName"
- :value="item.basicName"
+ :label="item.user_name"
+ :value="item.user_name"
/>
</el-select>
</el-col>
@@ -1538,7 +1874,15 @@
</div>
</div>
</template>
-
+ <template #toolbar_buttons>
+ <el-checkbox
+ :model-value="hiddenVal === 1"
+ @change="onHiddenChange"
+ >
+ {{ t('reportingWorks.hiddenVal') }}
+ </el-checkbox>
+
+ </template>
</vxe-grid>
</div>
@@ -1552,7 +1896,7 @@
+brokenRow.glass_child+'.'+brokenRow.order_number+'.'+brokenRow.technology_number"
style="width: 80%;height:75% ">
<vxe-grid
-
+ :key="brokenGridKey"
height="400px"
ref="brokenGrid"
class="mytable-scrollbar"
@@ -1591,7 +1935,7 @@
</template>
<!-- 鍒虹牬绫诲瀷breakageType -->
<template #breakageType="{ row }">
- <vxe-select v-model="row.breakageType "
+ <vxe-select v-model="row.breakageType"
clearable placeholder=" " allow-create filterable>
<vxe-option v-for="item in titleSelectJson.breakageType" :key="item.id" :label="item.basic_name" :value="item.basic_name"/>
</vxe-select>
@@ -1602,7 +1946,7 @@
<!--娆$牬鍘熷洜-->
<template #breakageReason="{ row }">
- <vxe-select v-model="row.breakageReason "
+ <vxe-select v-model="row.breakageReason"
clearable placeholder=" " allow-create filterable>
<vxe-option v-for="item in titleSelectJson.breakageReason" :key="item.id" :label="item.basic_name" :value="item.basic_name"/>
</vxe-select>
@@ -1733,8 +2077,7 @@
}
::v-deep(.mytable-scrollbar .col-red) {
- background-color: rgb(66,159,254);
- color: #fff;
+ background-color: rgb(66,159,254)!important;
}
--
Gitblit v1.8.0