From 61116c35fda12264fda46211dcad45e27df8e2f8 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期四, 20 二月 2025 17:03:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/api/performance/manHour.js | 2 src/components/Table/lims-table.vue | 233 - src/InspectionWorker.worker.js | 2352 ++++++++++++++++++++++++++ vue.config.js | 13 src/views/business/unpass/components/addUnPass.vue | 124 + src/views/business/unpass/components/unPassDialog.vue | 275 +++ src/views/business/inspectionTask/inspection.vue | 800 +++----- src/router/index.js | 20 src/views/business/inspectionTask/index.vue | 88 src/views/business/materialOrder/index.vue | 495 ++-- src/utils/request.js | 250 +- src/api/standard/standardLibrary.js | 2 src/api/cnas/process/method/standardMethod.js | 1 src/api/business/inspectionTask.js | 10 src/api/business/unpass.js | 75 src/api/standard/model.js | 2 src/api/performance/class.js | 2 src/views/business/unpass/components/PurchaseVerification.vue | 376 ++++ src/DataWorker.worker.js | 160 + package.json | 3 20 files changed, 4,256 insertions(+), 1,027 deletions(-) diff --git a/package.json b/package.json index 823e179..ec535d5 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "sass-loader": "10.1.1", "script-ext-html-webpack-plugin": "2.1.5", "svg-sprite-loader": "5.1.1", - "vue-template-compiler": "2.6.12" + "vue-template-compiler": "2.6.12", + "worker-loader": "^3.0.8" }, "engines": { "node": ">=8.9", diff --git a/src/DataWorker.worker.js b/src/DataWorker.worker.js new file mode 100644 index 0000000..b2e99c1 --- /dev/null +++ b/src/DataWorker.worker.js @@ -0,0 +1,160 @@ +// 姝ょ嚎绋嬩负鏁版嵁閲囬泦绾跨▼ + +// 淇濆瓨鏁版嵁 +// 鏁版嵁閲囬泦淇℃伅 +let dataAcquisitionInfo = null; +// 鏁版嵁鍒楄〃 +let list = null; +// 浼犻�掑埌涓荤嚎绋嬬殑鏁版嵁 +let result = { + method:'', + value:null +} +// 浼樺寲鏁伴噰杈冨鏁版嵁鏃�--璁板綍鏁伴噰椤圭洰鐨処d鏁扮粍锛岀洰鐨勬槸鍙栨渶鍚庝竴涓暟閲囬」鐩紝浼犲埌涓荤嚎绋嬭繘琛屾壒閲忕殑鏁版嵁閲囬泦淇濆瓨 +let arrSpecial = [] +// 鎺ユ敹涓荤嚎绋嬩紶閫掕繃鏉ョ殑鏁版嵁 +self.onmessage = function(event) { + const data = JSON.parse(event.data); + dataAcquisitionInfo = data.dataAcquisitionInfo; + list = data.list; + // console.log(111,dataAcquisitionInfo) + arrSpecial = [] + // 澶勭悊鏁版嵁 + handleData() +} + +function handleData(){ + // 閬嶅巻鏁版嵁鍒楄〃 + list.forEach((item,index)=>{ + let num = 0; + let str = '' + item.forEach(m=>{ + if(m.v.ps&&(m.v.ps.value=='妫�楠屽瓙椤�'||m.v.ps.value=='妫�楠岄」'||m.v.ps.value=='妫�楠岄」鍒嗙被')){ + if(m.v.ps&&m.v.ps.value=='妫�楠岄」鍒嗙被'){ + if(num==0){ + num++ + str = m.v.v+',' + } + } + if(m.v.ps&&m.v.ps.value=='妫�楠岄」'){ + if(num==1){ + str = str+m.v.v + ',' + num++ + } else { + str = m.v.v+',' + num++ + } + } + if(m.v.ps&&m.v.ps.value=='妫�楠屽瓙椤�'){ + str = str+m.v.v + } + // 涓婇潰鍦ㄨ褰曟楠岄」+妫�楠屽瓙椤圭殑鍚嶇О锛屽鏋滄暟閲囧寘鍚楠岄」+妫�楠屽瓙椤圭殑鏁版嵁锛屽垯鎵ц + if(dataAcquisitionInfo[str]){ + let num = 0;//璇ユ楠岄」瀵瑰簲妫�楠屽�肩殑涓暟锛岀敤鐢ㄥ垽鏂渶澶氭湁澶氬皯涓楠屽�硷紝濡傛灉澶氭閲囬泦瓒呰繃浜嗚涓暟锛屽垯璧嬪�肩粰鏈�鍚庝竴涓楠屽�� + list[index].forEach(n=>{ + if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){ + num++ + } + }) + list[index].forEach((n,i)=>{ + if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){ + let arr = n.v.ps.value.split('鍊�') + if(Array.isArray(dataAcquisitionInfo[str].value)){ + // 濡傛灉鏁版嵁婧愪负鏁扮粍锛屽垯鎵ц + for (let i = 0; i < dataAcquisitionInfo[str].value.length; i++) { + if(i+1==arr[1]){ + // 璧嬪�兼暟閲囦紭鍖栨楠岄」鍒楄〃 + arrSpecial.push(n.i) + setTimeout(()=>{ + let num0 = 0 + if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 + let str0 = n.v.ct.fa.split('.')[1] + num0 = str0.length + n.v.v = dataAcquisitionInfo[str].value[i]?Number(dataAcquisitionInfo[str].value[i]).toFixed(num0):dataAcquisitionInfo[str].value[i] + }else{ + // 鐩存帴璧嬪�� + n.v.v = dataAcquisitionInfo[str].value[i] + } + // 浼犻�掔粰涓荤嚎绋� + result = { + method:'changeInput', + value:{ + list:list, + n:n + } + } + self.postMessage(JSON.stringify(result)) + },2000) + } + } + }else{ + // 濡傛灉鏁版嵁婧愪负瀛楃鎴栨暟瀛楋紝鍒欐墽琛� + if(arr[1] ==dataAcquisitionInfo[str].frequency){ + // 濡傛灉鏁伴噰娆℃暟绛変簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰褰撳墠妫�楠屽�� + arrSpecial.push(n.i) + setTimeout(()=>{ + let num0 = 0 + if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 + let str0 = n.v.ct.fa.split('.')[1] + num0 = str0.length + n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value + }else{ + // 鐩存帴璧嬪�� + n.v.v = dataAcquisitionInfo[str].value + } + // 浼犻�掔粰涓荤嚎绋� + result = { + method:'changeInput', + value:{ + list:list, + n:n + } + } + self.postMessage(JSON.stringify(result)) + },2000) + }else if(Number(dataAcquisitionInfo[str].frequency)>num){ + // 濡傛灉鏁伴噰娆℃暟澶т簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰鏈�鍚庝竴涓楠屽�� + if(n.v.ps.value.includes(num)){ + arrSpecial.push(n.i) + setTimeout(()=>{ + let num0 = 0 + if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){ + // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟 + let str0 = n.v.ct.fa.split('.')[1] + num0 = str0.length + n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value + }else{ + // 鐩存帴璧嬪�� + n.v.v = dataAcquisitionInfo[str].value + } + // 浼犻�掔粰涓荤嚎绋� + result = { + method:'changeInput', + value:{ + list:list, + n:n + } + } + self.postMessage(JSON.stringify(result)) + },2000) + } + } + } + } + }) + } + } + }) + }) + // if(arrSpecial[arrSpecial.length-1]){ + // //浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d锛岀敤浜庡悗缁鐞� + // setTimeout(()=>{ + // result = { + // getDataTypeId:arrSpecial[arrSpecial.length-1], + // } + // self.postMessage(JSON.stringify(result)) + // },0) + // } +} diff --git a/src/InspectionWorker.worker.js b/src/InspectionWorker.worker.js new file mode 100644 index 0000000..c8e0764 --- /dev/null +++ b/src/InspectionWorker.worker.js @@ -0,0 +1,2352 @@ +// 澶氱嚎绋嬮噷闈㈤渶瑕佷繚瀛樼殑鏁版嵁 +let code = ""; +// 琛ㄦ牸鏁版嵁锛堟覆鏌擄級 +let tableList = null; +// 鏂规硶鍒楄〃 +let excelMethodList = []; +// excel鍧愭爣姣旇緝鍒楄〃 +let comparisonList = []; +// 褰撳墠鏍峰搧淇℃伅 +let currentSample = {}; +// 褰撳墠椤圭洰锛氭娴嬩腑蹇冦�佽澶囩數缂� +let PROJECT = ""; +// 濂楃 +let bushing = ""; +// 澶氱嚎绋嬩紶閫掑埌涓荤嚎绋嬬殑鏁版嵁 +let result = { + method: "", + value: null, +}; + +let modelType = ""; + +// 淇濆瓨鏃朵紶鍒板悗绔弬鏁� +let param = null; +// 褰撳墠鐨勬ā鏉� +let currentTable = ""; +// 浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d +let getDataTypeId = null; +//褰撳墠妫�楠岄」 +let currentInsItem = null; +// 鎺ユ敹鍒颁富绾跨▼澶勭悊閫昏緫鐨勬秷鎭� +self.onmessage = function (event) { + console.log(2222, event); + // 淇濆瓨涓荤嚎绋嬩紶杩囨潵鐨勫�� + const data = JSON.parse(event.data); + if (currentTable != data.currentTable) { + // 妫�楠屾ā鏉挎敼鍙樺悗闇�瑕佸埛鏂拌〃鏍� + tableList = data.tableList; + } + currentTable = data.currentTable; + if (data.type && data.type == "saveData") { + // 鏇存柊琛ㄦ牸鏁版嵁鍜屼紶閫掑埌鍚庣鐨勫弬鏁� + tableList = data.tableList; + param = data.param; + return; + } + if (data.bushing && data.bushing != bushing && data.type == "saveData") { + // 鏇存柊琛ㄦ牸鏁版嵁銆佷紶閫掑埌鍚庣鐨勫弬鏁板拰濂楃鏁版嵁 + tableList = data.tableList; + param = data.param; + bushing = data.bushing; + return; + } + modelType = data.modelType; + code = data.code; + if (data.getDataTypeId) { + // 璁板綍 浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d + getDataTypeId = data.getDataTypeId; + } else { + getDataTypeId = null; + } + if (tableList) { + // 濡傛灉琛ㄦ牸鏁版嵁瀛樺湪锛屽垯鏇存柊褰撳墠淇敼妫�楠岄」鐨勮〃鏍兼暟鎹� + let str = code.split("-"); + let r = str[1]; + let c = str[2]; + tableList[0].arr.forEach((item, index) => { + item.forEach((m, i) => { + if (m.c == c && m.r == r) { + tableList[0].arr[index] = data.tableList[0].arr[index]; + } + }); + }); + } else { + // 濡傛灉鍒濆鍖栬〃鏍兼暟鎹笉瀛樺湪锛岀洿鎺ヨ祴鍊� + tableList = data.tableList; + } + if (param) { + // 濡傛灉浼犻�掑埌鍚庣鐨勫弬鏁板瓨鍦紝鍒欐洿鏂板綋鍓嶄慨鏀规楠岄」鐨勪紶閫掑埌鍚庣鐨勫弬鏁� + let str = code.split("-"); + let pId = str[3]; + param[pId] = data.param[pId]; + } else { + // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁� + param = data.param; + } + if (data.currentInsItem) { + currentInsItem = data.currentInsItem; + } + // 鏇存柊鏂规硶鍒楄〃銆佸潗鏍囨瘮杈冨垪琛ㄣ�佸綋鍓嶆牱鍝佷俊鎭�侀」鐩� + excelMethodList = JSON.parse(JSON.stringify(data.excelMethodList)); + comparisonList = JSON.parse(JSON.stringify(data.comparisonList)); + currentSample = JSON.parse(JSON.stringify(data.currentSample)); + PROJECT = data.PROJECT; + // 鎵ц璁$畻鏂规硶 + changeInput("", code); +}; + +function changeInput(m, code) { + let str = code.split("-"); + let r = str[1]; //褰撳墠琛� + let c = str[2]; //褰撳墠鍒� + let id = str[0]; + let pId = str[3]; //褰撳墠妫�楠岄」id锛宲aram[pId]涓哄綋鍓嶆楠岄」鐨勬墍鏈夊�硷紝鍖呭惈锛氳繃绋嬪�糹nsValue銆佽绠楀�糲omValue銆佽澶囩紪鐮乪quipValue銆佽澶囧悕绉癳quipName銆佹渶缁堝�紃esValue銆佺粨璁篿nsResult + var list = []; //涓�涓弻灞傛暟缁勶紝閲岄潰淇濆瓨鏈夊綋鍓嶉〉闈㈡覆鏌撶殑鎵�鏈夋暟鎹� + // 璧嬪�煎綋鍓嶆ā鏉跨殑琛ㄦ牸鏁版嵁 + for (let a in tableList) { + if (tableList[a].templateId == id) { + list = tableList[a].arr; + break; + } + } + let isToExponential = ""; //鏄惁涓虹瀛﹁鏁版硶 + let list2 = []; //涓�涓暟缁勶紝閲岄潰淇濆瓨鏈夊綋鍓嶆楠岄」鐨勬墍鏈夊弬鏁板�� + let isPoint = ""; //鏄惁涓哄皬鏁扮偣 + let inputType = null; + let currentInsItemId = ""; + let isSave = "true"; + // 寰幆鎵�鏈塭xcel鏂规硶锛屾壘鍒板綋鍓嶈銆佸垪鐨勬楠岄」锛屽鏋滄鍗曞厓鏍硷紙r,c锛夋槸鏌愪釜excel鏂规硶閲岄潰鐨勫弬鏁帮紝鍒欐墽琛屾鏂规硶 + const index = excelMethodList.findIndex((item) => item.r == r); + excelMethodList.forEach((item) => { + inputType = + item.valueList && + item.valueList.length > 0 && + item.valueList.find((m) => m.r == r && m.c == c); + // item.valueList 鏄綋鍓峞xcel鏂规硶鐨勫弬鏁板垪琛紝鎵惧埌褰撳墠濉叆鐨勫�兼槸鍚︽槸鍙傛暟 + if ( + item.valueList && + item.valueList.length > 0 && + item.valueList.find((m) => m.r == r && m.c == c) + ) { + isSave = "false"; + // 濡傛灉鏄紝鍒欏畾涔変竴涓弬鏁扮殑瀵硅薄闆嗗悎锛岀敤浜庝繚瀛樺綋鍓峞xcel鏂规硶鍙傛暟鐨勫�� + var comValue = {}; + item.valueList.forEach((a) => { + list.forEach((b) => { + if (b[0].r == a.r) { + b.forEach((c) => { + if (c.c == a.c) { + // 鑾峰彇褰撳墠鍙傛暟鐨凟xecl琛屽潗鏍�(ABCD)绛夌瓑 + var tableCode = ""; + for (var d in comparisonList) { + if (c.c == comparisonList[d].value) { + tableCode = comparisonList[d].label; + break; + } + } + list2.push(c.v.v); + // 缁勮鍙傛暟鐨勫璞¢泦鍚堝苟璧嬪�硷紝鍒楀{A3:12,B4:15} + if ( + getInspectionValueType(item.i) == 1 && + !isNaN(parseFloat(c.v.v)) + ) { + // 濡傛灉鏄暟瀛楄緭鍏ユ + let n = String(c.v.v); + if (n.includes("/")) { + // 濡傛灉鏄垎鏁帮紝鍒欒祴鍊� + comValue[tableCode + (c.r + 1)] = c.v.v; + } else { + comValue[tableCode + (c.r + 1)] = parseFloat(c.v.v); + } + } else { + // 濡傛灉鏄枃鏈�佷笅鎷夋绛夌瓑 + comValue[tableCode + (c.r + 1)] = c.v.v; + } + } + }); + } + }); + }); + // 濡傛灉姝xcel鏂规硶鏄粨璁哄垽鏂柟娉曪紝鍒欐墽琛屾鏂规硶 + // console.log('item.v.ps.value---', item.v.ps.value) + if (item.v.ps != undefined && item.v.ps.value == "缁撹") { + try { + if (currentSample.insProduct.find((m) => m.id == item.i)) { + // 濡傛灉褰撳墠妫�楠岄」鏄骇鍝佹楠岄」锛屽垯鎵ц姝ゆ柟娉曪紝鎵惧埌姝ゆ楠岄」鐨勮姹傚�� + let ask = currentSample.insProduct.find((m) => m.id == item.i).ask + ? currentSample.insProduct + .find((m) => m.id == item.i) + .ask.split("&") + : null; + // 鑾峰彇褰撳墠缁撹鐨勫弬鏁帮紝涔熷氨鏄綋鍓嶆楠岄」鐨勬渶缁堝�� + let res = Object.values(comValue)[0]; + if (typeof res == "string" && res.includes(">")) { + res = res.replace(">", ""); + } + if (typeof res == "string" && res.includes("鈮�")) { + res = res.replace("鈮�", ""); + } + if (typeof res == "string" && res.includes("鈮�")) { + res = res.replace("鈮�", ""); + } + if (typeof res == "string" && res.includes("<")) { + res = res.replace("<", ""); + } + if (typeof res == "string" && res.includes("锛�")) { + res = res.replace("锛�", ""); + } + if (typeof res == "string" && res.includes("锛�")) { + res = res.replace("锛�", ""); + } + if ( + typeof res == "string" && + (res === "鏂" || res === "鑴嗗寲" || res === "鏂鑴嗗寲") + ) { + item.v.v = 0; + list.forEach((a) => { + if (a[0].r == item.r) { + for (let b = 0; b < a.length; b++) { + if (a[b].c == item.c) { + a[b].v.v = 0; + break; + } + } + } + }); + } + let comp = []; + // 鍒ゆ柇褰撳墠缁撹鐨勫弬鏁帮紙褰撳墠妫�楠岄」鐨勬渶缁堝�硷級鏄惁涓虹┖锛屽鏋滀负绌猴紝鍒欑洿鎺ヨ祴鍊� + if ( + res === "" || + res === null || + res === undefined || + res === "Infinity" + ) { + item.v.v = null; + list.forEach((a) => { + if (a[0].r == item.r) { + for (let b = 0; b < a.length; b++) { + if (a[b].c == item.c) { + a[b].v.v = null; + break; + } + } + } + }); + } else { + // 濡傛灉涓嶄负绌猴紝鍒欏垽鏂綋鍓嶇粨璁哄氨闇�瑕佽繘琛屽垽鏂� + //瑕佹眰鍊间负-锛�/锛屸�旓紝鍒欑粨璁鸿缃负涓嶅垽瀹氾紝缁撹璧嬪�间负3 + if ( + ask == null || + ask[0] == "-" || + ask[0] == "/" || + ask[0] == "鈥�" + ) { + item.v.v = 3; + list.forEach((a) => { + if (a[0].r == item.r) { + for (let b = 0; b < a.length; b++) { + if (a[b].c == item.c) { + a[b].v.v = 3; + break; + } + } + } + }); + } else { + // 瑕佹眰鍊间笉涓�-锛�/锛屸�旓紝鍒欒繘琛屽垽鏂� + if (ask) { + // 寰幆瑕佹眰鍊煎垪琛紝鍒ゆ柇褰撳墠缁撹鐨勫弬鏁版槸鍚︾鍚堣姹� + comp = ask.map((m, i) => { + // 濡傛灉瑕佹眰鍊煎寘鍚�=锛屽垯鍒ゆ柇褰撳墠缁撹鐨勫弬鏁版槸鍚︾瓑浜庤姹傚�硷紝 + // 浠ヤ笅鍒ゆ柇鍩烘湰涓�鑷达紝鍙槸鍒ゆ柇绫诲瀷涓嶄竴鏍凤紝灏变笉鍋氭敞閲婁簡 + if (m.includes("=")) { + // 澶勭悊瑕佹眰鍊� + let str = handleFraction(m.split("=")[1]); + if (typeof res == "string" && typeof str == "string") { + // 濡傛灉瑕佹眰鍊煎拰褰撳墠缁撹鐨勫弬鏁伴兘鏄瓧绗︿覆锛屽垯鎵ц + if (res.includes("/")) { + // 濡傛灉缁撹鐨勫弬鏁版槸鍒嗘暟锛屽垯鍒ゆ柇 + if (m.includes("/")) { + // 濡傛灉瑕佹眰鍊兼槸鍒嗘暟锛屽垯鍒ゆ柇 + return eval(res) == eval(str); + } else { + // 濡傛灉瑕佹眰鍊间笉鏄垎鏁帮紝鍒欏垽鏂� + return handleMoreParam(res, m.split("=")[1], "="); + } + } else { + // 濡傛灉缁撹鐨勫弬鏁颁笉鏄垎鏁帮紝鍒欏垽鏂� + return ( + res.trim().replace(/[.,銆傘�侊紱锛�'";?锛熲�滐紝]/g, "") == + str.trim().replace(/[.,銆傘�侊紱锛�'";?锛熲�滐紝]/g, "") + ); + } + } else { + // 濡傛灉瑕佹眰鍊煎拰褰撳墠缁撹鐨勫弬鏁版湁涓�涓槸鏁板瓧锛屽垯鎵ц + return eval(res) == eval(str); + } + } else if (m.includes("鈮�")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split("鈮�")[1]); + return eval(res) >= eval(str); + } else { + return handleMoreParam(res, m.split("鈮�")[1], "鈮�"); + } + } else { + let str = handleFraction(m.split("鈮�")[1]); + return eval(res) >= eval(str); + } + } else if (m.includes("鈮�")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split("鈮�")[1]); + return eval(res) <= eval(str); + } else { + return handleMoreParam(res, m.split("鈮�")[1], "鈮�"); + } + } else { + let str = handleFraction(m.split("鈮�")[1]); + if (typeof str == "string" && str.includes("A")) { + str = str.replace("A", ""); + } + if (typeof str == "string" && str.includes("D")) { + str = str.replace("D", ""); + } + if (typeof res == "string" && res.includes("A")) { + res = res.replace("A", ""); + } + if (typeof res == "string" && res.includes("D")) { + res = res.replace("D", ""); + } + return eval(res) <= eval(str); + } + } else if (m.includes("<")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split("<")[1]); + return eval(res) < eval(str); + } else { + return handleMoreParam(res, m.split("<")[1], "<"); + } + } else { + let str = handleFraction(m.split("<")[1]); + return eval(res) < eval(str); + } + } else if (m.includes(">")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split(">")[1]); + return eval(res) > eval(str); + } else { + return handleMoreParam(res, m.split(">")[1], ">"); + } + } else { + let str = handleFraction(m.split(">")[1]); + return eval(res) > eval(str); + } + } else if (m.includes("~")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let k = m.split("~"); + return ( + eval(res) >= eval(handleFraction(k[0])) && + eval(res) <= eval(handleFraction(k[1])) + ); + } else { + return handleMoreParam(res, m, "~"); + } + } else { + let k = m.split("~"); + return ( + eval(res) >= eval(handleFraction(k[0])) && + eval(res) <= eval(handleFraction(k[1])) + ); + } + } else if (m.includes("-")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let k = m.split("-"); + return ( + eval(res) >= eval(handleFraction(k[0])) && + eval(res) <= eval(handleFraction(k[1])) + ); + } else { + return handleMoreParam(res, m, "-"); + } + } else { + let k = m.split("-"); + return ( + eval(res) >= eval(handleFraction(k[0])) && + eval(res) <= eval(handleFraction(k[1])) + ); + } + } else if (m.includes("卤")) { + if (modelType.includes("蠁-")) { + if (m.indexOf("卤") == 0) { + m = + modelType.substring(modelType.indexOf("-") + 1) + m; + } + } + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let k = m.split("卤"); + return ( + eval(res) >= + eval( + handleFraction(k[0]) - handleFraction(k[1]) + ) && + eval(res) <= + eval( + Number(handleFraction(k[0])) + + Number(handleFraction(k[1])) + ) + ); + } else { + return handleMoreParam(res, m, "卤"); + } + } else { + let k = m.split("卤"); + return ( + eval(res) >= + eval(handleFraction(k[0]) - handleFraction(k[1])) && + eval(res) <= + eval( + Number(handleFraction(k[0])) + + Number(handleFraction(k[1])) + ) + ); + } + } else if (m.includes("锛�")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split("锛�")[1]); + return eval(res) > eval(str); + } else { + return handleMoreParam(res, m.split("锛�")[1], ">"); + } + } else { + let str = handleFraction(m.split("锛�")[1]); + return eval(res) > eval(str); + } + } else if (m.includes("锛�")) { + if (typeof res == "string" && res.includes("/")) { + if (m.includes("/")) { + let str = handleFraction(m.split("锛�")[1]); + return eval(res) < eval(str); + } else { + return handleMoreParam(res, m.split("锛�")[1], "<"); + } + } else { + let str = handleFraction(m.split("锛�")[1]); + return eval(res) < eval(str); + } + } + }); + } + // 濡傛灉瑕佹眰鍊肩殑姣忎釜鏉′欢閮界鍚堬紝鍒欑粰缁撹璧嬪�间负1锛屽悎鏍� + if (comp.every((m) => m)) { + item.v.v = 1; + list.forEach((a) => { + if (a[0].r == item.r) { + for (let b = 0; b < a.length; b++) { + if (a[b].c == item.c) { + a[b].v.v = 1; + break; + } + } + } + }); + } else { + // 鍚﹀垯缁欑粨璁鸿祴鍊间负0锛屼笉鍚堟牸 + item.v.v = 0; + list.forEach((a) => { + if (a[0].r == item.r) { + for (let b = 0; b < a.length; b++) { + if (a[b].c == item.c) { + a[b].v.v = 0; + break; + } + } + } + }); + } + } + } + let getDataType0 = false; + // 浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d锛屽鏋滃綋鍓嶆楠岄」鐨刬d涓庤褰曠殑id鐩稿悓锛屽垯澶氫紶涓�涓弬鏁板埌涓荤嚎绋嬶紝杩涜鏁版嵁淇濆瓨锛屽惁鍒欐暟閲囧氨涓嶈繘琛屼繚瀛� + if (item.i == getDataTypeId) { + getDataType0 = true; + } + // 璧嬪�间紶閫掑埌涓荤嚎绋嬬殑鏁版嵁锛宮ethod锛歴aveInsContext琛ㄧず姝ゆ秷鎭渶瑕佷繚瀛樻暟鎹� + currentInsItemId = item.i; + // 璧嬪�间紶閫掑埌涓荤嚎绋嬬殑鏁版嵁锛宮ethod锛歴aveInsContext琛ㄧず姝ゆ秷鎭渶瑕佷繚瀛樻暟鎹� + result = { + method: "saveInsContext", + value: { + tableList, // 琛ㄦ牸鏁版嵁 + param: getParam(), //浼犵粰鍚庣鐨勫弬鏁� + getDataTypeId: getDataTypeId, + currentInsItemId: item.i, + }, + }; + // 鍙戞秷鎭粰涓荤嚎绋� + self.postMessage(JSON.stringify(result)); + } + } catch (error) { + console.log("error---", error); + } + } else { + // 濡傛灉鏄嚱鏁版柟娉曪紝鍒欐墽琛屾鏂规硶 + let comResult = ""; //鍒濆鍖栬绠楃粨鏋� + try { + if (getInspectionValueType(item.i) == 1) { + // 濡傛灉妫�楠屽�肩被鍨嬫槸鏁板瓧杈撳叆妗� + let tell = currentSample.insProduct.find((m) => m.id == item.i).tell + ? currentSample.insProduct + .find((m) => m.id == item.i) + .tell.split("&") + : null; + isPoint = + tell && + tell.length > 0 && + typeof tell[0] == "string" && + tell[0].includes("/") && + tell[0] !== "/"; // 瑁呭鐢电紗--鍒ゆ柇瑕佹眰鍊兼槸鍚︿负鍒嗘暟 + const inspectionItemClass = currentSample.insProduct.find( + (m) => m.id == item.i + ).inspectionItemClass; // 妫�楠岄」鍒嗙被 + const inspectionItem = currentSample.insProduct.find( + (m) => m.id == item.i + ).inspectionItem; // 妫�楠岄」 + const inspectionItemSubclass = currentSample.insProduct.find( + (m) => m.id == item.i + ).inspectionItemSubclass; // 妫�楠屽瓙椤� + let isHaveSymbol = false; + let symbol = ""; + for (var a in comValue) { + if ( + typeof comValue[a] == "string" && + (comValue[a].includes(">") || + comValue[a].includes("鈮�") || + comValue[a].includes("<") || + comValue[a].includes("鈮�") || + comValue[a].includes("锛�") || + comValue[a].includes("锛�")) + ) { + if (comValue[a].includes(">")) { + symbol = ">"; + } else if (comValue[a].includes("鈮�")) { + symbol = "鈮�"; + } else if (comValue[a].includes("鈮�")) { + symbol = "鈮�"; + } else if (comValue[a].includes("锛�")) { + symbol = "锛�"; + } else if (comValue[a].includes("锛�")) { + symbol = "锛�"; + } else { + symbol = "<"; + } + isHaveSymbol = true; + break; + } + } + // 鏍规嵁杈撳叆鐨勬暟鍊硷紝杩涜璁$畻 + comResult = compute(item.v.f.replace(/=/g, " "), comValue, isPoint); + // 妫�楠岄」涓哄瘑搴︽椂锛屾牴鎹姹傚�肩殑灏忔暟浣嶆敼鍙樻渶缁堝�肩殑灏忔暟浣� + if (inspectionItem == "瀵嗗害") { + const str = "" + tell; + const indexOfDecimal = str.indexOf("."); + if (indexOfDecimal > -1) { + const length = str.length - indexOfDecimal - 1; + comResult = comResult.toFixed(length); + } + } else if ( + inspectionItemClass == "澶栨姢濂楁満姊扮墿鐞嗘�ц兘" && + inspectionItem == "鍦↖RM 902鐭跨墿娌逛腑娴告场鍚�" && + (inspectionItemSubclass == "鏂浼搁暱鐜囧彉鍖栫巼" || + inspectionItemSubclass == "鎶楀紶寮哄害鍙樺寲鐜�") + ) { + comResult = Math.round(comResult).toFixed(0); + } else if ( + typeof comResult == "string" && + (comResult.includes("鏂") || comResult.includes("鑴嗗寲")) + ) { + comResult = comResult + ""; + } + if (inspectionItem === "閭垫皬纭害" && tell[0].includes("A")) { + // 瑕佹眰鍊煎鏋滄湁鍖呭惈瀛楁瘝锛屾渶缁堢粨鏋滆灞曠ず鍑哄瓧姣� + comResult = comResult + "A"; + } + if ( + inspectionItemClass === "缁濈紭鏈烘鐗╃悊鎬ц兘" && + inspectionItem === "寮洸鎬ц兘" && + inspectionItemSubclass === "鏈�灏忓集鏇插崐寰�" && + tell[0].includes("D") + ) { + // 瑕佹眰鍊煎鏋滄湁鍖呭惈瀛楁瘝锛屾渶缁堢粨鏋滆灞曠ず鍑哄瓧姣� + comResult = comResult + "D"; + } + if (isHaveSymbol) { + comResult = symbol + comResult; + } + let list3 = list2.map((item) => item + ""); + // 鍒ゆ柇濉殑妫�楠屽�兼槸鍚︿负绉戝璁℃暟娉曪紝濡傛灉涓虹瀛﹁鏁版硶锛屽垯杩涜杞寲 + isToExponential = list3.some( + (val) => val.includes("e+") || val.includes("e-") + ); + if (isToExponential) { + let num2 = new Big(comResult); + comResult = num2.toExponential(1); + } + } else { + // 濡傛灉妫�楠屽�肩被鍨嬫槸鏂囨湰杈撳叆妗嗐�佷笅鎷夋 + let valueList = []; + // 澶勭悊excel鍑芥暟鍙傛暟鍒楄〃 + item.valueList.forEach((a) => { + valueList.push({ + name: `${comparisonList.find((e) => e.value == a.c).label}${ + a.r + 1 + }`, + value: 0, + }); + }); + // 缁檈xcel鍑芥暟鍙傛暟璧嬫枃鏈�� + for (var a in comValue) { + valueList.forEach((b) => { + if (b.name == a) { + b.value = comValue[a]; + } + }); + } + // 璁$畻鍏紡锛屽幓鎺塭xcel鍑芥暟鐨勭瓑鍙凤紝骞舵浛鎹㈠弬鏁帮紝鍒楀锛�=A1 鍙樻垚 A1 鍙樻垚 鈥樻枃鏈緭鍏ョ殑鍊尖�� + let str = item.v.f.replace(/=/g, " "); + valueList.forEach((b) => { + str = str.replace(b.name, b.value); + }); + // 璁$畻缁撴灉璧嬪�� + comResult = str; + } + } catch (error) { + console.log("error---", error); + } + try { + // 寰幆琛ㄦ牸鏁版嵁锛岀粰琛ㄦ牸鏁版嵁杩涜璧嬪�� + list.forEach((a) => { + if (a[0].r == item.r && comResult !== "") { + // 鍒ゆ柇褰撳墠琛屾槸鍚︿负褰撳墠妫�楠岄」鎵�鍦ㄨ锛屽鏋滀负褰撳墠琛岋紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�� + for (var b in a) { + if (a[b].c == item.c) { + try { + if (comResult == 0) { + // 鍒ゆ柇璁$畻缁撴灉鏄惁涓�0锛屽鏋滀负0锛屽垯缁欒〃鏍兼暟鎹祴鍊间负0 + a[b].v.v = 0; + } else if ( + a[b].v.ct && + a[b].v.ct.fa && + typeof a[b].v.ct.fa == "string" && + a[b].v.ct.fa.includes(".") + ) { + // 鍒ゆ柇褰撳墠鍗曞厓鏍兼槸鍚︿繚鐣欏皬鏁扮偣锛屽鏋滀负淇濈暀灏忔暟鐐癸紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负淇濈暀灏忔暟鐐癸紝杩欎釜鏄牴鎹ā鏉块厤缃皬鏁扮偣鏉ョ殑 + let num = 0; + let str = a[b].v.ct.fa.split(".")[1]; + num = str.length; + a[b].v.v = comResult + ? Number(comResult).toFixed(num) + : comResult; + } else if ( + typeof comResult == "string" && + (comResult.includes("e+") || comResult.includes("e-")) + ) { + // 鍒ゆ柇璁$畻缁撴灉鏄惁涓虹瀛﹁鏁版硶锛屽鏋滀负绉戝璁℃暟娉曪紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负绉戝璁℃暟娉� + a[b].v.v = comResult; + } else { + const inspectionItem = currentSample.insProduct.find( + (m) => m.id == item.i + ).inspectionItem; + // 鍒ゆ柇璁$畻缁撴灉鏄惁涓烘暟瀛楋紝濡傛灉涓烘暟瀛楋紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负鏁板瓧 + if (inspectionItem == "閾滅嚎鐢甸樆鐜囅�20鏈�澶у��") { + let val = parseFloat(Number(comResult).toFixed(5)); + a[b].v.v = isNaN(val) ? comResult : val; + } else { + let val = parseFloat(Number(comResult).toFixed(3)); + a[b].v.v = isNaN(val) ? comResult : val; + } + } + } catch (error) { + // 濡傛灉浠ヤ笂鍒ゆ柇閮戒笉鏀寔锛屽垯鐩存帴璧嬪�� + a[b].v.v = comResult; + console.log("error---", error); + } + break; + } + } + } + }); + // 濡傛灉姝よ绠楃粨鏋滄墍灞炲崟鍏冩牸锛屽悓鏃朵篃鏄彟涓�涓猠xcel鍑芥暟鐨勫弬鏁帮紝閭d箞灏遍渶瑕侀�掑綊杩涜璁$畻 + changeInput(comResult, `${id}-${item.r}-${item.c}-${pId}`); //鏀瑰彉鏈�缁堝�� + currentInsItemId = item.i; + } catch (error) { + console.log("error---", error); + } + } + } + }); + if (index === -1 || (inputType === undefined && isSave === "true")) { + // 璧嬪�间紶閫掑埌涓荤嚎绋嬬殑鏁版嵁锛宮ethod锛歴aveInsContext琛ㄧず姝ゆ秷鎭渶瑕佷繚瀛樻暟鎹� + result = { + method: "saveInsContext", + value: { + tableList, // 琛ㄦ牸鏁版嵁 + param: getParam(), //浼犵粰鍚庣鐨勫弬鏁� + getDataTypeId: getDataTypeId, + currentInsItemId: currentInsItemId, + }, + }; + // 鍙戞秷鎭粰涓荤嚎绋� + self.postMessage(JSON.stringify(result)); + } + + // 璧嬪�煎绾跨▼浼犺緭鏁版嵁 + result = { + method: "tableList", + value: tableList, + }; + // 鍙戦�佷富绾跨▼鏁版嵁 + self.postMessage(JSON.stringify(result)); + try { + // 璧嬪�煎绾跨▼浼犺緭鏁版嵁 + result = { + method: "getCurrentInsProduct", + value: pId, + }; + // 鍙戦�佷富绾跨▼鏁版嵁 + self.postMessage(JSON.stringify(result)); + } catch (error) { + console.log("error---", error); + } +} +/** + * 鑾峰彇妫�娴嬪�肩被鍨� + * + * @param id 妫�娴嬪�肩被鍨嬪搴旂殑id + * @returns 杩斿洖妫�娴嬪�肩被鍨� + */ +function getInspectionValueType(id) { + for (var a in currentSample.insProduct) { + if (currentSample.insProduct[a].id == id) { + return currentSample.insProduct[a].inspectionValueType; + } + } +} +/** + * 澶勭悊鍒嗘暟鎴栧甫鏈変箻娉曞拰涔樻柟鐨勫瓧绗︿覆 + * + * @param str 瀛楃涓茬被鍨嬶紝琛ㄧず瑕佸鐞嗙殑鍒嗘暟鎴栦箻鏂硅〃杈惧紡 + * @returns 杩斿洖涓�涓暟瀛楁垨鍘熷瓧绗︿覆锛屽鏋滃瓧绗︿覆涓烘湁鏁堢殑鍒嗘暟鎴栦箻鏂硅〃杈惧紡锛屽垯杩斿洖璁$畻缁撴灉锛涘惁鍒欒繑鍥炲師瀛楃涓� + */ +function handleFraction(str) { + if (str && typeof str == "string" && str.includes("/")) { + // 澶勭悊鍒嗘暟 + return eval(str.split("/")[0] / str.split("/")[1]); + } else if ( + str && + typeof str == "string" && + str.includes("*") && + str.includes("^") + ) { + // 璁$畻涔樻柟 + const num1 = str.split("*"); + const num2 = num1[1].split("^"); + let num3 = new Big(num2[0]); + let num4 = new Big(num2[1]); + let num5 = Math.pow(num3, num4); // 璁$畻娆℃柟 + return num1[0] * num5; // 鏈�鍚庤绠椾箻娉� + } else { + return str; + } +} + +/** + * 澶勭悊甯︽湁澶氫釜鍙傛暟鐨勫嚱鏁� + * + * @param res 瀛楃涓诧紝闇�瑕佽鍒嗗壊骞跺鐞嗙殑瀛楃涓� + * @param str 瀛楃涓诧紝涓巖es涓殑姣忎竴椤硅繘琛屾瘮杈冪殑瀛楃涓诧紝鍙兘鏄垎鏁版垨鑰呭甫鏈夋瘮杈冪鍙风殑瀛楃涓� + * @param comp 瀛楃涓诧紝琛ㄧず姣旇緝绫诲瀷鐨勫瓧绗︼紙濡� '>'銆�'<'銆�'='銆�'鈮�'銆�'鈮�'銆�'卤'銆�'~'銆�'-'锛� + * @returns 杩斿洖甯冨皵鍊硷紝濡傛灉res涓瘡涓�椤归兘婊¤冻涓巗tr鐨勬瘮杈冩潯浠讹紝鍒欒繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse + */ +function handleMoreParam(res, str, comp) { + let arr = res.split("/"); + let arr0 = arr.every((item) => { + switch (comp) { + case ">": + return item > handleFraction(str); + case "<": + return item < handleFraction(str); + case "=": + return item == handleFraction(str); + case "鈮�": + return item >= handleFraction(str); + case "鈮�": + return item <= handleFraction(str); + case "卤": + let k = str.split("卤"); + return ( + item >= eval(handleFraction(k[0]) - handleFraction(k[1])) && + item <= + eval(Number(handleFraction(k[0])) + Number(handleFraction(k[1]))) + ); + case "~": + let j = str.split("~"); + return ( + item >= eval(handleFraction(j[0])) && + item <= eval(handleFraction(j[1])) + ); + case "-": + let o = str.split("-"); + return ( + item >= eval(handleFraction(o[0])) && + item <= eval(handleFraction(o[1])) + ); + } + }); + if (arr0) { + return true; + } else { + return false; + } +} + +/** + * 鑾峰彇鍙傛暟 + * + * @returns 杩斿洖澶勭悊鍚庣殑鍙傛暟瀵硅薄 + */ +function getParam() { + tableList[0].arr.forEach((a) => { + a.forEach((b) => { + // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁� + if (param[b.i]) { + param[b.i].insValue = []; + param[b.i].comValue = []; + param[b.i].equipValue = []; + param[b.i].equipName = []; + param[b.i].resValue = null; + param[b.i].insResult = null; + } + }); + }); + tableList[0].arr.forEach((a) => { + a.forEach((b) => { + // 鏍规嵁琛ㄦ牸鏁版嵁锛岃祴鍊间紶閫掑埌鍚庣鐨勫弬鏁� + if ( + b.v.ps != undefined && + typeof b.v.ps.value == "string" && + b.v.ps.value.includes("妫�楠屽��") + ) { + // 璧嬪�兼楠屽�� + b.i && b.v.v && param[b.i].insValue.push(b); + } + if (b.v.ps != undefined && b.v.ps.value === "璁$畻鍊�") { + // 璧嬪�艰绠楀�� + b.i && + b.v.v && + b.valueList && + b.valueList.length > 0 && + param[b.i].comValue.push(b); + } + if (b.v.ps != undefined && b.v.ps.value === "璁惧缂栫爜") { + // 璧嬪�艰澶囩紪鐮� + b.i && b.v && param[b.i].equipValue.push(b); + } + if (b.v.ps != undefined && b.v.ps.value === "璁惧鍚嶇О") { + // 璧嬪�艰澶囧悕绉� + b.i && b.v && param[b.i].equipName.push(b); + } + if (b.v.ps != undefined && b.v.ps.value === "鏈�缁堝��") { + // 璧嬪�兼渶缁堝�� + b.i && + b.v && + b.valueList && + b.valueList.length > 0 && + (param[b.i].resValue = b); + } + if (b.v.ps != undefined && b.v.ps.value === "缁撹") { + if (b.i && (b.v.v || b.v.v === 0 || b.v.v === "0")) { + if (b.v.v != "鍚堟牸" && b.v.v != "涓嶅悎鏍�") { + // 璧嬪�肩粨璁� + param[b.i].insResult = b; + } + } + } + }); + }); + return param; +} + +/** + * 璁$畻澶氫釜鏁板�肩殑鍜� + * + * @param val 鏁板�煎瀷鍙傛暟锛屽彲鍙橀暱鍙傛暟鍒楄〃 + * @returns 杩斿洖鎵�鏈夊弬鏁扮殑鍜岋紝濡傛灉鍙傛暟鍒楄〃涓虹┖鎴栧弬鏁扮被鍨嬮潪鏁板�煎瀷锛屽垯杩斿洖null + */ +function SUM(...val) { + try { + let num = null; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + val.forEach((item) => { + num += item; + }); + } + return num; + } catch (error) { + console.log("error---", error); + } +} +/** + * 璁$畻浼犲叆鍙傛暟涓殑鏈�澶у�� + * + * @param ...val 鍙彉鍙傛暟鍒楄〃锛岀敤浜庤绠楁渶澶у�肩殑鏁板�兼垨鍙浆鎹负鏁板�肩殑绫诲瀷 + * @returns 杩斿洖鏈�澶у�硷紝濡傛灉鍙傛暟鍒楄〃涓虹┖鎴栦负null/undefined/''锛屽垯杩斿洖null + */ +function MAX(...val) { + try { + let max = null; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + val = val.filter((item) => item != null && item !== ""); + if (val.length > 0) { + max = Math.max(...val); + } else { + max = null; + } + } + return max; + } catch (error) { + console.log("error---", error); + } +} +/** + * IF鍒ゆ柇 + * + * + * + */ +function IF(...val) { + try { + let ifNUm = null; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + if (val[0] === "" || val[0] == 0 || val[0] === " ") { + ifNUm = val[1]; + } else { + ifNUm = val[0]; + } + } + return ifNUm; + } catch (error) { + console.log("IFerror---", error); + } +} +/** + * 璁$畻浼犲叆鍙傛暟涓殑鏈�灏忓�� + * + * @param val 鍙彉鍙傛暟锛岀敤浜庤绠楁渶灏忓�肩殑鏁板�兼暟缁� + * @returns 杩斿洖浼犲叆鍙傛暟涓殑鏈�灏忓�硷紝濡傛灉浼犲叆鍙傛暟涓虹┖鎴栨墍鏈夊�煎潎涓簄ull鎴栫┖瀛楃涓诧紝鍒欒繑鍥瀗ull + */ +function MIN(...val) { + try { + let min = null; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + val = val.filter((item) => item != null && item !== ""); + if (val.length > 0) { + min = Math.min(...val); + } + } + return min; + } catch (error) { + console.log("error---", error); + } +} +/** + * 璁$畻缁欏畾鏁板�肩殑骞冲潎鍊� + * + * @param val 鏁板�煎垪琛紝鍙寘鍚换鎰忎釜鍙傛暟 + * @returns 杩斿洖骞冲潎鍊硷紝濡傛灉鏁板�煎垪琛ㄤ负绌烘垨鍖呭惈闈炴暟鍊奸」锛屽垯杩斿洖null + */ +function AVERAGE(...val) { + try { + let num = null; + let arr = []; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + arr = val.filter( + (item) => item !== null && item !== "" && item != undefined + ); + arr.forEach((item) => { + num += item; + }); + if (arr.length > 0) { + return num / arr.length; + } else { + return null; + } + } else { + return null; + } + } catch (error) { + console.log("error---", error); + } +} +/** + * 鍙栨暣鏁� + * + * @param val 浠绘剰鏁板�� + * @returns 杩斿洖璇ユ暟鍊肩殑鏁存暟 + */ +function INT(val) { + try { + return Math.round(val); + } catch (error) { + console.log("error---", error); + } +} +/** + * 璁$畻涓�涓暟鐨勭粷瀵瑰�� + * + * @param val 浠绘剰鏁板�� + * @returns 杩斿洖璇ユ暟鍊肩殑缁濆鍊� + */ +function ABS(val) { + try { + return Math.abs(val); + } catch (error) { + console.log("error---", error); + } +} +/** + * 璁$畻涓�缁勬暟瀛楃殑涓綅鏁� + * + * @param val 浠绘剰涓弬鏁帮紝闇�瑕佽绠椾腑浣嶆暟鐨勬暟瀛� + * @returns 濡傛灉鍙傛暟涓湁鏈夋晥鐨勬暟瀛楋紝鍒欒繑鍥炶绠楀嚭鐨勪腑浣嶆暟锛涘惁鍒欒繑鍥瀗ull + */ +function MEDIAN(...val) { + try { + let arr = []; + if (val && val.length > 0) { + arr = val.filter((item) => item != null && item !== ""); + const sortedArr = arr.sort((a, b) => a - b); + // 璁$畻涓綅鏁� + const half = Math.floor(sortedArr.length / 2); + if (arr.length > 0) { + // 濡傛灉鏁扮粍闀垮害鏄鏁帮紝鐩存帴鍙栦腑闂寸殑鍏冪礌 + if (sortedArr.length % 2 === 1) { + return sortedArr[half]; + } else { + // 濡傛灉鏁扮粍闀垮害鏄伓鏁帮紝鍙栦腑闂翠袱涓厓绱犵殑骞冲潎鍊� + return (sortedArr[half - 1] + sortedArr[half]) / 2; + } + } else { + return null; + } + } else { + return null; + } + } catch (error) { + console.log("error---", error); + } +} + +/** + * 璁$畻骞� + * + * @param str 瀛楃涓插舰寮忕殑骞傝〃杈惧紡锛屼緥濡�"2^3" + * @returns 杩斿洖璁$畻鍚庣殑骞傚�硷紝濡傛灉琛ㄨ揪寮忔棤鏁堝垯杩斿洖null + */ +function CalculatePower(str) { + try { + if (str && str.includes("^")) { + let arr = str.split("^"); + if (arr && arr.length > 1) { + return Math.pow(arr[0], arr[1]); + } else { + return null; + } + } + } catch (error) { + console.log("error---", error); + } +} +/** + * 杞崲蟺 + * + * + * + */ +function PI() { + try { + return 3.1415926; + } catch (error) { + console.log("error---", error); + } +} +/** + * 璁$畻LOG + * + * + * + */ +function LOG(...val) { + try { + let LOGNUm = null; + if ( + val != null && + val != undefined && + val != "undefined" && + val != "NaN" && + val.length > 0 + ) { + val = val.filter((item) => item != null && item !== ""); + if (val.length > 0) { + LOGNUm = Math.log(val[0]); + } + } + // console.log(LOGNUm); + return LOGNUm; + } catch (error) { + console.log("error---", error); + } +} + +/** + * 鏍规嵁鍧愭爣鑾峰彇鍒楀悕 + * @param {Object} cellId + */ +function getColumnNameFromId(cellId) { + try { + if (!Array.isArray(cellId)) { + cellId = cellId.split("-"); + } + var i = cellId[0]; + var letter = ""; + if (i > 701) { + letter += String.fromCharCode(64 + parseInt(i / 676)); + letter += String.fromCharCode(64 + parseInt((i % 676) / 26)); + } else if (i > 25) { + letter += String.fromCharCode(64 + parseInt(i / 26)); + } + letter += String.fromCharCode(65 + (i % 26)); + return letter + (parseInt(cellId[1]) + 1); + } catch (e) { + console.log("error", e); + } +} +/** + * 鏍规嵁鍒楀悕鑾峰彇鍧愭爣 + * @param {Object} id + * @param {Object} arr + */ +function getIdFromColumnName(id, arr) { + try { + // Get the letters + var t = /^[a-zA-Z]+/.exec(id); + if (t) { + // Base 26 calculation + var code = 0; + for (var i = 0; i < t[0].length; i++) { + code += + parseInt(t[0].charCodeAt(i) - 64) * Math.pow(26, t[0].length - 1 - i); + } + code--; + // Make sure jexcel starts on zero + if (code < 0) { + code = 0; + } + + // Number + var number = parseInt(/[0-9]+$/.exec(id)); + if (number > 0) { + number--; + } + + if (arr == true) { + id = [code, number]; + } else { + // id = code + '-' + number; + id = { + c: code, + r: number, + }; + } + } + return id; + } catch (e) { + console.log("error", e); + } +} + +/** + * 鏇存敼鍙傛暟 + * + * @param f 鍙傛暟鍒楄〃 + * @returns 杩斿洖涓�涓寘鍚潗鏍囦俊鎭殑鏁扮粍 + */ +function changeParameter(f) { + try { + let arr = getABCList(f); + let arr2 = []; + arr.forEach((item) => { + // 鍒ゆ柇鏄惁涓鸿寖鍥达紝鍒楀MAX(A1:B2) + if (item.includes(":")) { + let r0 = getIdFromColumnName(item.split(":")[0]).r; + let c0 = getIdFromColumnName(item.split(":")[0]).c; + let r1 = getIdFromColumnName(item.split(":")[1]).r; + let c1 = getIdFromColumnName(item.split(":")[1]).c; + for (let i = Number(r0); i <= Number(r1); i++) { + for (let u = Number(c0); u <= Number(c1); u++) { + arr2.push({ + r: i, + c: u, + }); + } + } + } else { + // 娌℃湁鍒欑洿鎺ヨ幏鍙� + arr2.push(getIdFromColumnName(item)); + } + }); + return arr2; + } catch (error) { + console.log("error", error); + } +} +/** + * 鑾峰彇鍖呭惈 ABC 瀛楃鐨勫垪琛� + * + * @param f 瀛楃涓诧紝鍖呭惈闇�瑕佽В鏋愮殑鍏紡鎴栬〃杈惧紡 + * @returns 鍖呭惈 ABC 瀛楃鐨勬暟缁勫垪琛� + */ +function getABCList(f) { + try { + let regex = /[=\+\-\*\%\(\)\/\^\s]/g; + // 涓婇潰璁$畻鍑芥暟鏂板鍚庯紝杩欓噷涔熻鍚屾澧炲姞 + let fouList = [ + "SUM", + "MAX", + "MIN", + "AVERAGE", + "ABS", + "PI", + "INT", + "IF", + "LOG", + ]; + // 鏇挎崲鐗规畩瀛楃 + f = f + .replace(regex, ",") + .replace(new RegExp('"&', "g"), "") + .replace(new RegExp('&"', "g"), ""); + fouList.forEach((item) => { + f = f.replace(new RegExp(item, "g"), ","); + }); + let arr = f.split(",").filter((item) => { + return ( + item && /[a-zA-Z]/.test(item) && item != "undefined" && item != "null" + ); + }); + return arr; + } catch (error) { + console.log("error", error); + } +} +/** + * 鑾峰彇鎵�鏈夊崟鍏冩牸 + * + * @param f 琛ㄦ牸鏁版嵁鎴栫浉鍏冲弬鏁� + * @returns 杩斿洖涓�涓璞★紝鍏堕敭涓哄崟鍏冩牸鐨勫敮涓�鏍囪瘑绗︼紙鐢卞垪鍜岃ID鎷兼帴鑰屾垚锛夛紝鍊间负null + */ +function getAllCell(f) { + try { + let arr = changeParameter(f); + let arr0 = {}; + arr.forEach((item) => { + arr0[getColumnNameFromId(`${item.c}` + "-" + `${item.r}`)] = null; + }); + return arr0; + } catch (error) { + console.log("error", error); + } +} + +/** + * 璁$畻鍑芥暟 + * + * @param f 瀛楃涓茬被鍨嬶紝琛ㄧず寰呰绠楃殑鍏紡 + * @param comValue 瀵硅薄绫诲瀷锛岃〃绀鸿鏇挎崲鐨勫崟鍏冩牸鍊硷紝閿负鍗曞厓鏍煎悕绉帮紝鍊间负鏇挎崲鍚庣殑鍊� + * @returns 杩斿洖璁$畻鍚庣殑缁撴灉锛屽鏋滆绠楀け璐ュ垯杩斿洖0 + */ +function compute(f, comValue, isPoint) { + try { + let str = f; + // 鑾峰彇鍗曞厓鏍煎搴斿�� + let arr = getAllCell(f); + for (var a in comValue) { + if (typeof comValue[a] == "string" && comValue[a].includes(">")) { + comValue[a] = comValue[a].replace(">", ""); + } + if (typeof comValue[a] == "string" && comValue[a].includes("鈮�")) { + comValue[a] = comValue[a].replace("鈮�", ""); + } + if (typeof comValue[a] == "string" && comValue[a].includes("鈮�")) { + comValue[a] = comValue[a].replace("鈮�", ""); + } + if (typeof comValue[a] == "string" && comValue[a].includes("<")) { + comValue[a] = comValue[a].replace("<", ""); + } + if (typeof comValue[a] == "string" && comValue[a].includes("锛�")) { + comValue[a] = comValue[a].replace("锛�", ""); + } + if (typeof comValue[a] == "string" && comValue[a].includes("锛�")) { + comValue[a] = comValue[a].replace("锛�", ""); + } + if ( + comValue[a] !== "undefined" && + comValue[a] !== "null" && + comValue[a] !== undefined + ) { + if (typeof comValue[a] == "string" && comValue[a].includes("^")) { + // 璁$畻骞傛 + arr[a] = CalculatePower(comValue[a]); + } else { + arr[a] = comValue[a]; + } + } + } + // 瑙f瀽鍏紡鍙傛暟锛岀壒鍒槸甯︼細鐨� + let arr0 = getABCList(f); + let obj = {}; + arr0.forEach((item) => { + if (item.includes(":")) { + let arr1 = []; + let r0 = getIdFromColumnName(item.split(":")[0]).r; + let c0 = getIdFromColumnName(item.split(":")[0]).c; + let r1 = getIdFromColumnName(item.split(":")[1]).r; + let c1 = getIdFromColumnName(item.split(":")[1]).c; + for (let i = Number(r0); i <= Number(r1); i++) { + for (let u = Number(c0); u <= Number(c1); u++) { + arr1.push({ + r: i, + c: u, + }); + } + } + let arr2 = []; + arr1.forEach((m) => { + arr2.push(getColumnNameFromId(`${m.c}` + "-" + `${m.r}`)); + }); + obj[item.split(":").join("-")] = arr2.join(","); + } else { + obj[item] = item; + } + }); + str = str.replace(new RegExp(":", "g"), "-"); + // 鏇挎崲鍙傛暟 + for (var a in obj) { + str = str.replace(new RegExp(a, "g"), obj[a]); + } + // 璁$畻 + for (var a in arr) { + str = str.replace(new RegExp(a, "g"), arr[a]); + } + if (str.includes(",,")) { + str = str.replace(new RegExp(",,", "g"), ","); + } + if (str.includes(",,")) { + str = str.replace(new RegExp(",,", "g"), ","); + } + if (str.includes(",,")) { + str = str.replace(new RegExp(",,", "g"), ","); + } + if (str.includes(",,")) { + str = str.replace(new RegExp(",,", "g"), ","); + } + if (str.includes(",,")) { + str = str.replace(new RegExp(",,", "g"), ","); + } + if (str.includes('&"/"&')) { + // 璁$畻甯︽枩鏉犵殑 + return str + .replace(new RegExp('&"/"&', "g"), "/") + .replace(new RegExp("//", "g"), ""); + } else if (isPoint) { + // 璁$畻甯﹀皬鏁扮偣鐨� + return str.replace("ABS", "").replace(/\(|\)/g, ""); + } else { + if (str.includes("IF")) { + str = str.replace("IF", "").replace(/\(|\)/g, ""); + const str1 = str.split(","); + if (str1[0] === " " || str1[0] === "") { + str1[0] = 0; + } + if (str1[2] === " " || str1[2] === "") { + str1[2] = 0; + } + const str2 = str1.join(","); + str = "IF(" + str2 + ")"; + } + // console.log('str---', str) + if (str.includes("鏂") || str.includes("鑴嗗寲")) { + const result = str.replace(/[^\u4e00-\u9fa5]/g, ""); + if (result.includes("鏂") && !result.includes("鑴嗗寲")) { + return "鏂"; + } else if (!result.includes("鏂") && result.includes("鑴嗗寲")) { + return "鑴嗗寲"; + } else if (result.includes("鏂") && result.includes("鑴嗗寲")) { + return "鏂鑴嗗寲"; + } + } + // 璁$畻甯歌鐨� + return eval(str); + } + } catch (error) { + console.log("error", error); + } +} + +/* + * big.js v5.2.2 + * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic. + * Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com> + * https://github.com/MikeMcl/big.js/LICENCE + */ +(function (GLOBAL) { + "use strict"; + var Big, + /************************************** EDITABLE DEFAULTS *****************************************/ + + // The default values below must be integers within the stated ranges. + + /* + * The maximum number of decimal places (DP) of the results of operations involving division: + * div and sqrt, and pow with negative exponents. + */ + DP = 20, // 0 to MAX_DP + /* + * The rounding mode (RM) used when rounding to the above decimal places. + * + * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN) + * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP) + * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN) + * 3 Away from zero. (ROUND_UP) + */ + RM = 1, // 0, 1, 2 or 3 + // The maximum value of DP and Big.DP. + MAX_DP = 1e6, // 0 to 1000000 + // The maximum magnitude of the exponent argument to the pow method. + MAX_POWER = 1e6, // 1 to 1000000 + /* + * The negative exponent (NE) at and beneath which toString returns exponential notation. + * (JavaScript numbers: -7) + * -1000000 is the minimum recommended exponent value of a Big. + */ + NE = -7, // 0 to -1000000 + /* + * The positive exponent (PE) at and above which toString returns exponential notation. + * (JavaScript numbers: 21) + * 1000000 is the maximum recommended exponent value of a Big. + * (This limit is not enforced or checked.) + */ + PE = 21, // 0 to 1000000 + /**************************************************************************************************/ + + // Error messages. + NAME = "[big.js] ", + INVALID = NAME + "Invalid ", + INVALID_DP = INVALID + "decimal places", + INVALID_RM = INVALID + "rounding mode", + DIV_BY_ZERO = NAME + "Division by zero", + // The shared prototype object. + P = {}, + UNDEFINED = void 0, + NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; + + /* + * Create and return a Big constructor. + * + */ + function _Big_() { + /* + * The Big constructor and exported function. + * Create and return a new instance of a Big number object. + * + * n {number|string|Big} A numeric value. + */ + function Big(n) { + var x = this; + + // Enable constructor usage without new. + if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n); + + // Duplicate. + if (n instanceof Big) { + x.s = n.s; + x.e = n.e; + x.c = n.c.slice(); + } else { + parse(x, n); + } + + /* + * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which + * points to Object. + */ + x.constructor = Big; + } + + Big.prototype = P; + Big.DP = DP; + Big.RM = RM; + Big.NE = NE; + Big.PE = PE; + Big.version = "5.2.2"; + + return Big; + } + + /* + * Parse the number or string value passed to a Big constructor. + * + * x {Big} A Big number instance. + * n {number|string} A numeric value. + */ + function parse(x, n) { + var e, i, nl; + + // Minus zero? + if (n === 0 && 1 / n < 0) n = "-0"; + else if (!NUMERIC.test((n += ""))) throw Error(INVALID + "number"); + + // Determine sign. + x.s = n.charAt(0) == "-" ? ((n = n.slice(1)), -1) : 1; + + // Decimal point? + if ((e = n.indexOf(".")) > -1) n = n.replace(".", ""); + + // Exponential form? + if ((i = n.search(/e/i)) > 0) { + // Determine exponent. + if (e < 0) e = i; + e += +n.slice(i + 1); + n = n.substring(0, i); + } else if (e < 0) { + // Integer. + e = n.length; + } + + nl = n.length; + + // Determine leading zeros. + for (i = 0; i < nl && n.charAt(i) == "0"; ) ++i; + + if (i == nl) { + // Zero. + x.c = [(x.e = 0)]; + } else { + // Determine trailing zeros. + for (; nl > 0 && n.charAt(--nl) == "0"; ); + x.e = e - i - 1; + x.c = []; + + // Convert string to array of digits without leading/trailing zeros. + for (e = 0; i <= nl; ) x.c[e++] = +n.charAt(i++); + } + + return x; + } + + /* + * Round Big x to a maximum of dp decimal places using rounding mode rm. + * Called by stringify, P.div, P.round and P.sqrt. + * + * x {Big} The Big to round. + * dp {number} Integer, 0 to MAX_DP inclusive. + * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP) + * [more] {boolean} Whether the result of division was truncated. + */ + function round(x, dp, rm, more) { + var xc = x.c, + i = x.e + dp + 1; + + if (i < xc.length) { + if (rm === 1) { + // xc[i] is the digit after the digit that may be rounded up. + more = xc[i] >= 5; + } else if (rm === 2) { + more = + xc[i] > 5 || + (xc[i] == 5 && + (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1)); + } else if (rm === 3) { + more = more || !!xc[0]; + } else { + more = false; + if (rm !== 0) throw Error(INVALID_RM); + } + + if (i < 1) { + xc.length = 1; + + if (more) { + // 1, 0.1, 0.01, 0.001, 0.0001 etc. + x.e = -dp; + xc[0] = 1; + } else { + // Zero. + xc[0] = x.e = 0; + } + } else { + // Remove any digits after the required decimal places. + xc.length = i--; + + // Round up? + if (more) { + // Rounding up may mean the previous digit has to be rounded up. + for (; ++xc[i] > 9; ) { + xc[i] = 0; + if (!i--) { + ++x.e; + xc.unshift(1); + } + } + } + + // Remove trailing zeros. + for (i = xc.length; !xc[--i]; ) xc.pop(); + } + } else if (rm < 0 || rm > 3 || rm !== ~~rm) { + throw Error(INVALID_RM); + } + + return x; + } + + /* + * Return a string representing the value of Big x in normal or exponential notation. + * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf. + * + * x {Big} + * id? {number} Caller id. + * 1 toExponential + * 2 toFixed + * 3 toPrecision + * 4 valueOf + * n? {number|undefined} Caller's argument. + * k? {number|undefined} + */ + function stringify(x, id, n, k) { + var e, + s, + Big = x.constructor, + z = !x.c[0]; + + if (n !== UNDEFINED) { + if (n !== ~~n || n < (id == 3) || n > MAX_DP) { + throw Error(id == 3 ? INVALID + "precision" : INVALID_DP); + } + + x = new Big(x); + + // The index of the digit that may be rounded up. + n = k - x.e; + + // Round? + if (x.c.length > ++k) round(x, n, Big.RM); + + // toFixed: recalculate k as x.e may have changed if value rounded up. + if (id == 2) k = x.e + n + 1; + + // Append zeros? + for (; x.c.length < k; ) x.c.push(0); + } + + e = x.e; + s = x.c.join(""); + n = s.length; + + // Exponential notation? + if ( + id != 2 && + (id == 1 || (id == 3 && k <= e) || e <= Big.NE || e >= Big.PE) + ) { + s = + s.charAt(0) + + (n > 1 ? "." + s.slice(1) : "") + + (e < 0 ? "e" : "e+") + + e; + + // Normal notation. + } else if (e < 0) { + for (; ++e; ) s = "0" + s; + s = "0." + s; + } else if (e > 0) { + if (++e > n) for (e -= n; e--; ) s += "0"; + else if (e < n) s = s.slice(0, e) + "." + s.slice(e); + } else if (n > 1) { + s = s.charAt(0) + "." + s.slice(1); + } + + return x.s < 0 && (!z || id == 4) ? "-" + s : s; + } + + // Prototype/instance methods + + /* + * Return a new Big whose value is the absolute value of this Big. + */ + P.abs = function () { + var x = new this.constructor(this); + x.s = 1; + return x; + }; + + /* + * Return 1 if the value of this Big is greater than the value of Big y, + * -1 if the value of this Big is less than the value of Big y, or + * 0 if they have the same value. + */ + P.cmp = function (y) { + var isneg, + x = this, + xc = x.c, + yc = (y = new x.constructor(y)).c, + i = x.s, + j = y.s, + k = x.e, + l = y.e; + + // Either zero? + if (!xc[0] || !yc[0]) return !xc[0] ? (!yc[0] ? 0 : -j) : i; + + // Signs differ? + if (i != j) return i; + + isneg = i < 0; + + // Compare exponents. + if (k != l) return (k > l) ^ isneg ? 1 : -1; + + j = (k = xc.length) < (l = yc.length) ? k : l; + + // Compare digit by digit. + for (i = -1; ++i < j; ) { + if (xc[i] != yc[i]) return (xc[i] > yc[i]) ^ isneg ? 1 : -1; + } + + // Compare lengths. + return k == l ? 0 : (k > l) ^ isneg ? 1 : -1; + }; + + /* + * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded, + * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM. + */ + P.div = function (y) { + var x = this, + Big = x.constructor, + a = x.c, // dividend + b = (y = new Big(y)).c, // divisor + k = x.s == y.s ? 1 : -1, + dp = Big.DP; + + if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP); + + // Divisor is zero? + if (!b[0]) throw Error(DIV_BY_ZERO); + + // Dividend is 0? Return +-0. + if (!a[0]) return new Big(k * 0); + + var bl, + bt, + n, + cmp, + ri, + bz = b.slice(), + ai = (bl = b.length), + al = a.length, + r = a.slice(0, bl), // remainder + rl = r.length, + q = y, // quotient + qc = (q.c = []), + qi = 0, + d = dp + (q.e = x.e - y.e) + 1; // number of digits of the result + + q.s = k; + k = d < 0 ? 0 : d; + + // Create version of divisor with leading zero. + bz.unshift(0); + + // Add zeros to make remainder as long as divisor. + for (; rl++ < bl; ) r.push(0); + + do { + // n is how many times the divisor goes into current remainder. + for (n = 0; n < 10; n++) { + // Compare divisor and remainder. + if (bl != (rl = r.length)) { + cmp = bl > rl ? 1 : -1; + } else { + for (ri = -1, cmp = 0; ++ri < bl; ) { + if (b[ri] != r[ri]) { + cmp = b[ri] > r[ri] ? 1 : -1; + break; + } + } + } + + // If divisor < remainder, subtract divisor from remainder. + if (cmp < 0) { + // Remainder can't be more than 1 digit longer than divisor. + // Equalise lengths using divisor with extra leading zero? + for (bt = rl == bl ? b : bz; rl; ) { + if (r[--rl] < bt[rl]) { + ri = rl; + for (; ri && !r[--ri]; ) r[ri] = 9; + --r[ri]; + r[rl] += 10; + } + r[rl] -= bt[rl]; + } + + for (; !r[0]; ) r.shift(); + } else { + break; + } + } + + // Add the digit n to the result array. + qc[qi++] = cmp ? n : ++n; + + // Update the remainder. + if (r[0] && cmp) r[rl] = a[ai] || 0; + else r = [a[ai]]; + } while ((ai++ < al || r[0] !== UNDEFINED) && k--); + + // Leading zero? Do not remove if result is simply zero (qi == 1). + if (!qc[0] && qi != 1) { + // There can't be more than one zero. + qc.shift(); + q.e--; + } + + // Round? + if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED); + + return q; + }; + + /* + * Return true if the value of this Big is equal to the value of Big y, otherwise return false. + */ + P.eq = function (y) { + return !this.cmp(y); + }; + + /* + * Return true if the value of this Big is greater than the value of Big y, otherwise return + * false. + */ + P.gt = function (y) { + return this.cmp(y) > 0; + }; + + /* + * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise + * return false. + */ + P.gte = function (y) { + return this.cmp(y) > -1; + }; + + /* + * Return true if the value of this Big is less than the value of Big y, otherwise return false. + */ + P.lt = function (y) { + return this.cmp(y) < 0; + }; + + /* + * Return true if the value of this Big is less than or equal to the value of Big y, otherwise + * return false. + */ + P.lte = function (y) { + return this.cmp(y) < 1; + }; + + /* + * Return a new Big whose value is the value of this Big minus the value of Big y. + */ + P.minus = P.sub = function (y) { + var i, + j, + t, + xlty, + x = this, + Big = x.constructor, + a = x.s, + b = (y = new Big(y)).s; + + // Signs differ? + if (a != b) { + y.s = -b; + return x.plus(y); + } + + var xc = x.c.slice(), + xe = x.e, + yc = y.c, + ye = y.e; + + // Either zero? + if (!xc[0] || !yc[0]) { + // y is non-zero? x is non-zero? Or both are zero. + return yc[0] ? ((y.s = -b), y) : new Big(xc[0] ? x : 0); + } + + // Determine which is the bigger number. Prepend zeros to equalise exponents. + if ((a = xe - ye)) { + if ((xlty = a < 0)) { + a = -a; + t = xc; + } else { + ye = xe; + t = yc; + } + + t.reverse(); + for (b = a; b--; ) t.push(0); + t.reverse(); + } else { + // Exponents equal. Check digit by digit. + j = ((xlty = xc.length < yc.length) ? xc : yc).length; + + for (a = b = 0; b < j; b++) { + if (xc[b] != yc[b]) { + xlty = xc[b] < yc[b]; + break; + } + } + } + + // x < y? Point xc to the array of the bigger number. + if (xlty) { + t = xc; + xc = yc; + yc = t; + y.s = -y.s; + } + + /* + * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only + * needs to start at yc.length. + */ + if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--; ) xc[i++] = 0; + + // Subtract yc from xc. + for (b = i; j > a; ) { + if (xc[--j] < yc[j]) { + for (i = j; i && !xc[--i]; ) xc[i] = 9; + --xc[i]; + xc[j] += 10; + } + + xc[j] -= yc[j]; + } + + // Remove trailing zeros. + for (; xc[--b] === 0; ) xc.pop(); + + // Remove leading zeros and adjust exponent accordingly. + for (; xc[0] === 0; ) { + xc.shift(); + --ye; + } + + if (!xc[0]) { + // n - n = +0 + y.s = 1; + + // Result must be zero. + xc = [(ye = 0)]; + } + + y.c = xc; + y.e = ye; + + return y; + }; + + /* + * Return a new Big whose value is the value of this Big modulo the value of Big y. + */ + P.mod = function (y) { + var ygtx, + x = this, + Big = x.constructor, + a = x.s, + b = (y = new Big(y)).s; + + if (!y.c[0]) throw Error(DIV_BY_ZERO); + + x.s = y.s = 1; + ygtx = y.cmp(x) == 1; + x.s = a; + y.s = b; + + if (ygtx) return new Big(x); + + a = Big.DP; + b = Big.RM; + Big.DP = Big.RM = 0; + x = x.div(y); + Big.DP = a; + Big.RM = b; + + return this.minus(x.times(y)); + }; + + /* + * Return a new Big whose value is the value of this Big plus the value of Big y. + */ + P.plus = P.add = function (y) { + var t, + x = this, + Big = x.constructor, + a = x.s, + b = (y = new Big(y)).s; + + // Signs differ? + if (a != b) { + y.s = -b; + return x.minus(y); + } + + var xe = x.e, + xc = x.c, + ye = y.e, + yc = y.c; + + // Either zero? y is non-zero? x is non-zero? Or both are zero. + if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0); + + xc = xc.slice(); + + // Prepend zeros to equalise exponents. + // Note: reverse faster than unshifts. + if ((a = xe - ye)) { + if (a > 0) { + ye = xe; + t = yc; + } else { + a = -a; + t = xc; + } + + t.reverse(); + for (; a--; ) t.push(0); + t.reverse(); + } + + // Point xc to the longer array. + if (xc.length - yc.length < 0) { + t = yc; + yc = xc; + xc = t; + } + + a = yc.length; + + // Only start adding at yc.length - 1 as the further digits of xc can be left as they are. + for (b = 0; a; xc[a] %= 10) b = ((xc[--a] = xc[a] + yc[a] + b) / 10) | 0; + + // No need to check for zero, as +x + +y != 0 && -x + -y != 0 + + if (b) { + xc.unshift(b); + ++ye; + } + + // Remove trailing zeros. + for (a = xc.length; xc[--a] === 0; ) xc.pop(); + + y.c = xc; + y.e = ye; + + return y; + }; + + /* + * Return a Big whose value is the value of this Big raised to the power n. + * If n is negative, round to a maximum of Big.DP decimal places using rounding + * mode Big.RM. + * + * n {number} Integer, -MAX_POWER to MAX_POWER inclusive. + */ + P.pow = function (n) { + var x = this, + one = new x.constructor(1), + y = one, + isneg = n < 0; + + if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) + throw Error(INVALID + "exponent"); + if (isneg) n = -n; + + for (;;) { + if (n & 1) y = y.times(x); + n >>= 1; + if (!n) break; + x = x.times(x); + } + + return isneg ? one.div(y) : y; + }; + + /* + * Return a new Big whose value is the value of this Big rounded using rounding mode rm + * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a + * multiple of 10**-dp. + * If dp is not specified, round to 0 decimal places. + * If rm is not specified, use Big.RM. + * + * dp? {number} Integer, -MAX_DP to MAX_DP inclusive. + * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP) + */ + P.round = function (dp, rm) { + var Big = this.constructor; + if (dp === UNDEFINED) dp = 0; + else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) + throw Error(INVALID_DP); + return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm); + }; + + /* + * Return a new Big whose value is the square root of the value of this Big, rounded, if + * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM. + */ + P.sqrt = function () { + var r, + c, + t, + x = this, + Big = x.constructor, + s = x.s, + e = x.e, + half = new Big(0.5); + + // Zero? + if (!x.c[0]) return new Big(x); + + // Negative? + if (s < 0) throw Error(NAME + "No square root"); + + // Estimate. + s = Math.sqrt(x + ""); + + // Math.sqrt underflow/overflow? + // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent. + if (s === 0 || s === 1 / 0) { + c = x.c.join(""); + if (!((c.length + e) & 1)) c += "0"; + s = Math.sqrt(c); + e = (((e + 1) / 2) | 0) - (e < 0 || e & 1); + r = new Big( + (s == 1 / 0 + ? "1e" + : (s = s.toExponential()).slice(0, s.indexOf("e") + 1)) + e + ); + } else { + r = new Big(s); + } + + e = r.e + (Big.DP += 4); + + // Newton-Raphson iteration. + do { + t = r; + r = half.times(t.plus(x.div(t))); + } while (t.c.slice(0, e).join("") !== r.c.slice(0, e).join("")); + + return round(r, (Big.DP -= 4), Big.RM); + }; + + /* + * Return a new Big whose value is the value of this Big times the value of Big y. + */ + P.times = P.mul = function (y) { + var c, + x = this, + Big = x.constructor, + xc = x.c, + yc = (y = new Big(y)).c, + a = xc.length, + b = yc.length, + i = x.e, + j = y.e; + + // Determine sign of result. + y.s = x.s == y.s ? 1 : -1; + + // Return signed 0 if either 0. + if (!xc[0] || !yc[0]) return new Big(y.s * 0); + + // Initialise exponent of result as x.e + y.e. + y.e = i + j; + + // If array xc has fewer digits than yc, swap xc and yc, and lengths. + if (a < b) { + c = xc; + xc = yc; + yc = c; + j = a; + a = b; + b = j; + } + + // Initialise coefficient array of result with zeros. + for (c = new Array((j = a + b)); j--; ) c[j] = 0; + + // Multiply. + + // i is initially xc.length. + for (i = b; i--; ) { + b = 0; + + // a is yc.length. + for (j = a + i; j > i; ) { + // Current sum of products at this digit position, plus carry. + b = c[j] + yc[i] * xc[j - i - 1] + b; + c[j--] = b % 10; + + // carry + b = (b / 10) | 0; + } + + c[j] = (c[j] + b) % 10; + } + + // Increment result exponent if there is a final carry, otherwise remove leading zero. + if (b) ++y.e; + else c.shift(); + + // Remove trailing zeros. + for (i = c.length; !c[--i]; ) c.pop(); + y.c = c; + + return y; + }; + + /* + * Return a string representing the value of this Big in exponential notation to dp fixed decimal + * places and rounded using Big.RM. + * + * dp? {number} Integer, 0 to MAX_DP inclusive. + */ + P.toExponential = function (dp) { + return stringify(this, 1, dp, dp); + }; + + /* + * Return a string representing the value of this Big in normal notation to dp fixed decimal + * places and rounded using Big.RM. + * + * dp? {number} Integer, 0 to MAX_DP inclusive. + * + * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'. + * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'. + */ + P.toFixed = function (dp) { + return stringify(this, 2, dp, this.e + dp); + }; + + /* + * Return a string representing the value of this Big rounded to sd significant digits using + * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent + * the integer part of the value in normal notation. + * + * sd {number} Integer, 1 to MAX_DP inclusive. + */ + P.toPrecision = function (sd) { + return stringify(this, 3, sd, sd - 1); + }; + + /* + * Return a string representing the value of this Big. + * Return exponential notation if this Big has a positive exponent equal to or greater than + * Big.PE, or a negative exponent equal to or less than Big.NE. + * Omit the sign for negative zero. + */ + P.toString = function () { + return stringify(this); + }; + + /* + * Return a string representing the value of this Big. + * Return exponential notation if this Big has a positive exponent equal to or greater than + * Big.PE, or a negative exponent equal to or less than Big.NE. + * Include the sign for negative zero. + */ + P.valueOf = P.toJSON = function () { + return stringify(this, 4); + }; + + // Export + + Big = _Big_(); + + Big["default"] = Big.Big = Big; + + //AMD. + if (typeof define === "function" && define.amd) { + define(function () { + return Big; + }); + + // Node and other CommonJS-like environments that support module.exports. + } else if (typeof module !== "undefined" && module.exports) { + module.exports = Big; + + //Browser. + } else { + GLOBAL.Big = Big; + } +})(this); diff --git a/src/api/business/inspectionTask.js b/src/api/business/inspectionTask.js index d8704f6..b26a992 100644 --- a/src/api/business/inspectionTask.js +++ b/src/api/business/inspectionTask.js @@ -1,3 +1,4 @@ +// 妫�楠屼换鍔$浉鍏虫帴鍙� import request from "@/utils/request"; // 閫氳繃妫�楠屽崟鏌ヨ妫�楠屾暟鎹紙鏁版嵁鏌ョ湅锛� @@ -269,3 +270,12 @@ params: query, }); } + +// 妫�楠屽崟璇︽儏-浠诲姟鍒囨崲 +export function inspectionOrderDetailsTaskSwitching(query) { + return request({ + url: "/insOrderPlan/inspectionOrderDetailsTaskSwitching", + method: "get", + params: query, + }); +} diff --git a/src/api/business/unpass.js b/src/api/business/unpass.js new file mode 100644 index 0000000..7803d75 --- /dev/null +++ b/src/api/business/unpass.js @@ -0,0 +1,75 @@ +// 涓嶅悎鏍肩鐞嗙浉鍏虫帴鍙� + +import request from "@/utils/request"; + +//鏌ヨ杩涜揣楠岃瘉淇℃伅 +export function getFactoryVerify(query) { + return request({ + url: "/insOrderPlan/getFactoryVerify", + method: "get", + params: query, + }); +} + +// 淇濆瓨杩涜揣鍘熷璁板綍 +export function addFactoryVerify(data) { + return request({ + url: "/insOrderPlan/addFactoryVerify", + method: "post", + data: data, + }); +} + +//鏌ヨ涓嶅悎鏍肩殑妫�楠岄」 +export function getInsProductUnqualified(query) { + return request({ + url: "/insOrderPlan/getInsProductUnqualified", + method: "get", + params: query, + }); +} + +// 鎻愪氦闇�瑕佸娴嬬殑妫�楠岄」 +export function addUnqualifiedRetest(data) { + return request({ + url: "/insOrderPlan/addUnqualifiedRetest", + method: "post", + data: data, + }); +} + +// 鏌ヨ妫�楠屼笅鍗曞唴瀹硅鎯� +export function getInsOrder(query) { + return request({ + url: "/insOrder/getInsOrder", + method: "get", + params: query, + }); +} + +// 鏌ョ湅OA璇︽儏 +export function getUnqualifiedHandler(query) { + return request({ + url: "/unqualifiedHandler/getUnqualifiedHandler", + method: "get", + params: query, + }); +} + +// 涓嬭浇OA闄勪欢 +export function downFile(query) { + return request({ + url: "/unqualifiedHandler/downFile", + method: "get", + params: query, + }); +} + +// 鎻愪氦涓嶅悎鏍煎鐞� +export function addUnqualifiedHandler(data) { + return request({ + url: "/unqualifiedHandler/addUnqualifiedHandler", + method: "post", + data: data, + }); +} diff --git a/src/api/cnas/process/method/standardMethod.js b/src/api/cnas/process/method/standardMethod.js index 737e740..0d64b8b 100644 --- a/src/api/cnas/process/method/standardMethod.js +++ b/src/api/cnas/process/method/standardMethod.js @@ -1,3 +1,4 @@ +// 瀹為獙瀹ょ殑妫�娴嬭兘鍔涙。妗堢浉鍏虫帴鍙� import request from "@/utils/request"; //鑾峰彇鏍囧噯鏂规硶鍒楄〃 diff --git a/src/api/performance/class.js b/src/api/performance/class.js index b61e395..8555eb1 100644 --- a/src/api/performance/class.js +++ b/src/api/performance/class.js @@ -1,3 +1,5 @@ +// 鐝鐩稿叧鎺ュ彛 + import request from "@/utils/request"; // 缁╂晥绠$悊-鐝-鍒嗛〉鏌ヨ diff --git a/src/api/performance/manHour.js b/src/api/performance/manHour.js index 4ba20ae..2c9d05c 100644 --- a/src/api/performance/manHour.js +++ b/src/api/performance/manHour.js @@ -1,3 +1,5 @@ +// 宸ユ椂绠$悊鐩稿叧鎺ュ彛 + import request from "@/utils/request"; // 鏌ヨ宸ユ椂姹囨�� diff --git a/src/api/standard/model.js b/src/api/standard/model.js index 5bbe405..cf85e09 100644 --- a/src/api/standard/model.js +++ b/src/api/standard/model.js @@ -1,3 +1,5 @@ +// 鍘熷璁板綍妯℃澘鐩稿叧鎺ュ彛 + import request from "@/utils/request"; // 鏌ヨ瀹㈡埛鍒楄〃 diff --git a/src/api/standard/standardLibrary.js b/src/api/standard/standardLibrary.js index 184ee68..ad374ed 100644 --- a/src/api/standard/standardLibrary.js +++ b/src/api/standard/standardLibrary.js @@ -1,3 +1,5 @@ +// 鏍囧噯搴撶浉鍏虫帴鍙� + import request from "@/utils/request"; // 鏍囧噯搴撴爲鎺掑簭 diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue index 2f12565..725f320 100644 --- a/src/components/Table/lims-table.vue +++ b/src/components/Table/lims-table.vue @@ -1,82 +1,29 @@ <template> <div> <!-- 琛ㄦ牸 --> - <el-table - ref="multipleTable" - v-loading="tableLoading" - :border="border" - :data="tableData" - :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" - :height="height" - :highlight-current-row="highlightCurrentRow" - :row-class-name="rowClassName" - :row-style="rowStyle" - :row-key="rowKey" - :span-method="spanMethod" - stripe - style="width: 100%" - tooltip-effect="dark" - @row-click="rowClick" - @current-change="currentChange" - @selection-change="handleSelectionChange" - > - <el-table-column - align="center" - type="selection" - width="55" - v-if="isSelection" - /> - <el-table-column - align="center" - label="搴忓彿" - type="index" - width="60" - :index="indexMethod" - /> + <el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData" + :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" :height="height" + :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle" + :row-key="rowKey" :span-method="spanMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick" + @current-change="currentChange" @selection-change="handleSelectionChange"> + <el-table-column align="center" type="selection" width="55" v-if="isSelection" /> + <el-table-column align="center" label="搴忓彿" type="index" width="60" :index="indexMethod" /> - <el-table-column - v-for="(item, index) in column" - :key="index" - :column-key="item.columnKey" - :filter-method="item.filterHandler" - :filter-multiple="item.filterMultiple" - :filtered-value="item.filteredValue" - :filters="item.filters" - :fixed="item.fixed" - :label="item.label" - :min-width="item.minWidth" - :prop="item.prop" - :show-overflow-tooltip="item.dataType === 'action' ? false : true" - :sortable="item.sortable ? true : false" - :type="item.type" - :width=" - item.dataType === 'action' ? getWidth(item.operation) : item.width - " - align="center" - > + <el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey" + :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue" + :filters="item.filters" :fixed="item.fixed" :label="item.label" :min-width="item.minWidth" :prop="item.prop" + :show-overflow-tooltip="item.dataType === 'action' ? false : true" :sortable="item.sortable ? true : false" + :type="item.type" :width="item.dataType === 'action' ? getWidth(item.operation) : item.width + " align="center"> <!-- <div class="123" v-if="item.type == ''"> --> - <template - v-if="item.hasOwnProperty('colunmTemplate')" - :slot="item.colunmTemplate" - slot-scope="scope" - > - <slot - v-if="item.theadSlot" - :index="index" - :name="item.theadSlot" - :row="scope.row" - /> + <template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope"> + <slot v-if="item.theadSlot" :index="index" :name="item.theadSlot" :row="scope.row" /> </template> <template slot-scope="scope"> <!-- 鎻掓Ы --> <div v-if="item.dataType == 'slot'"> - <slot - v-if="item.slot" - :index="scope.$index" - :name="item.slot" - :row="scope.row" - /> + <slot v-if="item.slot" :index="scope.$index" :name="item.slot" :row="scope.row" /> </div> <!-- 杩涘害鏉� --> <div v-else-if="item.dataType == 'progress'"> @@ -84,107 +31,61 @@ </div> <!-- 鍥剧墖 --> <div v-else-if="item.dataType == 'image'"> - <img - :src="javaApi + '/img/' + item.prop" - alt="" - style="width: 40px; height: 40px; margin-top: 10px" - /> + <img :src="javaApi + '/img/' + item.prop" alt="" style="width: 40px; height: 40px; margin-top: 10px" /> </div> <!-- tag --> <div v-else-if="item.dataType == 'tag'"> - <el-tag - v-if=" - typeof dataTypeFn(scope.row[item.prop], item.formatData) == - 'string' - " - :title="scope.row[item.prop] | formatters(item.formatData)" - :type="formatType(scope.row[item.prop], item.formatType)" - >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag - > - <el-tag - v-for="(tag, index) in dataTypeFn( - scope.row[item.prop], - item.formatData - )" - v-else-if=" - typeof dataTypeFn(scope.row[item.prop], item.formatData) == - 'object' - " - :key="index" - :title="scope.row[item.prop] | formatters(item.formatData)" - :type="formatType(tag, item.formatType)" - >{{ + <el-tag v-if=" + typeof dataTypeFn(scope.row[item.prop], item.formatData) == + 'string' + " :title="scope.row[item.prop] | formatters(item.formatData)" + :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] | + formatters(item.formatData) }}</el-tag> + <el-tag v-for="(tag, index) in dataTypeFn( + scope.row[item.prop], + item.formatData + )" v-else-if=" + typeof dataTypeFn(scope.row[item.prop], item.formatData) == + 'object' + " :key="index" :title="scope.row[item.prop] | formatters(item.formatData)" + :type="formatType(tag, item.formatType)">{{ item.tagGroup ? tag[item.tagGroup.label] ? tag[item.tagGroup.label] : tag : tag - }}</el-tag - > - <el-tag - v-else - :title="scope.row[item.prop] | formatters(item.formatData)" - :type="formatType(scope.row[item.prop], item.formatType)" - >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag - > + }}</el-tag> + <el-tag v-else :title="scope.row[item.prop] | formatters(item.formatData)" + :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] | + formatters(item.formatData) }}</el-tag> </div> <!-- 鎸夐挳 --> <div v-else-if="item.dataType == 'action'"> <template v-for="(o, key) in item.operation"> - <el-button - v-if="o.type != 'upload'" - size="mini" - v-show="o.showHide ? o.showHide(scope.row) : true" - :disabled="o.disabled ? o.disabled(scope.row) : false" - :icon="iconFn(o)" - :plain="o.plain" - :style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }" - :type="o.type | typeFn(scope.row)" - @click="o.clickFun(scope.row)" - :key="key" - > + <el-button v-if="o.type != 'upload'" size="mini" v-show="o.showHide ? o.showHide(scope.row) : true" + :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain" + :style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)" + @click="o.clickFun(scope.row)" :key="key"> {{ o.name }} </el-button> - <el-upload - action="#" - size="mini" - :on-change=" - (file, fileList) => o.clickFun(scope.row, file, fileList) - " - :multiple="o.multiple ? o.multiple : false" - :limit="o.limit ? o.limit : 1" - :disabled="o.disabled ? o.disabled(scope.row) : false" - :accept=" - o.accept - ? o.accept - : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' - " - v-if="o.type == 'upload'" - style="display: inline-block; width: 50px" - v-show="o.showHide ? o.showHide(scope.row) : true" - :auto-upload="false" - :on-exceed="onExceed" - :show-file-list="false" - :key="key" - > - <el-button - :size="o.size ? o.size : 'small'" - type="text" - :disabled="o.disabled ? o.disabled(scope.row) : false" - >{{ o.name }}</el-button - > + <el-upload action="#" size="mini" :on-change="(file, fileList) => o.clickFun(scope.row, file, fileList) + " :multiple="o.multiple ? o.multiple : false" :limit="o.limit ? o.limit : 1" + :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept + ? o.accept + : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' + " v-if="o.type == 'upload'" style="display: inline-block; width: 50px" + v-show="o.showHide ? o.showHide(scope.row) : true" :auto-upload="false" :on-exceed="onExceed" + :show-file-list="false" :key="key"> + <el-button :size="o.size ? o.size : 'small'" type="text" + :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button> </el-upload> </template> </div> <!-- 鍙偣鍑荤殑鏂囧瓧 --> - <div - v-else-if="item.dataType == 'link'" - class="cell link" - style="width: 100%" - @click="goLink(scope.row, item.linkMethod)" - > + <div v-else-if="item.dataType == 'link'" class="cell link" style="width: 100%" + @click="goLink(scope.row, item.linkMethod)"> <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> </div> <!-- 榛樿绾睍绀烘暟鎹� --> @@ -197,14 +98,8 @@ </template> </el-table-column> </el-table> - <pagination - v-show="page.total > 0" - :total="page.total" - :layout="page.layout" - :page.sync="page.current" - :limit.sync="page.size" - @pagination="pagination" - /> + <pagination v-show="page.total > 0" :total="page.total" :layout="page.layout" :page.sync="page.current" + :limit.sync="page.size" @pagination="pagination" /> </div> </template> @@ -294,19 +189,19 @@ handleSelectionChange: { type: Function, default: () => { - return () => {}; + return () => { }; }, }, rowClick: { type: Function, default: () => { - return () => {}; + return () => { }; }, }, currentChange: { type: Function, default: () => { - return () => {}; + return () => { }; }, }, border: { @@ -331,11 +226,11 @@ }, rowClassName: { type: Function, - default: () => {}, + default: () => { }, }, rowStyle: { type: Object || Function, - default: () => {}, + default: () => { }, }, tableData: { type: Array, @@ -506,13 +401,14 @@ </script> <style scoped> -.el-table >>> .el-table__empty-text { +.el-table>>>.el-table__empty-text { text-align: center; } ->>> .cell { +>>>.cell { padding: 0 !important; } + .cell { white-space: nowrap; overflow: hidden; @@ -520,11 +416,14 @@ padding-right: 4px !important; padding-left: 10px !important; } + .link { color: rgb(64, 158, 255); cursor: pointer; } ->>> .el-table__body-wrapper::-webkit-scrollbar { - height: 14px; /* 璁剧疆婊氬姩鏉″搴� */ + +>>>.el-table__body-wrapper::-webkit-scrollbar { + height: 14px; + /* 璁剧疆婊氬姩鏉″搴� */ } </style> diff --git a/src/router/index.js b/src/router/index.js index 298860f..f6b55c0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -101,17 +101,21 @@ children: [ { // 鍘熸潗鏂欎笅鍗� - path: 'customsInspection', - component: () => import('@/views/business/materialOrder/customsInspection'), - name: 'customsInspection', - meta: { title: '鍘熸潗鏂欎笅鍗曡鎯�', activeMenu: '/business/materialOrder' } + path: "customsInspection", + component: () => + import("@/views/business/materialOrder/customsInspection"), + name: "customsInspection", + meta: { + title: "鍘熸潗鏂欎笅鍗曡鎯�", + activeMenu: "/business/materialOrder", + }, }, { // 閾滄潗鏂欎笅鍗� - path: 'copperOrder', - component: () => import('@/views/business/materialOrder/copperOrder'), - name: 'copperOrder', - meta: { title: '閾滄潗鏂欎笅鍗�', activeMenu: '/business/materialOrder' } + path: "copperOrder", + component: () => import("@/views/business/materialOrder/copperOrder"), + name: "copperOrder", + meta: { title: "閾滄潗鏂欎笅鍗�", activeMenu: "/business/materialOrder" }, }, ], }, diff --git a/src/utils/request.js b/src/utils/request.js index ffb0d21..1a89ee8 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,114 +1,148 @@ -import axios from 'axios' -import { Notification, MessageBox, Message, Loading } from 'element-ui' -import store from '@/store' -import { getToken } from '@/utils/auth' -import errorCode from '@/utils/errorCode' +import axios from "axios"; +import { Notification, MessageBox, Message, Loading } from "element-ui"; +import store from "@/store"; +import { getToken } from "@/utils/auth"; +import errorCode from "@/utils/errorCode"; import { tansParams, blobValidate } from "@/utils/ruoyi"; -import cache from '@/plugins/cache' -import { saveAs } from 'file-saver' +import cache from "@/plugins/cache"; +import { saveAs } from "file-saver"; let downloadLoadingInstance; // 鏄惁鏄剧ず閲嶆柊鐧诲綍 export let isRelogin = { show: false }; -axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8"; // 鍒涘缓axios瀹炰緥 const service = axios.create({ // axios涓姹傞厤缃湁baseURL閫夐」锛岃〃绀鸿姹俇RL鍏叡閮ㄥ垎 baseURL: process.env.VUE_APP_BASE_API, // 瓒呮椂 - timeout: 10000 -}) + timeout: 10000 * 60, +}); // request鎷︽埅鍣� -service.interceptors.request.use(config => { - // 鏄惁闇�瑕佽缃� token - const isToken = (config.headers || {}).isToken === false - // 鏄惁闇�瑕侀槻姝㈡暟鎹噸澶嶆彁浜� - const isRepeatSubmit = (config.headers || {}).repeatSubmit === false - if (getToken() && !isToken) { - config.headers['Authorization'] = 'Bearer ' + getToken() // 璁╂瘡涓姹傛惡甯﹁嚜瀹氫箟token 璇锋牴鎹疄闄呮儏鍐佃嚜琛屼慨鏀� - } - // get璇锋眰鏄犲皠params鍙傛暟 - if (config.method === 'get' && config.params) { - let url = config.url + '?' + tansParams(config.params); - url = url.slice(0, -1); - config.params = {}; - config.url = url; - } - if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { - const requestObj = { - url: config.url, - data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, - time: new Date().getTime() +service.interceptors.request.use( + (config) => { + // 鏄惁闇�瑕佽缃� token + const isToken = (config.headers || {}).isToken === false; + // 鏄惁闇�瑕侀槻姝㈡暟鎹噸澶嶆彁浜� + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false; + if (getToken() && !isToken) { + config.headers["Authorization"] = "Bearer " + getToken(); // 璁╂瘡涓姹傛惡甯﹁嚜瀹氫箟token 璇锋牴鎹疄闄呮儏鍐佃嚜琛屼慨鏀� } - const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 璇锋眰鏁版嵁澶у皬 - const limitSize = 5 * 1024 * 1024; // 闄愬埗瀛樻斁鏁版嵁5M - if (requestSize >= limitSize) { - console.warn(`[${config.url}]: ` + '璇锋眰鏁版嵁澶у皬瓒呭嚭鍏佽鐨�5M闄愬埗锛屾棤娉曡繘琛岄槻閲嶅鎻愪氦楠岃瘉銆�') - return config; + // get璇锋眰鏄犲皠params鍙傛暟 + if (config.method === "get" && config.params) { + let url = config.url + "?" + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; } - const sessionObj = cache.session.getJSON('sessionObj') - if (sessionObj === undefined || sessionObj === null || sessionObj === '') { - cache.session.setJSON('sessionObj', requestObj) - } else { - const s_url = sessionObj.url; // 璇锋眰鍦板潃 - const s_data = sessionObj.data; // 璇锋眰鏁版嵁 - const s_time = sessionObj.time; // 璇锋眰鏃堕棿 - const interval = 1000; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦 - if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { - const message = '鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�'; - console.warn(`[${s_url}]: ` + message) - return Promise.reject(new Error(message)) + if ( + !isRepeatSubmit && + (config.method === "post" || config.method === "put") + ) { + const requestObj = { + url: config.url, + data: + typeof config.data === "object" + ? JSON.stringify(config.data) + : config.data, + time: new Date().getTime(), + }; + const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 璇锋眰鏁版嵁澶у皬 + const limitSize = 5 * 1024 * 1024; // 闄愬埗瀛樻斁鏁版嵁5M + if (requestSize >= limitSize) { + console.warn( + `[${config.url}]: ` + + "璇锋眰鏁版嵁澶у皬瓒呭嚭鍏佽鐨�5M闄愬埗锛屾棤娉曡繘琛岄槻閲嶅鎻愪氦楠岃瘉銆�" + ); + return config; + } + const sessionObj = cache.session.getJSON("sessionObj"); + if ( + sessionObj === undefined || + sessionObj === null || + sessionObj === "" + ) { + cache.session.setJSON("sessionObj", requestObj); } else { - cache.session.setJSON('sessionObj', requestObj) + const s_url = sessionObj.url; // 璇锋眰鍦板潃 + const s_data = sessionObj.data; // 璇锋眰鏁版嵁 + const s_time = sessionObj.time; // 璇锋眰鏃堕棿 + const interval = 1000; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦 + if ( + s_data === requestObj.data && + requestObj.time - s_time < interval && + s_url === requestObj.url + ) { + const message = "鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�"; + console.warn(`[${s_url}]: ` + message); + return Promise.reject(new Error(message)); + } else { + cache.session.setJSON("sessionObj", requestObj); + } } } + return config; + }, + (error) => { + console.log(error); + Promise.reject(error); } - return config -}, error => { - console.log(error) - Promise.reject(error) -}) +); // 鍝嶅簲鎷︽埅鍣� -service.interceptors.response.use(res => { +service.interceptors.response.use( + (res) => { // 鏈缃姸鎬佺爜鍒欓粯璁ゆ垚鍔熺姸鎬� const code = res.data.code || 200; // 鑾峰彇閿欒淇℃伅 - const msg = errorCode[code] || res.data.msg || errorCode['default'] + const msg = errorCode[code] || res.data.msg || errorCode["default"]; // 浜岃繘鍒舵暟鎹垯鐩存帴杩斿洖 - if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { - return res.data + if ( + res.request.responseType === "blob" || + res.request.responseType === "arraybuffer" + ) { + return res.data; } if (code === 401) { if (!isRelogin.show) { isRelogin.show = true; - MessageBox.confirm('鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�', '绯荤粺鎻愮ず', { confirmButtonText: '閲嶆柊鐧诲綍', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - isRelogin.show = false; - store.dispatch('LogOut').then(() => { - location.href = '/index'; + MessageBox.confirm( + "鐧诲綍鐘舵�佸凡杩囨湡锛屾偍鍙互缁х画鐣欏湪璇ラ〉闈紝鎴栬�呴噸鏂扮櫥褰�", + "绯荤粺鎻愮ず", + { + confirmButtonText: "閲嶆柊鐧诲綍", + cancelButtonText: "鍙栨秷", + type: "warning", + } + ) + .then(() => { + isRelogin.show = false; + store.dispatch("LogOut").then(() => { + location.href = "/index"; + }); }) - }).catch(() => { - isRelogin.show = false; - }); - } - return Promise.reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�') + .catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject("鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�"); } else if (code === 500) { - Message({ message: msg, type: 'error' }) - return Promise.reject(new Error(msg)) + Message({ message: msg, type: "error" }); + return Promise.reject(new Error(msg)); } else if (code === 601) { - Message({ message: msg, type: 'warning' }) - return Promise.reject('error') + Message({ message: msg, type: "warning" }); + return Promise.reject("error"); } else if (code !== 200) { - Notification.error({ title: msg }) - return Promise.reject('error') + Notification.error({ title: msg }); + return Promise.reject("error"); } else { - return res.data + return res.data; } }, - error => { - console.log('err' + error) + (error) => { + console.log("err" + error); let { message } = error; if (message == "Network Error") { message = "鍚庣鎺ュ彛杩炴帴寮傚父"; @@ -117,36 +151,48 @@ } else if (message.includes("Request failed with status code")) { message = "绯荤粺鎺ュ彛" + message.substr(message.length - 3) + "寮傚父"; } - Message({ message: message, type: 'error', duration: 5 * 1000 }) - return Promise.reject(error) + Message({ message: message, type: "error", duration: 5 * 1000 }); + return Promise.reject(error); } -) +); // 閫氱敤涓嬭浇鏂规硶 export function download(url, params, filename, config) { - downloadLoadingInstance = Loading.service({ text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) - return service.post(url, params, { - transformRequest: [(params) => { return tansParams(params) }], - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - responseType: 'blob', - ...config - }).then(async (data) => { - const isBlob = blobValidate(data); - if (isBlob) { - const blob = new Blob([data]) - saveAs(blob, filename) - } else { - const resText = await data.text(); - const rspObj = JSON.parse(resText); - const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] - Message.error(errMsg); - } - downloadLoadingInstance.close(); - }).catch((r) => { - console.error(r) - Message.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒') - downloadLoadingInstance.close(); - }) + downloadLoadingInstance = Loading.service({ + text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + return service + .post(url, params, { + transformRequest: [ + (params) => { + return tansParams(params); + }, + ], + headers: { "Content-Type": "application/x-www-form-urlencoded" }, + responseType: "blob", + ...config, + }) + .then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]); + saveAs(blob, filename); + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = + errorCode[rspObj.code] || rspObj.msg || errorCode["default"]; + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }) + .catch((r) => { + console.error(r); + Message.error("涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒"); + downloadLoadingInstance.close(); + }); } -export default service +export default service; diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue index 6dccaa2..c9639da 100644 --- a/src/views/business/inspectionTask/index.vue +++ b/src/views/business/inspectionTask/index.vue @@ -89,7 +89,7 @@ </style> <template> <div class="ins-order-plan-main"> - <div v-show="activeFace == 0" style="height: 100%"> + <div style="height: 100%"> <div class="search"> <div class="search_thing"> <div class="search_label">濮旀墭缂栧彿锛�</div> @@ -178,31 +178,6 @@ <el-button :loading="loading" type="primary" @click="confirmConnect">纭� 瀹�</el-button> </span> </el-dialog> - <div v-if="activeFace > 0 && isCopper == null" style="width: 100%; height: 100%"> - <!-- <Add :active="activeFace" :currentId="currentId" :examine="examine" /> --> - </div> - <div v-if="activeFace > 0 && isCopper == 0" style="width: 100%; height: 100%"> - <!-- <CustomsInspection - :active="activeFace" - :currentId="currentId" - :customsInspection="customsInspection" - :isReport="isReport" - /> --> - </div> - <div v-if="activeFace > 0 && isCopper == 1" style="width: 100%; height: 100%"> - <!-- <CopperOrder :active="activeFace" :currentId="currentId"></CopperOrder> --> - </div> - <!--<Inspection - v-if="state > 0" - :key="InspectionKey" - :inspectorList="inspectorList" - :orderId="orderId" - :sonLaboratory="sonLaboratory" - :state="state" - :typeSource="typeSource" - @goback="goback" - @refreshView="refreshView" - />--> <el-dialog :visible.sync="dataDialogVisible" title="鏁版嵁鏌ョ湅" width="80%"> <div v-if="dataDialogVisible" style="height: 70vh; overflow-y: auto"> <lims-table :tableData="lookTableData" :column="lookColumn" :page="lookPage" :tableLoading="lookTableLoading" @@ -261,13 +236,7 @@ </template> <script> -import ValueTable from "@/components/Table/value-table.vue"; -// import Inspection from "../do/b1-inspect-order-plan/Inspection.vue"; -// import CustomsInspection from "../do/b1-material-ins-order/customs-inspection.vue"; import { getYearAndMonthAndDays } from "@/utils/date"; -// import Add from "../do/b1-ins-order/add.vue"; -// import ShowInfo from "../do/b1-material-ins-order/showInfo.vue"; -// import CopperOrder from "../do/b1-material-ins-order/copper-order.vue"; import EditInspectionItem from "./components/EditInspectionItem.vue"; import limsTable from "@/components/Table/lims-table.vue"; import { @@ -286,13 +255,7 @@ export default { components: { EditInspectionItem, - // CopperOrder, - // ShowInfo, - ValueTable, limsTable, - // Inspection, - // Add, - // CustomsInspection, }, dicts: ["urgency_level", "inspection_task_state"], computed: { @@ -384,14 +347,15 @@ { label: "濮旀墭缂栧彿", prop: "entrustCode", - width: "140px", + width: "160px", dataType: "link", linkMethod: "selectAllByOne", }, - { label: "鏍峰搧鍚嶇О", prop: "sample", width: "140px" }, + { label: "鏍峰搧鍚嶇О", prop: "sample", width: "160px" }, { label: "涓嬪崟绫诲埆", prop: "typeSource", + width: "100px", dataType: "tag", formatData: (params) => { if (params == 0) { @@ -413,6 +377,7 @@ { label: "妫�楠岀被鍨�", prop: "orderType", + width: "100px", dataType: "tag", formatData: (params) => { return this.orderTypeList.find((m) => m.value == params).label; @@ -794,6 +759,39 @@ this.examine = 1; this.isReport = 0; this.currentId = parseInt(row.id); + switch (row.isCopper) { + case 0: + // 鍘熸潗鏂� + this.$router.push({ + path: "/materialOrder/customsInspection", query: { + customsInspection: row, + active: this.activeFace, + currentId: this.currentId, + isReport: this.isReport + } + }); + break; + case null: + // 鎴愬搧 + this.$router.push({ + path: "/productOrder/add", query: { + examine: this.examine, + active: this.activeFace, + currentId: this.currentId + } + }); + break; + case 1: + // 閾滄潗 + this.$router.push({ + path: "/materialOrder/copperOrder", query: { + active: this.activeFace, + currentId: this.currentId + } + }); + break; + } + }, playOrder(num) { this.activeFace = num; @@ -843,6 +841,16 @@ this.state = 3; this.typeSource = row.typeSource; this.orderId = row.id; + this.$router.push({ + path: "/inspectionTask/inspection", + query: { + inspectorList: this.inspectorList, + sonLaboratory: this.sonLaboratory, + state: this.state, + typeSource: this.typeSource, + orderId: this.orderId, + }, + }); }, handleConnect(row) { this.orderId = row.id; diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue index f6c7d33..0ed826a 100644 --- a/src/views/business/inspectionTask/inspection.vue +++ b/src/views/business/inspectionTask/inspection.vue @@ -1,9 +1,7 @@ <template> - <div v-loading="loading" class="inspection"> + <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);"> <el-row class="title"> - <el-col :span="4" style="padding-left: 20px; text-align: left">妫�楠屽崟璇︽儏 - </el-col> - <el-col :span="20" style="text-align: right"> + <el-col :span="8" style="text-align: left"> <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" style="text-align: right; padding-top: 0; display: inline"> <el-form-item label="娓╁害:" style="margin-bottom: 0"> @@ -17,6 +15,8 @@ <span style="margin-left: 4px">%</span> </el-form-item> </el-form> + </el-col> + <el-col :span="16" style="text-align: right"> <el-button size="small" type="primary" @click="refreshView">鍒锋柊</el-button> <el-button v-if="typeSource === 1" size="small" type="primary" @click="openPurchase">杩涜揣楠岃瘉</el-button> <el-button v-if="state === 1 && typeSource === 1" size="small" type="primary" @@ -31,7 +31,7 @@ <el-button v-if="state == 2" size="medium" type="primary" @click="openAddCheck">閫氳繃</el-button> <el-button v-if="state == 2" size="medium" @click="upInsReview(0)">涓嶉�氳繃</el-button> <el-button type="primary" size="small" @click="exportTable('myTable')">涓嬭浇鍘熷璁板綍</el-button> - <el-button size="small" @click="$emit('goback')">杩斿洖</el-button> + <el-button size="small" @click="goback">杩斿洖</el-button> </el-col> </el-row> <div class="search"> @@ -68,7 +68,7 @@ <el-form-item v-if="typeSource === 1" label="鍘傚瀵嗗害:"> <el-input v-model="supplierDensity" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input> </el-form-item> - <el-form-item label="褰撳墠鏍峰搧浣嶆暟:"> + <el-form-item label="褰撳墠鏍峰搧浣嶆暟:" label-width="120px"> <el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag> </el-form-item> <el-form-item label="澶囨敞:"> @@ -149,74 +149,64 @@ </div> </div> <!-- 甯歌妫�楠屽師濮嬭褰� --> - <div v-if=" - !tableLists.find((m) => m.templateId == currentTable) || - (tableLists.find((m) => m.templateId == currentTable).templateName != - '娓╁害寰幆妫�楠屽師濮嬭褰�' && - !tableLists - .find((m) => m.templateId == currentTable) - .templateName.includes('鐑惊鐜�') && - !tableLists - .find((m) => m.templateId == currentTable) - .templateName.includes('娓╁崌璇曢獙') && - tableLists.find((m) => m.templateId == currentTable).templateName != - '寮у瀭鐗规�ф楠屽師濮嬭褰�') - " id="nav" v-loading="tableLoading" class="center-box"> - <table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1" - cellpadding="10" class="tables" id="myTable"> - <tbody> - <tr style="white-space: nowrap"> - 濮旀墭缂栧彿锛歿{ - insOrder.entrustCode - }} - </tr> - <tr v-for="(m, i) in item.arr" :key="i"> - <td v-for="(n, j) in m" v-if="n.v.mc == undefined || Object.keys(n.v.mc).length === 4" - :id="item.templateId + '-' + n.i + '-' + n.r + '-' + n.c" :key="j" - :colspan="n.v.mc && n.v.mc.cs ? n.v.mc.cs : 1" :rowspan="n.v.mc && n.v.mc.rs ? n.v.mc.rs : 1" :style="`background:${n.v.bg ? n.v.bg : ''};color:${n.v.fc - };font-size:${n.v.fs}px;width:${handleWidth( - n - )}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl ? 'bold' : '' - };`"> - <div :class="`content-h-${n.v.ht} content-v-${n.v.vt}`" :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r] - }px;`" class="content"> - <template v-if=" - n.v.ps != undefined && - typeof n.v.ps.value === 'string' && - n.v.ps.value.includes('妫�楠屽��') && - state == 1 - "> - <el-input v-if="getInspectionValueType(n.i) == 1" - :key="'abc-' + '000' + index + '000' + i + '000' + j" v-model="n.v.v" :disabled="(getInspectionItemType(n.i) == 1 && - !dataAcquisitionEidtAble) || + <div id="nav" v-loading="tableLoading" class="center-box"> + <template v-if=" + tableLists.find((m) => m.templateId == currentTable)"> + <table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1" + cellpadding="10" class="tables" id="myTable"> + <tbody> + <tr style="white-space: nowrap"> + 濮旀墭缂栧彿锛歿{ + insOrder.entrustCode + }} + </tr> + <tr v-for="(m, i) in item.arr" :key="i"> + <td v-for="(n, j) in m" v-if="n.v.mc == undefined || Object.keys(n.v.mc).length === 4" + :id="item.templateId + '-' + n.i + '-' + n.r + '-' + n.c" :key="j" + :colspan="n.v.mc && n.v.mc.cs ? n.v.mc.cs : 1" :rowspan="n.v.mc && n.v.mc.rs ? n.v.mc.rs : 1" :style="`background:${n.v.bg ? n.v.bg : ''};color:${n.v.fc + };font-size:${n.v.fs}px;width:${handleWidth( + n + )}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl ? 'bold' : '' + };`"> + <div :class="`content-h-${n.v.ht} content-v-${n.v.vt}`" :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r] + }px;`" class="content"> + <template v-if=" + n.v.ps != undefined && + typeof n.v.ps.value === 'string' && + n.v.ps.value.includes('妫�楠屽��') && + state == 1 + "> + <el-input v-if="getInspectionValueType(n.i) == 1" + :key="'abc-' + '000' + index + '000' + i + '000' + j" v-model="n.v.v" :disabled="(getInspectionItemType(n.i) == 1 && + !dataAcquisitionEidtAble) || + (n.u != userId && n.u != undefined && n.u != '') + " class="table_input" @change="(m) => + changeInput( + m, + `${item.templateId}-${n.r}-${n.c}-${n.i}`, + n, + 'getDataType' + ) + " @input="handleInput(n)" @mousewheel.native.prevent @keydown.enter=" + changeInput( + '', + `${item.templateId}-${n.r}-${n.c}-${n.i}`, + n, + 'getDataType' + ) + "> + </el-input> + <el-input v-else-if="getInspectionValueType(n.i) == 2" v-model="n.v.v" :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '') - " class="table_input" @change="(m) => + " class="table_input" type="textarea" @change="(m) => changeInput( m, `${item.templateId}-${n.r}-${n.c}-${n.i}`, n, 'getDataType' ) - " @input="handleInput(n)" @mousewheel.native.prevent @keydown.enter=" - changeInput( - '', - `${item.templateId}-${n.r}-${n.c}-${n.i}`, - n, - 'getDataType' - ) - "> - </el-input> - <el-input v-else-if="getInspectionValueType(n.i) == 2" v-model="n.v.v" :disabled="getInspectionItemType(n.i) == 1 || - (n.u != userId && n.u != undefined && n.u != '') - " class="table_input" type="textarea" @change="(m) => - changeInput( - m, - `${item.templateId}-${n.r}-${n.c}-${n.i}`, - n, - 'getDataType' - ) - " /> - <!-- <el-select v-else-if="getInspectionValueType(n.i) == 5" v-model="n.v.v" :disabled="state > 1 || + " /> + <!-- <el-select v-else-if="getInspectionValueType(n.i) == 5" v-model="n.v.v" :disabled="state > 1 || getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '') " class="table_input" @change="(m) => @@ -229,136 +219,131 @@ " @visible-change="(e) => getDic(e, n.i)"> <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option> </el-select> --> - <span v-else-if="getInspectionValueType(n.i) == 4" - :style="`font-family:${n.v.ff} !important;`">/</span> - </template> - <template v-else-if="n.v.ps != undefined && n.v.ps.value === '缁撹'"> - <el-select v-if=" - (getInspectionValueType(n.i) == 2 || - getInspectionValueType(n.i) == 5) && + <span v-else-if="getInspectionValueType(n.i) == 4" + :style="`font-family:${n.v.ff} !important;`">/</span> + </template> + <template v-else-if="n.v.ps != undefined && n.v.ps.value === '缁撹'"> + <el-select v-if=" + (getInspectionValueType(n.i) == 2 || + getInspectionValueType(n.i) == 5) && + state == 1 + " v-model="n.v.v" class="table_input" @change="(m) => + changeInput( + m, + `${item.templateId}-${n.r}-${n.c}-${n.i}`, + n, + 'getDataType', + 'changeSelect' + ) + "> + <el-option :value="1" label="鍚堟牸"></el-option> + <el-option :value="0" label="涓嶅悎鏍�"></el-option> + <el-option :value="3" label="涓嶅垽瀹�"></el-option> + <el-option :value="2" label="寰呭畾"></el-option> + </el-select> + <template v-if="state > 1"> + <span v-if="n.v.v === 1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span> + <span v-else-if="n.v.v === 0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span> + <span v-else-if="n.v.v === 3" + :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">涓嶅垽瀹�</span> + <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span> + </template> + <template v-if="getInspectionValueType(n.i) != 2 && + state == 1"> + <span v-if="n.v.v === 1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span> + <span v-else-if="n.v.v === 0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span> + <span v-else-if="n.v.v === 3" + :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">涓嶅垽瀹�</span> + <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span> + </template> + </template> + <template v-else-if=" + n.v.ps != undefined && + n.v.ps.value === '璁惧缂栫爜' && state == 1 - " v-model="n.v.v" class="table_input" @change="(m) => - changeInput( - m, - `${item.templateId}-${n.r}-${n.c}-${n.i}`, - n, - 'getDataType', - 'changeSelect' - ) - "> - <el-option :value="1" label="鍚堟牸"></el-option> - <el-option :value="0" label="涓嶅悎鏍�"></el-option> - <el-option :value="3" label="涓嶅垽瀹�"></el-option> - <el-option :value="2" label="寰呭畾"></el-option> - </el-select> - <template v-if="state > 1"> - <span v-if="n.v.v === 1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span> - <span v-else-if="n.v.v === 0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span> - <span v-else-if="n.v.v === 3" - :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">涓嶅垽瀹�</span> - <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span> - </template> - <template v-if=" - PROJECT == '妫�娴嬩腑蹇�' || - (PROJECT == '瑁呭鐢电紗' && - getInspectionValueType(n.i) != 2 && - state == 1) "> - <span v-if="n.v.v === 1" :style="`font-family:${n.v.ff} !important;color: green;`">鍚堟牸</span> - <span v-else-if="n.v.v === 0" :style="`font-family:${n.v.ff} !important;color: red;`">涓嶅悎鏍�</span> - <span v-else-if="n.v.v === 3" - :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">涓嶅垽瀹�</span> - <span v-else :style="`font-family:${n.v.ff} !important;`">寰呭畾</span> + <span>{{ n.v.v }}</span> </template> - </template> - <template v-else-if=" - n.v.ps != undefined && - n.v.ps.value === '璁惧缂栫爜' && - state == 1 - "> - <span>{{ n.v.v }}</span> - </template> - <template v-else-if=" - n.v.ps != undefined && n.v.ps.value === '璁惧鍚嶇О' - "> - <el-select v-model="n.v.v" :disabled="state > 1" class="table_input" filterable multiple - placeholder="璁惧" remote @change="(val) => changeEquip(val, n)" - @visible-change="(e) => getEquipOptions(e, n.i)"> - <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"> - {{ item.label + "--" + item.value }} - </el-option> - </el-select> - </template> - <template v-else-if=" - n.v.ps != undefined && - n.v.ps.value === '瑕佹眰鍊�' && - state == 1 - "> - <span :style="`font-family:${n.v.ff} !important;`">{{ - getTell(n.i) - }}</span> - </template> - <template v-else-if=" - n.v.ps != undefined && - n.v.ps.value === '璁$畻鍊�' && - state == 1 - "><span :style="`font-family:${n.v.ff} !important;`">{{ - toFixed(n.v.v, n.v.ct) - }}</span></template> - <template v-else-if=" - n.v.ps != undefined && - n.v.ps.value === '鏈�缁堝��' && - state == 1 - "> - <span :style="`font-family:${n.v.ff} !important;`">{{ + <template v-else-if=" + n.v.ps != undefined && n.v.ps.value === '璁惧鍚嶇О' + "> + <el-select v-model="n.v.v" :disabled="state > 1" class="table_input" filterable multiple + placeholder="璁惧" remote @change="(val) => changeEquip(val, n)" + @visible-change="(e) => getEquipOptions(e, n.i)"> + <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" + :value="item.value"> + {{ item.label + "--" + item.value }} + </el-option> + </el-select> + </template> + <template v-else-if=" + n.v.ps != undefined && + n.v.ps.value === '瑕佹眰鍊�' && + state == 1 + "> + <span :style="`font-family:${n.v.ff} !important;`">{{ + getTell(n.i) + }}</span> + </template> + <template v-else-if=" + n.v.ps != undefined && + n.v.ps.value === '璁$畻鍊�' && + state == 1 + "><span :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v, n.v.ct) - }}</span> - </template> - <template v-else-if=" - n.v.ps != undefined && n.v.ps.value === '鏍峰搧缂栧彿' - "> - <div :title="currentSample.sampleCode" style=" + }}</span></template> + <template v-else-if=" + n.v.ps != undefined && + n.v.ps.value === '鏈�缁堝��' && + state == 1 + "> + <span :style="`font-family:${n.v.ff} !important;`">{{ + toFixed(n.v.v, n.v.ct) + }}</span> + </template> + <template v-else-if=" + n.v.ps != undefined && n.v.ps.value === '鏍峰搧缂栧彿' + "> + <div :title="currentSample.sampleCode" style=" display: flex; flex-wrap: nowrap; align-items: center; width: 100%; "> - <i v-if="!currentFiberOpticTape && !currentFiberOptic" class="el-icon-caret-left table_caret" - style="width: 16px" @click="caretSample(-1)"></i> - <div - :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`"> - {{ currentSample.sampleCode }} + <i class="el-icon-caret-left table_caret" style="width: 16px" @click="caretSample(-1)"></i> + <div + :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`"> + {{ currentSample.sampleCode }} + </div> + <i class="el-icon-caret-right table_caret" style="width: 16px" @click="caretSample(1)"></i> </div> - <i v-if="!currentFiberOpticTape && !currentFiberOptic" class="el-icon-caret-right table_caret" - style="width: 16px" @click="caretSample(1)"></i> - </div> - </template> - <template v-else-if=" - n.v.ps != undefined && n.v.ps.value === '鏍峰搧鍨嬪彿' - "> - <div v-if=" - currentSample.model !== undefined && - currentSample.model !== null - " :style="`font-family:${n.v.ff} !important;`"> - {{ currentSample.model }} - </div> - </template> - <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)"></span> - </div> - </td> - </tr> - </tbody> - </table> + </template> + <template v-else-if=" + n.v.ps != undefined && n.v.ps.value === '鏍峰搧鍨嬪彿' + "> + <div v-if=" + currentSample.model !== undefined && + currentSample.model !== null + " :style="`font-family:${n.v.ff} !important;`"> + {{ currentSample.model }} + </div> + </template> + <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)"></span> + </div> + </td> + </tr> + </tbody> + </table> + </template> </div> <el-upload v-if="state == 1" ref="upload" :action="action" :before-upload="beforeUpload" :data="{ orderId: id, }" :headers="headers" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" - accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar" style="width: 80px !important"> + accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar" + style="width: 80px !important;margin-top: 10px;"> <el-button v-if="state == 1" size="small" type="primary">闄勪欢涓婁紶</el-button></el-upload> <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" - :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table> - <!-- <ValueTable :key="upIndex" ref="fileList" :componentData="componentData0" :delUrl="$api.insOrderPlan.delfile" - :url="$api.insOrderPlan.getFileList" class="value-table" style="height: 100%; margin-top: 16px" /> --> + :height="'calc(100vh - 290px)'" @pagination="pagination" style="height: 100%; margin-top: 16px"></lims-table> </div> <el-drawer :size="550" :visible.sync="sampleVisible" title="鏍峰搧鍒囨崲"> <el-table v-if="sampleVisible" ref="productTable" :current-row-key="currentKey" :data="sampleProduct" @@ -390,8 +375,8 @@ </el-table> </el-drawer> <el-drawer :size="500" :visible.sync="taskVisible" title="浠诲姟鍒囨崲"> - <!-- <ValueTable :key="upIndex" ref="insOrderPlan" :componentData="componentData" - :url="$api.insOrderPlan.inspectionOrderDetailsTaskSwitching" class="value-table" style="height: 100%" /> --> + <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0" + :height="'calc(100vh - 90px)'" :currentChange="handleChangeTask"></lims-table> </el-drawer> <el-dialog :visible.sync="reviewDia" title="妫�楠屽鏍�" width="500px"> <div v-if="reviewDia" class="body" style="display: flex; padding: 10px"> @@ -521,42 +506,23 @@ </el-dialog> <add-un-pass v-if="addUnPassDialog" ref="addUnPassDialog" :addUnPassDialog="addUnPassDialog" @resetAddUnPass="resetAddUnPass"></add-un-pass> - <!-- <UnPassDialog - v-if="unPassDialog" - ref="unPassDialog" - :orderId="orderId" - :unPassDialog="unPassDialog" - @resetForm="resetForm" - ></UnPassDialog> --> - <!-- <InspectionWord - v-if="unPassCheck" - :inspectorList="inspectorList" - :orderId="orderId" - :rawMaterialTag="rawMaterialTag" - :sonLaboratory="sonLaboratory" - :state="state" - :typeSource="typeSource" - :unPassCheck="unPassCheck" - @closeUnPassCheckDialog="closeUnPassCheckDialog" - @refreshView="refreshView" - /> --> - <!-- <purchase-verification - v-if="purchaseDialog" - ref="purchaseDialog" - :orderId="orderId" - :purchaseDialog="purchaseDialog" - @resetPurchaseDialog="resetPurchaseDialog" - ></purchase-verification> --> + <UnPassDialog v-if="unPassDialog" ref="unPassDialog" :orderId="orderId" :unPassDialog="unPassDialog" + @resetForm="resetForm"></UnPassDialog> + <!-- <InspectionWord v-if="unPassCheck" :inspectorList="inspectorList" :orderId="orderId" + :rawMaterialTag="rawMaterialTag" :sonLaboratory="sonLaboratory" :state="state" :typeSource="typeSource" + :unPassCheck="unPassCheck" @closeUnPassCheckDialog="closeUnPassCheckDialog" @refreshView="refreshView" /> --> + <purchase-verification v-if="purchaseDialog" ref="purchaseDialog" :orderId="orderId" + :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification> </div> </template> <script> import excelFunction from "@/utils/excelFountion"; import limsTable from "@/components/Table/lims-table.vue"; -// import UnPassDialog from "../b1-unpass-manage/unPassDialog.vue"; -// import AddUnPass from "../b1-unpass-manage/addUnPass.vue"; -// import InspectionWord from "./InspectionWord.vue"; -// import PurchaseVerification from "../b1-unpass-manage/PurchaseVerification.vue"; +import UnPassDialog from "../unpass/components/addUnPass.vue"; +import AddUnPass from "../unpass/components/addUnPass.vue"; +// import InspectionWord from "./components/InspectionWord.vue"; +import PurchaseVerification from "../unpass/components/PurchaseVerification.vue"; import { doInsOrder, getCableTag, @@ -565,8 +531,6 @@ dataCollection, write, getInsProduct, - getReportModel, - determineWhetherToCollectData, search, verifyPlan, checkSubmitPlan, @@ -575,17 +539,19 @@ selectUserCondition, downFile, getFileList, - delfile + delfile, + inspectionOrderDetailsTaskSwitching } from "@/api/business/inspectionTask.js"; +import InspectionWorker from '../../../InspectionWorker.worker'; +import DataWorker from '../../../DataWorker.worker'; import html2canvas from "html2canvas"; import { mapGetters } from "vuex"; export default { - // props: ["sonLaboratory", "orderId", "state", "inspectorList", "typeSource"], components: { - // PurchaseVerification, - // AddUnPass, + PurchaseVerification, + AddUnPass, limsTable, - // UnPassDialog, + UnPassDialog, // InspectionWord, }, data() { @@ -606,7 +572,6 @@ load: null, }, dataGetDia: false, - wareTableDataLoading: false, fileAdd: false, sampleVisible: false, taskVisible: false, @@ -616,34 +581,7 @@ state: null, }, id: null, - componentData: { - entity: { - sonLaboratory: null, - userId: 0, - }, - isIndex: false, - showSelect: false, - select: false, - selectMethod: "handleChangeTask", - sort: false, - do: [], - isPage: false, - linkEvent: {}, - tagField: { - type: { - select: [], - }, - insState: { - select: [], - }, - }, - currentId: "", - selectField: {}, - requiredAdd: [], - requiredUp: [], - }, changeType: null, - getReportModelLoading: false, insOrder: {}, sampleProduct: [], supplierDensity: "", // 鍘傚瀵嗗害 @@ -672,30 +610,14 @@ verifyUser: null, personList: [], enumList: [], - fiberOpticVisible: false, - fiberOpticTapeVisible: false, - bushingVisible: false, - fiberOpticTape: [], //鍏夌氦甯﹀垪琛� - fiberOptic: [], //鍏夌氦鍒楄〃 - bushing: [], //濂楃鍒楄〃 - currentFiberOpticTape: null, //褰撳墠鍏夌氦甯� - currentFiberOptic: null, //褰撳墠鍏夌氦 - currentBushing: null, //褰撳墠濂楃 tableLoading: false, upLoading: false, temptList: null, - fiber: [], - fibers: [], - casing: [], currentTab: null, wareForm: { inspectionItem: 1, inspectionItemSubclass: "20(甯告俯)", }, - wareForm0: {}, - numOptions: [], - temperatureOptions: [], - wareTableData: [], otherForm: { humidity: null, temperature: null, @@ -713,18 +635,8 @@ dataAcquisitionInfo: {}, dataAcquisitionInfoNew: {}, dataAcquisitionEidtAble: false, - isGet: false, dataAcquisitionLoading: false, collected: false, - // 鐑惊鐜�---寮�濮� - thermalCyclingInfo: { - max: 0, - inspectionItem: 1, - arr: [], - length: 1, - inspectionItemClass: null, - }, - thermalCyclingLoading: false, temDataAcquisition: false, getData: [ { @@ -781,7 +693,7 @@ } else { return '鏂囦欢' } - }, + } }, { label: "闄勪欢鍚嶇О", prop: "fileName" }, { label: "涓婁紶浜�", prop: "name" }, @@ -818,6 +730,39 @@ }, tableLoading: false, // 鏂囦欢鍒楄〃鐩稿叧--缁撴潫 + // 浠诲姟鍒囨崲鍒楄〃--寮�濮� + tableData0: [], + column0: [ + { label: "濮旀墭缂栧彿", prop: "entrustCode", width: '160px' }, + { label: "妫�楠屽璞�", prop: "sampleType", width: '140px' }, + { + label: "绱ф�ョ▼搴�", prop: "type", dataType: "tag", + formatData: (params) => { + return this.urgentList.find(m => m.value == params).label + }, + formatType: (params) => { + return this.urgentList.find(m => m.value == params).type + } + }, + { + label: "鐘舵��", prop: "insState", dataType: "tag", + formatData: (params) => { + return this.typeList.find(m => m.value == params).label + }, + formatType: (params) => { + return this.typeList.find(m => m.value == params).type + } + }, + { label: "绾﹀畾鏃堕棿", prop: "appointed", width: '140px' }, + { label: "涓嬪彂鏃堕棿", prop: "sendTime", width: '140px' }, + ], + page0: { + total: 0, + size: -1, + current: -1, + }, + tableLoading0: false, + // 浠诲姟鍒囨崲鍒楄〃--缁撴潫 }; }, // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭� @@ -833,8 +778,6 @@ }, }, created() { - this.componentData.entity.sonLaboratory = this.sonLaboratory; - this.getUserInfo(); let { sonLaboratory, orderId, state, inspectorList, typeSource } = this.$route.query; this.sonLaboratory = sonLaboratory; @@ -849,89 +792,15 @@ this.getInsStateDicts(); this.getComparisonList(); this.getAuthorizedPerson(); - this.scrollInit(); // this.getPower(); this.startWorker(); + this.getList0() + this.scrollInit(); }, watch: { // 鐩戝惉浠诲姟id锛岃幏鍙栦换鍔′俊鎭� id(val) { - this.loading = true; - doInsOrder({ - id: val, - laboratory: this.sonLaboratory, - }).then(async (res) => { - this.insOrder = res.data.insOrder; - this.supplierDensity = res.data.supplierDensity; - this.getList() - this.urgentList.forEach((m) => { - if (m.value == this.insOrder.type) { - this.insOrder.typeName = m.label; - } - }); - this.loading = false; - if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) { - this.$emit("goback"); - return this.$message.error("璇ヤ换鍔℃病鏈夋牱鍝佷俊鎭�"); - } - // 璧嬪�煎綋鍓嶆牱鍝佸垪琛� - this.sampleProduct = res.data.sampleProduct; - this.currentSample = this.HaveJson(this.sampleProduct[0]); - let insProduct = this.HaveJson(this.currentSample.insProduct); - // 娓╁害銆佹箍搴﹁祴鍊� - this.otherForm = { - temperature: this.insOrder.temperature - ? this.insOrder.temperature - : null, - humidity: this.insOrder.humidity ? this.insOrder.humidity : null, - }; - if (this.typeSource == "1") { - this.getRawMaterialTag(this.currentSample.id); // 鍘熸潗鏂欑殑妫�楠屼换鍔℃煡璇㈡壒鏁� - this.rawMaterialTag = "1"; - } - this.getEquipOptions(1); - // 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」 - let list = await this.getCurrentProduct(this.currentSample.id, 0); - this.currentSample.insProduct = this.HaveJson(list); - // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁� - this.param = {}; - this.changeType = 0; - this.currentSample.insProduct.forEach((a) => { - // 鏄惁涓烘垚鍝佺數缂嗕笅鐨勬澗濂楃椤圭洰锛屼笉鏄垯鎵ц鍒濆鍖� - if (this.handleCasing(a.inspectionItem)) { - this.param[a.id] = { - insValue: [], - comValue: [], - resValue: null, - equipValue: [], - equipName: [], - insResult: null, - }; - } - }); - this.determineWhetherToCollectData(); //鏄惁闇�瑕佹暟閲� - this.getReportModel(this.currentSample.id); //鑾峰彇濂楃銆佸厜绾ゅ甫銆佸厜绾や俊鎭� - if (this.currentSample.index == undefined) - this.currentSample["index"] = 1; - let bushing = this.currentSample.bushing; - this.getTableLists(); //澶勭悊妯℃澘鍒楄〃淇℃伅 - - this.componentData.currentId = val; - this.currentKey = 1; - this.getCableTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎澶氭妫�楠岀殑鐢电紗閰嶇疆 - this.getRepetitionTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎閲嶅妫�楠岄」 - // 娓呯┖鍏夌氦閰嶇疆鐩稿叧鏁版嵁---涓嬮潰淇℃伅鏆傛椂鍙拷鐣� - this.fiberOpticTape = []; - this.currentFiberOpticTape = null; - this.fiberOptic = []; - this.currentFiberOptic = null; - this.bushing = []; - this.currentBushing = null; - this.currentTab = null; - if (bushing && bushing.length > 0) { - this.bushing = bushing; - } - }); + this.refreshView() }, // 鐩戝惉褰撳墠妯℃澘鍙樺寲 currentTable(val1, val0) { @@ -946,18 +815,15 @@ this.currentSample.insProduct = this.HaveJson(list); //璧嬪�煎綋鍓嶆牱鍝佺殑妫�楠岄」 this.param = {}; //鍒濆鍖栦紶鍒板悗绔殑鍙傛暟 this.currentSample.insProduct.forEach((a, j) => { - if (this.handleCasing(a.inspectionItem)) { - this.param[a.id] = { - insValue: [], - comValue: [], - resValue: null, - equipValue: [], - equipName: [], - insResult: null, - }; - } + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null, + }; }); - this.getReportModel(this.currentSample.id); //鑾峰彇濂楃銆佸厜绾ゅ甫銆佸厜绾や俊鎭� // 鍘婚噸妯℃澘锛岃繑鍥炴湁鍑犱釜妯℃澘 const mySet1 = new Set(); this.tableLists = this.currentSample.insProduct.filter((m) => { @@ -1041,13 +907,89 @@ }, // 鏂囦欢绠$悊--缁撴潫 + // 浠诲姟鍒囨崲--寮�濮� + getList0() { + this.tableLoading0 = true; + let param = { userId: this.userId, sonLaboratory: this.sonLaboratory, ...this.page0 }; + delete param.total; + inspectionOrderDetailsTaskSwitching({ ...param }) + .then((res) => { + this.tableLoading0 = false; + if (res.code === 200) { + this.tableData0 = res.data.records; + } + }) + .catch((err) => { + this.tableLoading0 = false; + }); + }, + // 浠诲姟鍒囨崲--缁撴潫 + closeAddVerifyDia() { this.addCheck = false; this.checkUser = ""; }, // 鍒锋柊椤甸潰 refreshView() { - this.$emit("refreshView"); + this.loading = true; + doInsOrder({ + id: this.id, + laboratory: this.sonLaboratory, + }).then(async (res) => { + this.insOrder = res.data.insOrder; + this.supplierDensity = res.data.supplierDensity; + this.getList() + this.urgentList.forEach((m) => { + if (m.value == this.insOrder.type) { + this.insOrder.typeName = m.label; + } + }); + this.loading = false; + if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) { + this.goback(); + return this.$message.error("璇ヤ换鍔℃病鏈夋牱鍝佷俊鎭�"); + } + // 璧嬪�煎綋鍓嶆牱鍝佸垪琛� + this.sampleProduct = res.data.sampleProduct; + this.currentSample = this.HaveJson(this.sampleProduct[0]); + let insProduct = this.HaveJson(this.currentSample.insProduct); + // 娓╁害銆佹箍搴﹁祴鍊� + this.otherForm = { + temperature: this.insOrder.temperature + ? this.insOrder.temperature + : null, + humidity: this.insOrder.humidity ? this.insOrder.humidity : null, + }; + if (this.typeSource == "1") { + this.getRawMaterialTag(this.currentSample.id); // 鍘熸潗鏂欑殑妫�楠屼换鍔℃煡璇㈡壒鏁� + this.rawMaterialTag = "1"; + } + this.getEquipOptions(1); + // 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」 + let list = await this.getCurrentProduct(this.currentSample.id, 0); + this.currentSample.insProduct = this.HaveJson(list); + // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁� + this.param = {}; + this.changeType = 0; + this.currentSample.insProduct.forEach((a) => { + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null, + }; + }); + if (this.currentSample.index == undefined) + this.currentSample["index"] = 1; + let bushing = this.currentSample.bushing; + this.getTableLists(); //澶勭悊妯℃澘鍒楄〃淇℃伅 + + this.currentKey = 1; + this.getCableTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎澶氭妫�楠岀殑鐢电紗閰嶇疆 + this.getRepetitionTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎閲嶅妫�楠岄」 + }); }, closeUnPassCheckDialog() { this.unPassCheck = false; @@ -1336,11 +1278,11 @@ n.v.ps.value.includes("妫�楠屽��") ) { num++; + if (str0 == str) { + maxNum = num; + } } }); - if (str0 == str) { - maxNum = num; - } } // 缁戝畾璁惧 if ( @@ -1510,12 +1452,12 @@ this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝� } // 鍒涘缓 Worker 瀹炰緥 - this.worker = new Worker("/static/js/worker.js"); + this.worker = new InspectionWorker(); if (this.worker0) { this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝� } // 鍒涘缓 Worker 瀹炰緥 - this.worker0 = new Worker("/static/js/worker0.js"); + this.worker0 = new DataWorker(); }, // 鍋滄澶氱嚎绋� stopWorker() { @@ -1528,7 +1470,6 @@ this.worker0 = null; } }, - // 鐑惊鐜�---缁撴潫 // 淇濆瓨婀垮害銆佹俯搴︽暟鎹� subOtherForm(m, type) { console.log("m---", m); @@ -1617,13 +1558,6 @@ async handleChangeSample(row, column, event) { // 鍒濆鍖栨暟鎹� this.param = {}; - // 娓呯┖鍏夌氦閰嶇疆鐩稿叧鏁版嵁 - this.fiberOpticTape = []; - this.currentFiberOpticTape = null; - this.fiberOptic = []; - this.currentFiberOptic = null; - this.bushing = []; - this.currentBushing = null; this.sampleVisible = false; // 璧嬪�兼牱鍝� this.currentSample = this.HaveJson(row); @@ -1634,23 +1568,15 @@ this.param = {}; this.changeType = 0; this.currentSample.insProduct.forEach((a, j) => { - if (this.handleCasing(a.inspectionItem)) { - this.param[a.id] = { - insValue: [], - comValue: [], - resValue: null, - equipValue: [], - equipName: [], - insResult: null, - }; - } + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null, + }; }); - // 鑾峰彇濂楃,鍏夌氦甯�,鍏夌氦鏁版嵁 - this.getReportModel(row.id); - let bushing = this.currentSample.bushing; - if (bushing && bushing.length > 0) { - this.bushing = bushing; - } // 澶勭悊椤甸潰鍒楄〃鏁版嵁 this.getTableLists(); this.currentKey = row.index; @@ -1665,33 +1591,6 @@ currentTable: this.currentTable, }) ); - }, - // 鏉惧绠$殑鍒ゆ柇\濡傛灉changeType涓嶇瓑浜�3閭d箞椤甸潰涓嶅睍绀烘澗濂楃妫�楠岄」 - handleCasing(inspectionItem) { - if (this.changeType != 3) { - if (inspectionItem.includes("鏉惧绠�")) { - return false; - } else { - return true; - } - } else { - return true; - } - }, - // 鑾峰彇濂楃,鍏夌氦甯�,鍏夌氦鏁版嵁 - getReportModel(id) { - if (this.PROJECT != "妫�娴嬩腑蹇�") { - return; - } - this.getReportModelLoading = true; - getReportModel({ - sampleId: id - }).then((res) => { - this.getReportModelLoading = false; - this.fibers = res.data["鍏夌氦甯�"]; - this.fiber = res.data["鍏夌氦"]; - this.casing = res.data["濂楃"]; - }); }, async handleChangeCableTag(m, type, num, m2) { let cableTag = ""; @@ -1724,7 +1623,6 @@ }; }); this.getTableLists0(list); - this.getReportModel(this.currentSample.id); this.worker.postMessage( JSON.stringify({ type: "saveData", @@ -1743,21 +1641,19 @@ }, // 鏀瑰彉浠诲姟 handleChangeTask(row) { - if (row.length > 0) this.id = row[0].id; + if (row) this.id = row.id; this.taskVisible = false; }, // 瀛楀吀鑾峰彇淇℃伅 getTypeDicts() { this.getDicts("urgency_level").then((response) => { this.urgentList = this.dictToValue(response.data); - this.componentData.tagField.type.select = this.urgentList; }); }, // 瀛楀吀鑾峰彇淇℃伅 getInsStateDicts() { this.getDicts("inspection_task_state").then((response) => { this.typeList = this.dictToValue(response.data); - this.componentData.tagField.insState.select = this.typeList; }); }, // 瀛楀吀鑾峰彇淇℃伅 @@ -2196,7 +2092,8 @@ } }); // 浠ヤ笅鏄牱寮忓鐞嗛�昏緫 - set = Array.sort(set); + set = [...set] + // set = set.sort(); set.forEach((b) => { let arr = []; a.template.forEach((c) => { @@ -2406,11 +2303,6 @@ this.saveInsContext(currentInsItemId); } }, 200); - }, - // 鏄惁闇�瑕佹暟閲� - async determineWhetherToCollectData() { - let res = await determineWhetherToCollectData({ managementNumber: '' }) - this.isGet = res.data; }, // 鏍规嵁鍚庣浼犲弬鏇存柊椤甸潰鏁版嵁 param => this.tableList[0].insProductResult getCurrentInsProduct(pId) { @@ -2635,9 +2527,6 @@ // } // } // }, - getUserInfo() { - this.componentData.entity.userId = this.userId; - }, openAddCheck() { this.addCheck = true; }, @@ -2655,7 +2544,7 @@ }).then((res) => { if (res.code === 200) { this.$message.success("鎿嶄綔鎴愬姛"); - this.$emit("goback"); + this.goback(); this.addCheck = false; } this.reviewLoading = false; @@ -2680,7 +2569,7 @@ }).then((res) => { if (res.code === 200) { this.$message.success("鎿嶄綔鎴愬姛"); - this.$emit("goback"); + this.goback(); } this.reviewLoading = false; }) @@ -2721,7 +2610,7 @@ }).then((res) => { if (res.code === 200) { this.$message.success("鎿嶄綔鎴愬姛"); - this.$emit("goback"); + this.goback(); this.submitLoading = false; this.addVerifyDia = false; } @@ -2773,7 +2662,7 @@ if (res.code === 200) { this.$message.success("鎿嶄綔鎴愬姛"); this.addVerifyDia = false; - this.$emit("goback"); + this.goback(); } this.submitLoading = false; }) @@ -2806,6 +2695,8 @@ param: JSON.stringify(param), currentTable: this.currentTable, sampleId: this.currentSample.id, + orderId: this.orderId, + sonLaboratory: this.sonLaboratory }).then((res) => { if (res.code == 201) { this.$message.error("淇濆瓨澶辫触"); @@ -2936,16 +2827,14 @@ this.param = {}; this.changeType = 0; this.currentSample.insProduct.forEach((a, j) => { - if (this.handleCasing(a.inspectionItem)) { - this.param[a.id] = { - insValue: [], - comValue: [], - resValue: null, - equipValue: [], - equipName: [], - insResult: null, - }; - } + this.param[a.id] = { + insValue: [], + comValue: [], + resValue: null, + equipValue: [], + equipName: [], + insResult: null, + }; }); // 椤甸潰鏁版嵁澶勭悊 this.getTableLists(); @@ -3016,6 +2905,9 @@ return v; } }, + goback() { + this.$tab.closeOpenPage({ path: "/business/inspectionTask" }); + } }, }; </script> @@ -3048,13 +2940,14 @@ .title { height: 60px; line-height: 60px; + padding: 0 16px; } .search { width: 100%; - margin-bottom: 10px; background-color: #fff; border-radius: 3px; + margin-bottom: 10px; } .search .form-inline { @@ -3064,7 +2957,7 @@ } .center { - width: calc(100% - 40px); + width: 100%; /* max-height: 580px; */ background-color: #fff; border-radius: 3px; @@ -3091,6 +2984,7 @@ .tables { table-layout: fixed; margin: 5px 5px 16px; + border-collapse: collapse; } .tables td { @@ -3221,9 +3115,9 @@ } </style> <style> -.inspection .el-form-item__label { +/* .inspection .el-form-item__label { color: #000; -} +} */ .inspection .el-drawer__header::before { content: ""; diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue index e0b3b07..45c4936 100644 --- a/src/views/business/materialOrder/index.vue +++ b/src/views/business/materialOrder/index.vue @@ -3,60 +3,50 @@ <div> <div class="search"> <el-form :model="entity" ref="entity" size="small" :inline="true"><el-form-item label="鎵瑰彿" prop="updateBatchNo"> - <el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> - </el-input> - </el-form-item><el-form-item label="濮旀墭缂栧彿" prop="entrustCode"> - <el-input v-model="entity.entrustCode" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> - </el-input> - </el-form-item><el-form-item label="闆朵欢鍙�" prop="partNo"> - <el-input v-model="entity.partNo" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> - </el-input> - </el-form-item><el-form-item label="闆朵欢鎻忚堪" prop="partDesc"> - <el-input v-model="entity.partDesc" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> - </el-input> - </el-form-item> + <el-input v-model="entity.updateBatchNo" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> + </el-input> + </el-form-item><el-form-item label="濮旀墭缂栧彿" prop="entrustCode"> + <el-input v-model="entity.entrustCode" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> + </el-input> + </el-form-item><el-form-item label="闆朵欢鍙�" prop="partNo"> + <el-input v-model="entity.partNo" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> + </el-input> + </el-form-item><el-form-item label="闆朵欢鎻忚堪" prop="partDesc"> + <el-input v-model="entity.partDesc" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> + </el-input> + </el-form-item> <el-form-item> - <el-button v-if="tabIndex === 2 || tabIndex === 3 || tabIndex === 4" :icon="!more?'el-icon-arrow-down':'el-icon-arrow-up'" style="color: #3A7BFA;" type="text" @click="more=!more">{{!more?'鏇村':'鏀惰捣'}}</el-button> + <el-button v-if="tabIndex === 2 || tabIndex === 3 || tabIndex === 4" + :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3A7BFA;" type="text" + @click="more = !more">{{ !more ? '鏇村' : '鏀惰捣' }}</el-button> <el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button> <el-button size="mini" @click="refresh()">閲嶇疆</el-button> </el-form-item> - <el-form-item label="渚涘簲鍟嗗悕绉�" prop="supplierName" v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> - <el-input v-model="entity.supplierName" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> + <el-form-item label="渚涘簲鍟嗗悕绉�" prop="supplierName" + v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> + <el-input v-model="entity.supplierName" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> </el-input> </el-form-item> - <el-form-item label="鏍峰搧鍨嬪彿" prop="sampleModel" v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> - <el-input v-model="entity.sampleModel" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"> + <el-form-item label="鏍峰搧鍨嬪彿" prop="sampleModel" + v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> + <el-input v-model="entity.sampleModel" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> </el-input> </el-form-item> - <el-form-item label="妫�楠岀姸鎬�" prop="inspectStatus" v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> - <el-select v-model="entity.inspectStatus" clearable - size="small" @change="refreshTable()"> + <el-form-item label="妫�楠岀姸鎬�" prop="inspectStatus" + v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> + <el-select v-model="entity.inspectStatus" clearable size="small" @change="refreshTable()"> <el-option v-for="(a, i) in inspectStatusList" :key="i" :label="a.label" :value="a.value"></el-option> </el-select> </el-form-item> <el-form-item label="涓嬪彂鏃堕棿" prop="date" v-if="(tabIndex === 2 || tabIndex === 3 || tabIndex === 4) && more"> - <el-date-picker - v-model="entity.date" - end-placeholder="缁撴潫鏃ユ湡" - format="yyyy-MM-dd" - placeholder="閫夋嫨鏃ユ湡" - range-separator="鑷�" - size="small" - start-placeholder="寮�濮嬫棩鏈�" - type="daterange" - value-format="yyyy-MM-dd"> + <el-date-picker v-model="entity.date" end-placeholder="缁撴潫鏃ユ湡" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" + range-separator="鑷�" size="small" start-placeholder="寮�濮嬫棩鏈�" type="daterange" value-format="yyyy-MM-dd"> </el-date-picker> </el-form-item> </el-form> @@ -65,48 +55,45 @@ <div class="table-tab"> <div> <ul class="tab"> - <li v-for="(m,i) in tabList" :key="m.value" :class="{active:m.value===tabIndex}" @click="handleTab(m)">{{m.label}}</li> + <li v-for="(m, i) in tabList" :key="m.value" :class="{ active: m.value === tabIndex }" @click="handleTab(m)"> + {{ m.label }}</li> </ul> </div> <div> - <el-button v-show="tabIndex === 3 || tabIndex === 2" :loading="outLoading" size="small" type="primary" @click="handleOut">瀵煎嚭</el-button> + <el-button v-show="tabIndex === 3 || tabIndex === 2" :loading="outLoading" size="small" type="primary" + @click="handleOut">瀵煎嚭</el-button> <el-button v-if="tabIndex === 0" size="small" type="primary" @click="copper">閾滄潗鏂欎笅鍗�</el-button> <el-button v-if="tabIndex !== 0" size="small" type="primary" @click="openPrint">鏍囩鎵撳嵃</el-button> </div> </div> <!--寰呬笅鍗�--> <div class="table"> - <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" - @pagination="pagination" :height="'calc(100vh - 290px)'" key="tableData" - :page="page" :tableLoading="tableLoading"></lims-table> + <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" @pagination="pagination" + :height="'calc(100vh - 290px)'" key="tableData" :page="page" :tableLoading="tableLoading"></lims-table> </div> <!--妫�楠屼腑--> <div class="table"> - <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" - :isSelection="true" :handleSelectionChange="selectMethod" - @pagination="pagination1" :height="'calc(100vh - 290px)'" key="tableData1" - :page="page1" :tableLoading="tableLoading1"></lims-table> + <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" :isSelection="true" + :handleSelectionChange="selectMethod" @pagination="pagination1" :height="'calc(100vh - 290px)'" + key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table> </div> <!--宸叉楠�--> <div class="table"> - <lims-table :tableData="tableData2" :column="column2" v-if="tabIndex === 2" - :isSelection="true" :handleSelectionChange="selectMethod" - @pagination="pagination2" :height="'calc(100vh - 290px)'" key="tableData2" - :page="page2" :tableLoading="tableLoading2"></lims-table> + <lims-table :tableData="tableData2" :column="column2" v-if="tabIndex === 2" :isSelection="true" + :handleSelectionChange="selectMethod" @pagination="pagination2" :height="'calc(100vh - 290px)'" + key="tableData2" :page="page2" :tableLoading="tableLoading2"></lims-table> </div> <!--鍏ㄩ儴--> <div class="table"> - <lims-table :tableData="tableData3" :column="column3" v-if="tabIndex === 3" - :isSelection="true" :handleSelectionChange="selectMethod" - @pagination="pagination3" :height="'calc(100vh - 290px)'" key="tableData3" - :page="page3" :tableLoading="tableLoading3"></lims-table> + <lims-table :tableData="tableData3" :column="column3" v-if="tabIndex === 3" :isSelection="true" + :handleSelectionChange="selectMethod" @pagination="pagination3" :height="'calc(100vh - 290px)'" + key="tableData3" :page="page3" :tableLoading="tableLoading3"></lims-table> </div> <!--瀛e害妫�楠�--> <div class="table"> - <lims-table :tableData="tableData4" :column="column4" v-if="tabIndex === 4" - :isSelection="true" :handleSelectionChange="selectMethod" - @pagination="pagination4" :height="'calc(100vh - 290px)'" key="tableData4" - :page="page4" :tableLoading="tableLoading4"></lims-table> + <lims-table :tableData="tableData4" :column="column4" v-if="tabIndex === 4" :isSelection="true" + :handleSelectionChange="selectMethod" @pagination="pagination4" :height="'calc(100vh - 290px)'" + key="tableData4" :page="page4" :tableLoading="tableLoading4"></lims-table> </div> </div> </div> @@ -114,9 +101,8 @@ <el-dialog :visible.sync="exemptionVisible" title="纭鍏嶆" width="42%"> <div style="display: flex"> <span style="width: 90px; line-height: 32px">瑙勬牸鍨嬪彿锛�</span> - <el-input v-model="exemptionInfo.partDetail" clearable placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable"></el-input> + <el-input v-model="exemptionInfo.partDetail" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"></el-input> </div> <span slot="footer" class="dialog-footer"> <el-row> @@ -128,13 +114,14 @@ <!-- 鎾ら攢鎶ユ --> <el-dialog :visible.sync="declareDialogVisible" title="鎶ユ鎾ら攢" width="30%"> <p style="font-size:16px;color:#333333">鎵瑰彿<span - style="color:#34BD66">{{this.insOrderRow.updateBatchNo}}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span></p> + style="color:#34BD66">{{ this.insOrderRow.updateBatchNo }}</span>鐨勪俊鎭槸鍚�<span style="color: #FF4902">鎾ら攢鎶ユ</span> + </p> <span slot="footer" class="dialog-footer"> - <el-row> - <el-button @click="declareDialogVisible = false">鍙� 娑�</el-button> - <el-button :loading="upLoad" type="primary" @click="submitDeclare">纭� 瀹�</el-button> - </el-row> - </span> + <el-row> + <el-button @click="declareDialogVisible = false">鍙� 娑�</el-button> + <el-button :loading="upLoad" type="primary" @click="submitDeclare">纭� 瀹�</el-button> + </el-row> + </span> </el-dialog> <!-- 鎾ら攢涓嬪崟 --> <el-dialog :visible.sync="quashDialogVisible" title="涓嬪崟鎾ら攢" width="30%"> @@ -155,42 +142,37 @@ </span> </el-dialog> <!--鏍囩鎵撳嵃寮规--> - <print-dialog v-if="printDialog" ref="printDialog" - :printDialog="printDialog" - @closePrintDialog="closePrintDialog"></print-dialog> + <print-dialog v-if="printDialog" ref="printDialog" :printDialog="printDialog" + @closePrintDialog="closePrintDialog"></print-dialog> <!--鏁版嵁鏌ョ湅寮规--> - <data-look-visible v-if="dataDialogVisible" ref="dataDialogVisible" - :dataDialogVisible="dataDialogVisible" - :dataLookInfo="dataLookInfo" @closeDataLook="closeDataLook"></data-look-visible> + <data-look-visible v-if="dataDialogVisible" ref="dataDialogVisible" :dataDialogVisible="dataDialogVisible" + :dataLookInfo="dataLookInfo" @closeDataLook="closeDataLook"></data-look-visible> <!--闄勪欢鏌ョ湅寮规--> - <files-look-visible v-if="filesDialogVisible" ref="filesDialogVisible" - :filesDialogVisible="filesDialogVisible" - :filesLookInfo="filesLookInfo" @closeFilesLook="closeFilesLook"></files-look-visible> + <files-look-visible v-if="filesDialogVisible" ref="filesDialogVisible" :filesDialogVisible="filesDialogVisible" + :filesLookInfo="filesLookInfo" @closeFilesLook="closeFilesLook"></files-look-visible> <!--鎶ュ憡涓嬭浇寮规--> <down-file-dialog v-if="downFileDialogVisible" ref="downFileDialogVisible" - :downFileDialogVisible="downFileDialogVisible" - :downLoadInfo="downLoadInfo" @closeDownFileDialog="closeDownFileDialog"></down-file-dialog> + :downFileDialogVisible="downFileDialogVisible" :downLoadInfo="downLoadInfo" + @closeDownFileDialog="closeDownFileDialog"></down-file-dialog> <!--浜т笟閾句俊鎭煡鐪�--> <ShowInfo v-if="showInfoDialog" ref="showInfoDialog" :showInfoDialog="showInfoDialog"></ShowInfo> <!--妫�楠屼换鍔′俊鎭煡鐪�--> <el-dialog :visible.sync="InspectInfoDialog" title="鏁版嵁鏌ョ湅" width="400px" @closed="closeInsInfoDialog"> <div style="margin-bottom: 8px"> <span style="font-size: 16px;">杩涘巶妫�楠屽師濮嬫暟鎹�</span> - <el-link :disabled="!insInfo.enterOrderId" :underline="false" - style="vertical-align: bottom;margin-left: 6px" - type="primary" @click="viewInsInfo0">鏌ョ湅</el-link> + <el-link :disabled="!insInfo.enterOrderId" :underline="false" style="vertical-align: bottom;margin-left: 6px" + type="primary" @click="viewInsInfo0">鏌ョ湅</el-link> </div> <div> - <span style="font-size: 16px;">瀛e害妫�楠屽師濮嬫暟鎹�</span> - <el-link :disabled="!insInfo.quarterOrderId" :underline="false" - style="vertical-align: bottom;margin-left: 6px" - type="primary" @click="viewInsInfo1">鏌ョ湅</el-link> + <span style="font-size: 16px;">瀛e害妫�楠屽師濮嬫暟鎹�</span> + <el-link :disabled="!insInfo.quarterOrderId" :underline="false" style="vertical-align: bottom;margin-left: 6px" + type="primary" @click="viewInsInfo1">鏌ョ湅</el-link> </div> </el-dialog> -<!-- <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"--> -<!-- :sonLaboratory="'鍘熸潗鏂�'" :state="state"--> -<!-- :typeSource="typeSource"--> -<!-- @goback="goback" @refreshView="refreshView"/>--> + <!-- <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"--> + <!-- :sonLaboratory="'鍘熸潗鏂�'" :state="state"--> + <!-- :typeSource="typeSource"--> + <!-- @goback="goback" @refreshView="refreshView"/>--> </div> </template> @@ -213,22 +195,22 @@ revokeInspectionReport, updateEntrustCode } from "@/api/business/rawMaterialOrder"; -import {getWarehouseSubmit} from "@/api/business/materialInspection"; +import { getWarehouseSubmit } from "@/api/business/materialInspection"; // import Inspection from "../do/b1-inspect-order-plan/Inspection.vue"; export default { name: "b1-material-inspection-order", // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� - components: {limsTable,DownFileDialog, FilesLookVisible, DataLookVisible, ShowInfo, PrintDialog}, + components: { limsTable, DownFileDialog, FilesLookVisible, DataLookVisible, ShowInfo, PrintDialog }, data() { // 杩欓噷瀛樻斁鏁版嵁 return { tableData: [], tableLoading: false, column: [ - {label: '鎵瑰彿', prop: 'updateBatchNo'}, - {label: '闆朵欢鍙�', prop: 'partNo'}, - {label: '闆朵欢鎻忚堪', prop: 'partDesc'}, + { label: '鎵瑰彿', prop: 'updateBatchNo' }, + { label: '闆朵欢鍙�', prop: 'partNo' }, + { label: '闆朵欢鎻忚堪', prop: 'partDesc' }, { dataType: 'tag', label: '鐗╂枡绫诲瀷', @@ -248,11 +230,11 @@ } } }, - {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, - {label: '鍗曚綅', prop: 'buyUnitMeas'}, - {label: '璁㈠崟鍙�', prop: 'orderNo'}, - {label: '鎺ユ敹鏃堕棿', prop: 'receiverDate'}, - {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, + { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' }, + { label: '鍗曚綅', prop: 'buyUnitMeas' }, + { label: '璁㈠崟鍙�', prop: 'orderNo' }, + { label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' }, + { label: '鎶ユ鏃堕棿', prop: 'declareDate' }, { dataType: 'action', fixed: 'right', @@ -283,21 +265,21 @@ } ], page: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, tableData1: [], tableLoading1: false, column1: [ - {label: '鎵瑰彿', prop: 'updateBatchNo'}, - {label: '濮旀墭缂栧彿', prop: 'entrustCode'}, - {label: '闆朵欢鍙�', prop: 'partNo'}, - {label: '闆朵欢鎻忚堪', prop: 'partDesc'}, - {label: '鏍峰搧鍚嶇О', prop: 'sampleName'}, - {label: '鏍峰搧鍨嬪彿', prop: 'sampleModel'}, - {label: '妫�楠屼汉', prop: 'userName'}, - {label: '涓嬪彂鏃堕棿', prop: 'sendTime'}, + { label: '鎵瑰彿', prop: 'updateBatchNo' }, + { label: '濮旀墭缂栧彿', prop: 'entrustCode' }, + { label: '闆朵欢鍙�', prop: 'partNo' }, + { label: '闆朵欢鎻忚堪', prop: 'partDesc' }, + { label: '鏍峰搧鍚嶇О', prop: 'sampleName' }, + { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' }, + { label: '妫�楠屼汉', prop: 'userName' }, + { label: '涓嬪彂鏃堕棿', prop: 'sendTime' }, { dataType: 'tag', label: '鐗╂枡绫诲瀷', @@ -317,11 +299,11 @@ } } }, - {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, - {label: '鍗曚綅', prop: 'buyUnitMeas'}, - {label: '璁㈠崟鍙�', prop: 'orderNo'}, - {label: '鎺ユ敹鏃堕棿', prop: 'receiverDate'}, - {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, + { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' }, + { label: '鍗曚綅', prop: 'buyUnitMeas' }, + { label: '璁㈠崟鍙�', prop: 'orderNo' }, + { label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' }, + { label: '鎶ユ鏃堕棿', prop: 'declareDate' }, { dataType: 'action', fixed: 'right', @@ -352,27 +334,27 @@ } ], page1: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, tableData2: [], tableLoading2: false, column2: [ - {label: '濮旀墭缂栧彿', prop: 'entrustCode'}, - {label: '妫�楠岀姸鎬�', prop: 'inspectStatus'}, - {label: '璁㈠崟鍙�', prop: 'orderNo'}, - {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, - {label: '涓嬪彂鏃堕棿', prop: 'sendTime'}, - {label: '鎵瑰彿', prop: 'updateBatchNo'}, - {label: '闆朵欢鍙�', prop: 'partNo'}, - {label: '闆朵欢鎻忚堪', prop: 'partDesc'}, - {label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'}, - {label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc'}, - {label: '鍏嶆', prop: 'isExemption'}, - {label: '鏍峰搧鍚嶇О', prop: 'sampleName'}, - {label: '鏍峰搧鍨嬪彿', prop: 'sampleModel'}, - {label: '妫�楠屼汉', prop: 'userName'}, + { label: '濮旀墭缂栧彿', prop: 'entrustCode' }, + { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' }, + { label: '璁㈠崟鍙�', prop: 'orderNo' }, + { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' }, + { label: '涓嬪彂鏃堕棿', prop: 'sendTime' }, + { label: '鎵瑰彿', prop: 'updateBatchNo' }, + { label: '闆朵欢鍙�', prop: 'partNo' }, + { label: '闆朵欢鎻忚堪', prop: 'partDesc' }, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' }, + { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' }, + { label: '鍏嶆', prop: 'isExemption' }, + { label: '鏍峰搧鍚嶇О', prop: 'sampleName' }, + { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' }, + { label: '妫�楠屼汉', prop: 'userName' }, { dataType: 'tag', label: '鐗╂枡绫诲瀷', @@ -392,9 +374,9 @@ } } }, - {label: '鍗曚綅', prop: 'buyUnitMeas'}, - {label: '鎺ユ敹鏃堕棿', prop: 'receiverDate'}, - {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, + { label: '鍗曚綅', prop: 'buyUnitMeas' }, + { label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' }, + { label: '鎶ユ鏃堕棿', prop: 'declareDate' }, { dataType: 'action', fixed: 'right', @@ -465,27 +447,27 @@ } ], page2: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, tableData3: [], tableLoading3: false, column3: [ - {label: '濮旀墭缂栧彿', prop: 'entrustCode'}, - {label: '妫�楠岀姸鎬�', prop: 'inspectStatus'}, - {label: '璁㈠崟鍙�', prop: 'orderNo'}, - {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, - {label: '涓嬪彂鏃堕棿', prop: 'sendTime'}, - {label: '鎵瑰彿', prop: 'updateBatchNo'}, - {label: '闆朵欢鍙�', prop: 'partNo'}, - {label: '闆朵欢鎻忚堪', prop: 'partDesc'}, - {label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'}, - {label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc'}, - {label: '鍏嶆', prop: 'isExemption'}, - {label: '鏍峰搧鍚嶇О', prop: 'sampleName'}, - {label: '鏍峰搧鍨嬪彿', prop: 'sampleModel'}, - {label: '妫�楠屼汉', prop: 'userName'}, + { label: '濮旀墭缂栧彿', prop: 'entrustCode' }, + { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' }, + { label: '璁㈠崟鍙�', prop: 'orderNo' }, + { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' }, + { label: '涓嬪彂鏃堕棿', prop: 'sendTime' }, + { label: '鎵瑰彿', prop: 'updateBatchNo' }, + { label: '闆朵欢鍙�', prop: 'partNo' }, + { label: '闆朵欢鎻忚堪', prop: 'partDesc' }, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' }, + { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' }, + { label: '鍏嶆', prop: 'isExemption' }, + { label: '鏍峰搧鍚嶇О', prop: 'sampleName' }, + { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' }, + { label: '妫�楠屼汉', prop: 'userName' }, { dataType: 'tag', label: '鐗╂枡绫诲瀷', @@ -505,9 +487,9 @@ } } }, - {label: '鍗曚綅', prop: 'buyUnitMeas'}, - {label: '鎺ユ敹鏃堕棿', prop: 'receiverDate'}, - {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, + { label: '鍗曚綅', prop: 'buyUnitMeas' }, + { label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' }, + { label: '鎶ユ鏃堕棿', prop: 'declareDate' }, { dataType: 'action', fixed: 'right', @@ -531,27 +513,27 @@ } ], page3: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, tableData4: [], tableLoading4: false, column4: [ - {label: '濮旀墭缂栧彿', prop: 'entrustCode'}, - {label: '妫�楠岀姸鎬�', prop: 'inspectStatus'}, - {label: '璁㈠崟鍙�', prop: 'orderNo'}, - {label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived'}, - {label: '涓嬪彂鏃堕棿', prop: 'sendTime'}, - {label: '鎵瑰彿', prop: 'updateBatchNo'}, - {label: '闆朵欢鍙�', prop: 'partNo'}, - {label: '闆朵欢鎻忚堪', prop: 'partDesc'}, - {label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'}, - {label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc'}, - {label: '鍏嶆', prop: 'isExemption'}, - {label: '鏍峰搧鍚嶇О', prop: 'sampleName'}, - {label: '鏍峰搧鍨嬪彿', prop: 'sampleModel'}, - {label: '妫�楠屼汉', prop: 'userName'}, + { label: '濮旀墭缂栧彿', prop: 'entrustCode' }, + { label: '妫�楠岀姸鎬�', prop: 'inspectStatus' }, + { label: '璁㈠崟鍙�', prop: 'orderNo' }, + { label: '鎶佃揪鐨勯噰璐暟閲�', prop: 'qtyArrived' }, + { label: '涓嬪彂鏃堕棿', prop: 'sendTime' }, + { label: '鎵瑰彿', prop: 'updateBatchNo' }, + { label: '闆朵欢鍙�', prop: 'partNo' }, + { label: '闆朵欢鎻忚堪', prop: 'partDesc' }, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName' }, + { label: '涓嶅悎鏍兼弿杩�', prop: 'unqualifiedDesc' }, + { label: '鍏嶆', prop: 'isExemption' }, + { label: '鏍峰搧鍚嶇О', prop: 'sampleName' }, + { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' }, + { label: '妫�楠屼汉', prop: 'userName' }, { dataType: 'tag', label: '鐗╂枡绫诲瀷', @@ -571,9 +553,9 @@ } } }, - {label: '鍗曚綅', prop: 'buyUnitMeas'}, - {label: '鎺ユ敹鏃堕棿', prop: 'receiverDate'}, - {label: '鎶ユ鏃堕棿', prop: 'declareDate'}, + { label: '鍗曚綅', prop: 'buyUnitMeas' }, + { label: '鎺ユ敹鏃堕棿', prop: 'receiverDate' }, + { label: '鎶ユ鏃堕棿', prop: 'declareDate' }, { dataType: 'action', fixed: 'right', @@ -614,9 +596,9 @@ } ], page4: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, entity: { updateBatchNo: null, @@ -652,16 +634,16 @@ value: 3 } ], - more:false, + more: false, tabIndex: 0, - multipleSelection:[], + multipleSelection: [], active: 0, //1锛氫笅鍗曪紝2锛氭煡鐪� orderType: 0, //0锛氬師鏉愭枡涓嬪崟锛�1锛氬搴︽楠屼笅鍗� currentId: null, btnLoading: false, quashDialogVisible: false, // 鎾ら攢涓嬪崟鎻愰啋寮规 declareDialogVisible: false, // 鎾ら攢鎶ユ鎻愰啋寮规 - insOrderRow:{}, + insOrderRow: {}, upLoad: false, filesDialogVisible: false, // 闄勪欢鏌ョ湅寮规 printDialog: false, // 鏍囩鎵撳嵃寮规 @@ -678,11 +660,11 @@ exemptionLoading: false, exemptionInfo: {}, inspectStatusList: [ - {label: '妫�楠屼腑', value: 0}, - {label: '鍚堟牸', value: 1}, - {label: '涓嶅悎鏍�', value: 2}, - {label: '鏈笅鍗�', value: 3}, - {label: '璁╂鏀捐', value: 4}, + { label: '妫�楠屼腑', value: 0 }, + { label: '鍚堟牸', value: 1 }, + { label: '涓嶅悎鏍�', value: 2 }, + { label: '鏈笅鍗�', value: 3 }, + { label: '璁╂鏀捐', value: 4 }, ], state: 0, orderId: 0, @@ -691,10 +673,10 @@ typeSource: null,// 0:鎴愬搧涓嬪崟锛�1锛氬師鏉愭枡涓嬪崟, 2: 閾滃崟涓濅笅鍗� InspectInfoDialog: false, // 鏁版嵁鏌ョ湅寮规 insInfo: {}, - outLoading:false + outLoading: false } }, - mounted () { + mounted() { this.refreshTable() }, // 鏂规硶闆嗗悎 @@ -719,9 +701,9 @@ } }, // 寰呬笅鍗曟煡璇� - getPurchaseOrderList () { + getPurchaseOrderList() { this.tableLoading = true - const params = {...this.entity, isInspect: 1, state: 0} + const params = { ...this.entity, isInspect: 1, state: 0 } getWarehouseSubmit(params).then(res => { this.tableLoading = false if (res.code === 200) { @@ -733,9 +715,9 @@ }) }, // 妫�楠屼腑鏌ヨ - getIfsByStateOneList () { + getIfsByStateOneList() { this.tableLoading1 = true - const params = {...this.entity, orderState: 1, state: 1} + const params = { ...this.entity, orderState: 1, state: 1 } getIfsByStateOne(params).then(res => { this.tableLoading1 = false if (res.code === 200) { @@ -747,9 +729,9 @@ }) }, // 宸叉楠屾煡璇� - getIfsByOverList () { + getIfsByOverList() { this.tableLoading2 = true - const params = {...this.entity, orderState: 4, state: 2} + const params = { ...this.entity, orderState: 4, state: 2 } getIfsByOver(params).then(res => { this.tableLoading2 = false if (res.code === 200) { @@ -761,9 +743,9 @@ }) }, // 鏌ヨ瀛e害妫�楠� - getIfsByQuarterList () { + getIfsByQuarterList() { this.tableLoading4 = true - const params = {...this.entity} + const params = { ...this.entity } getIfsByOver(params).then(res => { this.tableLoading4 = false if (res.code === 200) { @@ -775,9 +757,9 @@ }) }, // 鍏ㄩ儴 - getIfsByAllList () { + getIfsByAllList() { this.tableLoading3 = true - const params = {...this.entity, isInspect: 1} + const params = { ...this.entity, isInspect: 1 } getIfsByAll(params).then(res => { this.tableLoading3 = false if (res.code === 200) { @@ -793,52 +775,52 @@ this.resetForm('entity') this.refreshTable() }, - pagination (page) { + pagination(page) { this.page.size = page.limit this.refreshTable() }, - pagination1 (page) { + pagination1(page) { this.page1.size = page.limit this.refreshTable() }, - pagination2 (page) { + pagination2(page) { this.page2.size = page.limit this.refreshTable() }, - pagination3 (page) { + pagination3(page) { this.page3.size = page.limit this.refreshTable() }, - pagination4 (page) { + pagination4(page) { this.page4.size = page.limit this.refreshTable() }, // 鏌ョ湅妫�楠屾暟鎹� - viewInspectInfo (row) { + viewInspectInfo(row) { //褰撳墠妫�楠屼换鍔$殑妫�楠屼汉鍒楄〃 let inspectorList = [] - if(row.userName){ + if (row.userName) { inspectorList = row.userName.split(',') } let user = JSON.parse(localStorage.getItem('user')) - if(user){ + if (user) { inspectorList.push(user.name) } this.inspectorList = inspectorList this.insInfo = row this.InspectInfoDialog = true }, - closeInsInfoDialog () { + closeInsInfoDialog() { this.InspectInfoDialog = false }, // 鐩存帴鏀捐 - goPass (row) { + goPass(row) { this.$confirm('鏄惁鏀捐褰撳墠鏁版嵁?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - concessionRelease({ifsInventoryId: row.id}).then(res => { + concessionRelease({ ifsInventoryId: row.id }).then(res => { if (res.code === 200) { this.$message({ type: 'success', @@ -861,21 +843,21 @@ cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - repealQuarterRawOrder({quarterOrderId: row.quarterOrderId}).then(res => { + repealQuarterRawOrder({ quarterOrderId: row.quarterOrderId }).then(res => { if (res.code === 200) { this.$message.success('鎾ら攢鎴愬姛') this.refreshTable('page') } }) - }).catch(() => {}) + }).catch(() => { }) }, - viewInsInfo0 () { + viewInsInfo0() { this.state = 3; this.typeSource = this.insInfo.typeSource this.orderId = this.insInfo.enterOrderId this.InspectInfoDialog = false }, - viewInsInfo1 () { + viewInsInfo1() { this.state = 3; this.typeSource = this.insInfo.typeSource this.orderId = this.insInfo.quarterOrderId @@ -886,16 +868,16 @@ this.refreshTable('page') }, // 鍒锋柊椤甸潰 - refreshView () { + refreshView() { this.InspectionKey++ }, // 閾滄潗鏂欎笅鍗� - copper () { + copper() { this.$router.push("/materialOrder/copperOrder"); - this.$router.push({ path: "/materialOrder/copperOrder", query: {active: 1} }); + this.$router.push({ path: "/materialOrder/copperOrder", query: { active: 1 } }); }, // 鎵撳紑鏍囩鎵撳嵃寮规 - openPrint () { + openPrint() { if (this.multipleSelection.length > 0) { this.printDialog = true this.$nextTick(() => { @@ -907,29 +889,29 @@ } }, // 鍏抽棴鏍囩鎵撳嵃寮规 - closePrintDialog () { + closePrintDialog() { this.printDialog = false }, // 涓嬪崟 playOrder(row) { - this.$router.push({ path: "/materialOrder/customsInspection", query: {orderType: 0, customsInspection: row, active: 1} }); + this.$router.push({ path: "/materialOrder/customsInspection", query: { orderType: 0, customsInspection: row, active: 1 } }); }, // 瀛e害妫�楠屼笅鍗� - playOrderSec (row) { + playOrderSec(row) { if (typeof row !== "object") { - this.$router.push({ path: "/materialOrder/customsInspection", query: {active: row} }); + this.$router.push({ path: "/materialOrder/customsInspection", query: { active: row } }); } else { - this.$router.push({ path: "/materialOrder/customsInspection", query: {orderType: 1, customsInspection: row, active: 1} }); + this.$router.push({ path: "/materialOrder/customsInspection", query: { orderType: 1, customsInspection: row, active: 1 } }); } }, // 鎵撳紑鍏嶆寮规 - exemption (row) { + exemption(row) { this.exemptionVisible = true this.exemptionInfo = row this.$set(this.exemptionInfo, 'partDetail', row.partDesc) }, // 鎻愪氦鍏嶆淇℃伅 - submitExemption () { + submitExemption() { this.exemptionLoading = true rawOrderRelease({ ifsInventoryId: this.exemptionInfo.id, @@ -947,13 +929,13 @@ }) }, // 鎵撳紑鎾ら攢鎶ユ寮规 - cancelDeclare (row) { + cancelDeclare(row) { this.declareDialogVisible = true this.insOrderRow = row }, // 鎻愪氦鎾ら攢鎶ユ鐢宠 - submitDeclare () { - revokeInspectionReport({id: this.insOrderRow.id}).then(res => { + submitDeclare() { + revokeInspectionReport({ id: this.insOrderRow.id }).then(res => { if (res.code === 200) { this.declareDialogVisible = false this.refreshTable() @@ -964,7 +946,7 @@ }) }, // 鎵撳紑鎾ら攢涓嬪崟鐨勫脊妗� - cancelOrder (row) { + cancelOrder(row) { if (row.enterOrderId && row.quarterOrderId) { this.quashDialogVisible = true } else if (row.enterOrderId && !row.quarterOrderId) { @@ -973,56 +955,56 @@ cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - repealEnterRawOrder({enterOrderId: row.enterOrderId}).then(res => { + repealEnterRawOrder({ enterOrderId: row.enterOrderId }).then(res => { if (res.code === 200) { this.$message.success('鎾ら攢鎴愬姛') this.refreshTable('page') } }) - }).catch(() => {}) + }).catch(() => { }) } else if (!row.enterOrderId && row.quarterOrderId) { this.$confirm('鏄惁鎾ら攢瀛e害涓嬪崟?', "璀﹀憡", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - repealQuarterRawOrder({quarterOrderId: row.quarterOrderId}).then(res => { + repealQuarterRawOrder({ quarterOrderId: row.quarterOrderId }).then(res => { if (res.code === 200) { this.$message.success('鎾ら攢鎴愬姛') this.refreshTable('page') } }) - }).catch(() => {}) + }).catch(() => { }) } this.insOrderRow = row }, - cancelQuashOrder (type) { + cancelQuashOrder(type) { if (type === 'enterOrderId') { this.$confirm('鏄惁鎾ら攢褰撳墠鏁版嵁?', "璀﹀憡", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - repealEnterRawOrder({enterOrderId: this.insOrderRow.enterOrderId}).then(res => { + repealEnterRawOrder({ enterOrderId: this.insOrderRow.enterOrderId }).then(res => { if (res.code === 200) { this.$message.success('鎾ら攢鎴愬姛') this.refreshTable('page') } }) - }).catch(() => {}) + }).catch(() => { }) } else { this.$confirm('鏄惁鎾ら攢褰撳墠鏁版嵁?', "璀﹀憡", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" }).then(() => { - repealQuarterRawOrder({quarterOrderId: this.insOrderRow.quarterOrderId}).then(res => { + repealQuarterRawOrder({ quarterOrderId: this.insOrderRow.quarterOrderId }).then(res => { if (res.code === 200) { this.$message.success('鎾ら攢鎴愬姛') this.refreshTable('page') } }) - }).catch(() => {}) + }).catch(() => { }) } }, // 鐐瑰嚮鏍峰搧鍚嶇О鏌ョ湅璇︽儏 @@ -1040,16 +1022,16 @@ this.dataDialogVisible = true; }, // 鍏抽棴鏁版嵁鏌ョ湅寮规 - closeDataLook () { + closeDataLook() { this.dataDialogVisible = false }, // 闄勪欢鏌ョ湅 - handleFileLook (row) { + handleFileLook(row) { this.filesDialogVisible = true this.filesLookInfo = row }, // 鍏抽棴闄勪欢鏌ョ湅寮规 - closeFilesLook () { + closeFilesLook() { this.filesDialogVisible = false }, // 鎶ュ憡涓嬭浇 @@ -1058,32 +1040,32 @@ this.downLoadInfo = row }, // 鍏抽棴鎶ュ憡涓嬭浇寮规 - closeDownFileDialog () { + closeDownFileDialog() { this.downFileDialogVisible = false }, // 鏌ョ湅浜т笟閾句俊鎭� - openInfoDialog (row) { + openInfoDialog(row) { this.showInfoDialog = true this.$nextTick(() => { this.$refs.showInfoDialog.getInfo(row.id) }) }, // 淇敼濮旀墭缂栧彿 - changeEntrustCode (row) { + changeEntrustCode(row) { this.entrustCodeVisible = true - this.entrustCodeInfo = {...row} + this.entrustCodeInfo = { ...row } }, // 瀵煎嚭 - handleOut(){ - let entity = this.tabIndex === 3 ? {...this.entity, isInspect: 2} : {...this.entity,state: 2, orderState: 4,} + handleOut() { + let entity = this.tabIndex === 3 ? { ...this.entity, isInspect: 2 } : { ...this.entity, state: 2, orderState: 4, } delete entity.orderBy this.outLoading = true rawAllExport({ - entity:entity - },{responseType: "blob"}).then(res => { + entity: entity + }, { responseType: "blob" }).then(res => { this.outLoading = false this.$message.success('瀵煎嚭鎴愬姛') - const blob = new Blob([res],{ type: 'application/octet-stream' }); + const blob = new Blob([res], { type: 'application/octet-stream' }); const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; @@ -1092,7 +1074,7 @@ }) }, // 鎻愪氦淇敼濮旀墭缂栧彿淇℃伅 - submitCode () { + submitCode() { this.submitCodeLoading = true try { updateEntrustCode({ @@ -1115,7 +1097,7 @@ this.refreshTable() }, // 琛ㄦ牸閫夋嫨鏂规硶 - selectMethod(val){ + selectMethod(val) { this.multipleSelection = val }, }, @@ -1127,6 +1109,7 @@ display: flex; justify-content: space-between; } + .tab { list-style-type: none; display: flex; diff --git a/src/views/business/unpass/components/PurchaseVerification.vue b/src/views/business/unpass/components/PurchaseVerification.vue new file mode 100644 index 0000000..2e66c74 --- /dev/null +++ b/src/views/business/unpass/components/PurchaseVerification.vue @@ -0,0 +1,376 @@ +<template> + <div> + <el-dialog title="杩涜揣楠岃瘉鍘熷璁板綍" :visible.sync="isShow" width="1000px" :show-close="false" :close-on-click-modal="false" + style="max-height: 96vh; margin-top: 2vh" :modal-append-to-body="false" :close-on-press-escape="false"> + <div class="search"> + <el-form :inline="true" :model="purchaseForm" label-position="right" :rules="purchaseFormRules" + ref="purchaseForm" class="form-inline" label-width="130px"> + <el-row> + <el-col :span="8"> + <el-form-item label="妫�楠岀紪鍙�:"> + <el-input clearable v-model="purchaseForm.entrustCode" disabled size="small" + placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="鏉愭枡鍘傚:"> + <el-input clearable v-model="purchaseForm.supplierName" disabled size="small" + placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="鍒拌揣鏃ユ湡:"> + <el-input clearable v-model="purchaseForm.declareDate" disabled size="small" + placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="鏉愭枡鍚嶇О:"> + <el-input clearable v-model="purchaseForm.sample" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="瑙勬牸鍨嬪彿:"> + <el-input clearable v-model="purchaseForm.model" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="鏉愭枡鎵瑰彿:"> + <el-input clearable v-model="purchaseForm.updateBatchNo" disabled size="small" + placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-col> + </el-row> + <div> + <el-form-item class="headLine" label="楠岃瘉渚濇嵁鏂囦欢缂栧彿:" label-width="160px" style="width: 100%" + prop="verifyFileCode"> + <el-input clearable v-model="purchaseForm.verifyFileCode" size="small" + :disabled="operationType === 'view'" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </div> + <h4> + <span style="display: flex;align-items: center;"> + <span class="line"></span><span>楠岃瘉鍐呭</span> + </span> + </h4> + <div class="title">涓�銆佷緵鏂逛骇鍝佹娴嬫姤鍛婄殑鍩烘湰淇℃伅纭</div> + <el-form-item label="鏉愭枡鍚嶇О:" prop="basicName"> + <el-radio-group v-model="purchaseForm.basicName" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="瑙勬牸鍨嬪彿:" prop="basicModel"> + <el-radio-group v-model="purchaseForm.basicModel" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="鏉愭枡鎵瑰彿:" prop="basicBatchNo"> + <el-radio-group v-model="purchaseForm.basicBatchNo" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="鎵ц鏍囧噯:" prop="basicStandard"> + <el-radio-group v-model="purchaseForm.basicStandard" :disabled="operationType === 'view'" + v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="鐢熶骇鏃ユ湡:" prop="basicDate"> + <el-radio-group v-model="purchaseForm.basicDate" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="渚涜揣鏁伴噺:" prop="basicNumber"> + <el-radio-group v-model="purchaseForm.basicNumber" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="鏉愭枡棰滆壊:" prop="basicColor"> + <el-radio-group v-model="purchaseForm.basicColor" :disabled="operationType === 'view'" v-removeAriaHidden> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </el-form-item> + <div> + <el-form-item label="鍏朵粬:"> + <el-input clearable v-model="purchaseForm.basicOtherValue" size="small" + :disabled="operationType === 'view'" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item> + <el-radio-group v-model="purchaseForm.basicOther" :disabled="operationType === 'view'"> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + </el-radio-group> + </el-form-item> + <div class="titleSec"> + <span>浜屻�佷緵鏂逛骇鍝佹娴嬫姤鍛婁腑鍚勯」鎬ц兘鎸囨爣鐨勯獙璇�</span> + <span> + <el-button type="primary" size="small" @click="addItem" + v-if="operationType === 'add'">鎵嬪姩娣诲姞妫�楠岄」鐩�</el-button> + <el-button type="primary" @click="addFactoryVerifyItem" v-if="operationType === 'add'" + size="small">娣诲姞楠岃瘉椤圭洰</el-button> + </span> + </div> + <div> + <el-table :data="factoryVerifyItemList" style="width: 98%" v-loading="tableLoading"> + <el-table-column type="index" label="搴忓彿" width="180" align="center"></el-table-column> + <el-table-column prop="inspectionItem" label="楠岃瘉椤圭洰" width="300"></el-table-column> + <el-table-column prop="result" label="楠岃瘉缁撴灉"> + <template slot-scope="scope"> + <el-radio-group v-model="scope.row.result" v-removeAriaHidden :disabled="operationType === 'view'"> + <el-radio label="1">绗﹀悎</el-radio> + <el-radio label="2">涓嶇鍚�</el-radio> + <el-radio label="3">涓嶉�傜敤</el-radio> + </el-radio-group> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" width="120" v-if="operationType === 'add'"> + <template slot-scope="scope"> + <el-button @click.native.prevent="deleteRow(scope.$index)" type="text" size="small">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </div> + </div> + </el-form> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="$emit('resetPurchaseDialog')">鍙� 娑�</el-button> + <el-button type="primary" @click="handlePurchase" :loading="handlePurchaseLoading" + v-if="operationType === 'add'">纭� + 瀹�</el-button> + </span> + </el-dialog> + <el-dialog title="寰呴獙璇侀」鐩�" :visible.sync="factoryVerifyItemDia" width="1000px" + style="max-height: 96vh; margin-top: 2vh" :show-close="false" :close-on-click-modal="false" + :close-on-press-escape="false"> + <el-table :data="tableList" style="width: 100%" v-loading="tableLoading" + @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55"></el-table-column> + <el-table-column type="index" label="搴忓彿" width="60" align="center"></el-table-column> + <el-table-column prop="inspectionItem" label="楠岃瘉椤圭洰"></el-table-column> + </el-table> + <span slot="footer" class="dialog-footer"> + <el-button @click="factoryVerifyItemDia = false">鍙� 娑�</el-button> + <el-button type="primary" @click="handleFactoryVerifyItem" :loading="handleFactoryVerifyLoading">娣� 鍔�</el-button> + </span> + </el-dialog> + <el-dialog title="鎵嬪姩娣诲姞楠岃瘉椤圭洰" :visible.sync="inspectionItemDia" width="500px" @close="resetInput" :show-close="false" + :close-on-click-modal="false" :close-on-press-escape="false"> + <el-input v-model="inspectionItem"></el-input> + <span slot="footer" class="dialog-footer"> + <el-button @click="inspectionItemDia = false">鍙� 娑�</el-button> + <el-button type="primary" @click="handleAdd">娣� 鍔�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import { getFactoryVerify, addFactoryVerify } from '@/api/business/unpass.js' +import { + getInsProduct, +} from "@/api/business/inspectionTask.js"; +export default { + name: "PurchaseVerification", + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + props: { + purchaseDialog: { + type: Boolean, + default: () => false + }, + orderId: { + type: String, + default: () => null + }, + }, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + type: '', + info: {}, + isShow: this.purchaseDialog, + purchaseForm: { + entrustCode: '', // 妫�楠岀紪鍙� + supplierName: '', // 鏉愭枡鍘傚 + declareDate: '', // 鍒拌揣鏃ユ湡 + sample: '', // 鏉愭枡鍚嶇О + model: '', // 瑙勬牸鍨嬪彿 + updateBatchNo: '', // 鏉愭枡鎵瑰彿 + verifyFileCode: '', // 楠岃瘉渚濇嵁鏂囦欢缂栧彿 + // 纭淇℃伅 + basicName: '', // 鏉愭枡鍚嶇О + basicModel: '', // 瑙勬牸鍨嬪彿 + basicBatchNo: '', // 鏉愭枡鎵瑰彿 + basicStandard: '', // 鎵ц鏍囧噯 + basicDate: '', // 鐢熶骇鏃ユ湡 + basicNumber: '', // 渚涜揣鏁伴噺 + basicColor: '', // 鏉愭枡棰滆壊 + basicOtherValue: '', // 鍏朵粬鍚嶇О + basicOther: '', // 鍏朵粬 + }, + purchaseFormRules: { + verifyFileCode: [{ required: true, message: '璇峰~鍐欓獙璇佷緷鎹枃浠剁紪鍙�', trigger: 'blur' }], + basicName: [{ required: false, message: '璇烽�夋嫨鏉愭枡鍚嶇О楠岃瘉淇℃伅', trigger: 'change' }], + basicModel: [{ required: false, message: '璇烽�夋嫨瑙勬牸鍨嬪彿楠岃瘉淇℃伅', trigger: 'change' }], + basicStandard: [{ required: false, message: '璇烽�夋嫨鎵ц鏍囧噯楠岃瘉淇℃伅', trigger: 'change' }], + basicDate: [{ required: false, message: '璇烽�夋嫨鐢熶骇鏃ユ湡楠岃瘉淇℃伅', trigger: 'change' }], + basicNumber: [{ required: false, message: '璇烽�夋嫨渚涜揣鏁伴噺楠岃瘉淇℃伅', trigger: 'change' }], + basicColor: [{ required: false, message: '璇烽�夋嫨鏉愭枡棰滆壊楠岃瘉淇℃伅', trigger: 'change' }], + }, + factoryVerifyItemList: [], // 渚涙柟浜у搧妫�娴嬫姤鍛婁腑鍚勯」鎬ц兘鎸囨爣鐨勯獙璇� + tableList: [], // + multipleSelection: [], // + operationType: '', + handlePurchaseLoading: false, + tableLoading: false, + factoryVerifyItemDia: false, // 娣诲姞楠岃瘉椤圭洰寮规 + handleFactoryVerifyLoading: false, + inspectionItemDia: false, + inspectionItem: '' + } + }, + // 鏂规硶闆嗗悎 + methods: { + async getInsOrder(operationType, item) { + this.operationType = operationType + this.info = item + // 鏌ヨ宸叉彁浜ょ殑鏁版嵁 + let factoryVerify = await getFactoryVerify({ insOrderId: this.orderId }) + this.purchaseForm = factoryVerify.data + this.factoryVerifyItemList = factoryVerify.data.factoryVerifyItemList || [] + }, + // 鎵撳紑娣诲姞楠岃瘉椤圭洰寮规 + async addFactoryVerifyItem() { + this.factoryVerifyItemDia = true + this.tableList = [] + if (this.info.cableTag === undefined) { + this.info.cableTag = '' + } + this.tableLoading = true; + const type1 = 5 + // 鏌ヨ妫�楠岄」鐩� + let res = await getInsProduct({ id: this.info.id, type: type1, laboratory: this.info.sonLaboratory, cableTag: this.info.cableTag, rawMaterialTag: this.info.rawMaterialTag }) + if (res.data.length > 0) { + res.data.map((item) => { + if (item.inspectionItemSubclass) { + item.inspectionItem = item.inspectionItem + '-' + item.inspectionItemSubclass + } + const obj = Object.assign({ + inspectionItem: item.inspectionItem, + result: item.result, + }) + this.tableList.push(obj) + }) + this.tableLoading = false; + } + }, + handleSelectionChange(val) { + console.log('val---', val) + this.multipleSelection = val; + }, + addItem() { + this.inspectionItemDia = true + }, + deleteRow(index) { + this.factoryVerifyItemList.splice(index, 1); + }, + handleAdd() { + if (!this.inspectionItem) { + this.$message.warning('璇峰~鍐欏唴瀹�') + return + } + this.factoryVerifyItemList.push({ + inspectionItem: this.inspectionItem, + result: null, + }) + this.inspectionItemDia = false + }, + resetInput() { + this.inspectionItem = '' + this.inspectionItemDia = false + }, + // 鎻愪氦娣诲姞瑕侀獙璇佺殑妫�楠岄」 + handleFactoryVerifyItem() { + if (this.multipleSelection.length === 0) { + this.$message.warning('璇烽�夋嫨鏁版嵁') + } else { + this.factoryVerifyItemList = JSON.parse(JSON.stringify(this.multipleSelection)) + this.factoryVerifyItemDia = false + } + }, + handlePurchase() { + this.$refs['purchaseForm'].validate((valid) => { + if (valid) { + if (this.factoryVerifyItemList.some(item => item.result === undefined || item.result === null || item.result === '')) { + this.$message.warning('璇烽�夋嫨渚涙柟浜у搧楠岃瘉缁撴灉') + return + } + this.factoryVerifyItemList.forEach((item, index) => { + item.sort = index + }) + this.purchaseForm.factoryVerifyItemList = JSON.parse(JSON.stringify(this.factoryVerifyItemList)) + this.handlePurchaseLoading = true + addFactoryVerify(this.purchaseForm).then(res => { + if (res.code === 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.$emit('resetPurchaseDialog') + } + this.handlePurchaseLoading = false + }) + } else { + console.log('error submit!!'); + return false; + } + }); + }, + }, +} +</script> + +<style scoped> +.headLine>>>.el-form-item__content { + width: 68%; +} + +>>>.el-form-item__content { + display: inline-block; +} + +h4 .line { + display: inline-block; + width: 3px; + height: 16px; + background: #3A7BFA; + margin-right: 4px; +} + +.title { + margin: 10px 0; +} + +.titleSec { + margin: 10px 0; + display: flex; + justify-content: space-between; +} + +>>>.el-dialog__body { + max-height: 700px; + overflow-y: auto; +} +</style> diff --git a/src/views/business/unpass/components/addUnPass.vue b/src/views/business/unpass/components/addUnPass.vue new file mode 100644 index 0000000..c1777e9 --- /dev/null +++ b/src/views/business/unpass/components/addUnPass.vue @@ -0,0 +1,124 @@ +<template> + <div> + <el-dialog title="鏂板涓嶅悎鏍煎娴�" :visible.sync="isShow" width="70%" :show-close="false" :close-on-click-modal="false" + :close-on-press-escape="false"> + <div class="table"> + <el-table class="el-table" ref="productTable" :data="productList" max-height="800px" tooltip-effect="dark" + border v-loading="tableLoading" @selection-change="selectProduct" style="margin-bottom: 10px;" + @select-all="handleAll"> + <el-table-column type="selection" width="65"></el-table-column> + <el-table-column prop="inspectionItemClass" label="妫�楠岄」鍒嗙被" min-width="140" + show-overflow-tooltip></el-table-column> + <el-table-column prop="inspectionItem" label="妫�楠岄」" min-width="140" show-overflow-tooltip></el-table-column> + <el-table-column prop="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140" + show-overflow-tooltip></el-table-column> + <el-table-column prop="tell" label="瑕佹眰鎻忚堪" min-width="220px"></el-table-column> + <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px"></el-table-column> + <el-table-column prop="lastValue" label="妫�楠岀粨鏋�" min-width="140" show-overflow-tooltip></el-table-column> + <el-table-column prop="insResult" label="缁撴灉鍒ゅ畾" min-width="140" show-overflow-tooltip> + <template> + <el-tag type="danger">涓嶅悎鏍�</el-tag> + </template> + </el-table-column> + </el-table> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="$emit('resetAddUnPass')">鍙� 娑�</el-button> + <el-button type="primary" @click="submitHandle" :loading="handlePassLoading">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import { getInsProductUnqualified } from '@/api/business/unpass.js' +export default { + name: "addUnPass", + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + props: { + addUnPassDialog: { + type: Boolean, + default: () => false + }, + }, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + type: '', + isShow: this.addUnPassDialog, + handlePassLoading: false, + productList: [], + productListSelected: [], + productIds: [], + tableLoading: false + } + }, + mounted() { + }, + // 鏂规硶闆嗗悎 + methods: { + getInsOrder(info) { + this.tableLoading = true + try { + getInsProductUnqualified({ id: info.id, type: info.type, laboratory: info.laboratory, rawMaterialTag: info.rawMaterialTag }).then(res => { + if (res.code === 200) { + this.productList = res.data + } + this.tableLoading = false + }) + } catch (err) { + this.tableLoading = false + } + }, + // 鎻愪氦涓嶅悎鏍煎鐞� + submitHandle() { + if (this.productListSelected.length === 0) { + this.$message.warning('璇烽�夋嫨闇�瑕佸娴嬬殑妫�楠岄」') + return + } + this.$confirm('纭鎻愪氦涓嶅悎鏍煎娴�?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + this.handlePass() + }).catch(() => { + + }); + }, + handlePass() { + this.handlePassLoading = true + try { + addUnqualifiedRetest({ + ids: this.productIds + }).then(res => { + if (res.code === 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.$emit('resetAddUnPass') + } + this.handlePassLoading = false + }) + } catch (e) { + this.handlePassLoading = false + } + }, + selectProduct(val) { + this.productListSelected = val + this.productIds = [] + val.forEach(a => { + this.productIds.push(a.id) + }) + }, + handleAll(val) { + this.productListSelected = val + this.productIds = [] + val.forEach(a => { + this.productIds.push(a.id) + }) + }, + }, +} +</script> + +<style scoped></style> diff --git a/src/views/business/unpass/components/unPassDialog.vue b/src/views/business/unpass/components/unPassDialog.vue new file mode 100644 index 0000000..39a57b1 --- /dev/null +++ b/src/views/business/unpass/components/unPassDialog.vue @@ -0,0 +1,275 @@ +<template> + <div> + <el-dialog title="鏂板涓嶅悎鏍煎鐞�" :visible.sync="isShow" width="740px" :show-close="false" :close-on-click-modal="false" + :close-on-press-escape="false"> + <div class="search"> + <el-form :inline="true" :model="unPassForm" :rules="unPassFormRules" ref="unPassForm" class="form-inline" + label-width="120px"> + <div> + <el-form-item class="headLine" label="鏍囬:" style="width: 100%" prop="headline"> + <el-input clearable v-model="unPassForm.headline" size="small" :disabled="type === 'view'" type="textarea" + placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </div> + <el-form-item label="渚涘簲鍟嗗悕绉�:"> + <el-input clearable v-model="unPassForm.supplierName" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item label="鐗╂枡鍚嶇О:"> + <el-tooltip class="item" effect="dark" placement="top" :content="unPassForm.materialName"> + <el-input clearable v-model="unPassForm.materialName" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-tooltip> + </el-form-item> + <el-form-item label="鐢熶骇鎵规:"> + <el-input clearable v-model="unPassForm.productionBatch" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item label="鍒拌揣鏁伴噺:"> + <el-input clearable v-model="unPassForm.cargoQuantity" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item label="瑙勬牸鍨嬪彿:"> + <el-input clearable v-model="unPassForm.specsModels" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item label="鎶ユ鏃堕棿:"> + <el-date-picker v-model="unPassForm.inspectTime" format="yyyy-MM-dd" value-format="yyyy-MM-dd" size="small" + disabled style="width: 175px" type="date" placeholder="閫夋嫨鏃ユ湡"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍙嶉浜�:"> + <el-input clearable v-model="unPassForm.feedbackUser" disabled size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + <el-form-item label="鍙嶉鏃堕棿:" prop="feedbackTime"> + <el-date-picker v-model="unPassForm.feedbackTime" :disabled="type === 'view'" format="yyyy-MM-dd" + value-format="yyyy-MM-dd HH:mm:ss" size="small" style="width: 175px" type="date" placeholder="閫夋嫨鏃ユ湡"> + </el-date-picker> + </el-form-item> + <el-form-item label="鍒嗙被:" prop="classification"> + <el-select v-model="unPassForm.classification" :disabled="type === 'view'" size="small" placeholder="璇烽�夋嫨"> + <el-option v-for="item in classificationOptions" :key="item.value" :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="涓嶅悎鏍煎綊灞�:" prop="offGradeAscription"> + <el-select v-model="unPassForm.offGradeAscription" :disabled="type === 'view'" size="small" + placeholder="璇烽�夋嫨"> + <el-option v-for="item in offGradeAscriptionOptions" :key="item.value" :label="item.label" + :value="item.value"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="涓嶅悎鏍兼儏鍐垫弿杩�:" prop="unqualifiedDesc"> + <el-input clearable type="textarea" v-model="unPassForm.unqualifiedDesc" :disabled="type === 'view'" + style="width: 484px" size="small" placeholder="璇疯緭鍏�"></el-input> + </el-form-item> + </el-form> + <el-upload v-if="type === 'add'" ref="upload" :action="action2" :on-change="beforeUpload" :on-error="onError" + :on-remove="handleRemoveFile" :on-success="getUnpassUrl" :headers="headers" :file-list="unPassFilesList"> + <el-button size="small" type="primary" style="text-align: left">闄勪欢涓婁紶</el-button> + </el-upload> + <div v-if="type !== 'add'"> + <div style="padding-left: 40px;margin-bottom: 4px">闄勪欢锛�</div> + <div style="padding-left: 40px;margin-bottom: 4px" v-for="item in unqualifiedHandlerFiles"> + <span>{{ item.fileName }}</span><el-link type="primary" style="margin-left: 20px;vertical-align: top" + :underline="false" @click="handleDown(item)">涓嬭浇</el-link> + </div> + </div> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="$emit('resetForm')">鍙� 娑�</el-button> + <el-button type="primary" @click="handlunPass" :loading="handlunPassLoading" v-if="type === 'add'">纭� + 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import { getInsOrder, getUnqualifiedHandler, downFile, addUnqualifiedHandler } from '@/api/business/unpass.js' +export default { + name: "unPassDialog", + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + props: { + unPassDialog: { + type: Boolean, + default: () => false + }, + orderId: { + type: String, + default: () => null + }, + }, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + type: '', + isShow: this.unPassDialog, + unPassForm: { // 涓嶅悎鏍煎鐞嗘暟鎹� + headline: '', // 鏍囬 + inventoryQuantityId: '', // 鍘熸潗鏂檌d,涓嶅仛灞曠ず锛屽彧浼犲�� + supplierName: '', // 渚涘簲鍟嗗悕绉� + materialName: '', // 鐗╂枡鍚嶇О + productionBatch: '', // 鐢熶骇鎵规 + cargoQuantity: '', // 鍒拌揣鏁伴噺 + specsModels: '', // 瑙勬牸鍨嬪彿 + inspectTime: '', // 鎶ユ鏃堕棿 + feedbackUser: '', // 鍙嶉浜� + feedbackTime: '', // 鍙嶉鏃堕棿 + classification: '', // 鍒嗙被 + offGradeAscription: '', // 涓嶅悎鏍煎綊灞� + unqualifiedDesc: '', // 涓嶅悎鏍兼儏鍐垫弿杩� + unqualifiedHandlerFiles: [], // 涓嶅悎鏍奸檮浠禪RL + }, + unPassFormRules: { + offGradeAscription: [ + { required: true, message: '璇烽�夋嫨涓嶅悎鏍煎綊灞�', trigger: 'change' } + ], + headline: [ + { required: true, message: '璇峰~鍐欐爣棰�', trigger: 'blur' } + ] + }, + unPassFilesList: [], // 涓嶅悎鏍煎鐞嗛檮浠舵暟鎹� + classificationOptions: [], // 涓嶅悎鏍煎垎绫讳笅鎷夋 + offGradeAscriptionOptions: [], // 涓嶅悎鏍煎綊灞炰笅鎷夋 + handlunPassLoading: false, + unqualifiedHandlerFiles: [] + } + }, + mounted() { + this.getClassificationOptions() // 鑾峰彇涓嶅悎鏍煎垎绫讳笅鎷夋閫夐」 + this.getOffGradeAscriptionOptions() // 鑾峰彇涓嶅悎鏍煎綊灞炰笅鎷夋閫夐」 + }, + // 鏂规硶闆嗗悎 + methods: { + getInsOrder(type, row) { + this.type = type + if (type === 'add') { + // 璧嬪�奸粯璁ゆ暟鎹� + getInsOrder({ + orderId: this.orderId + }).then(res => { + if (res.code === 200) { + this.unPassForm.headline = `No.0005-涓ぉ瑁呭鐢电嚎-澶栬喘鍝佷笉鍚堟牸鍙嶉璇勫鍙婄籂姝i闃叉祦绋�(姝e紡鐗�)-${JSON.parse(localStorage.getItem("user")).name}-${new Date().toISOString().substring(0, 10)}` // 鏍囬 + this.unPassForm.inventoryQuantityId = res.data.insOrderTemplate.inventoryQuantityId // 鍘熸潗鏂檌d + this.unPassForm.insOrderId = res.data.insOrder.id // 璁㈠崟id + this.unPassForm.supplierName = res.data.insOrderTemplate.supplierName // 渚涘簲鍟嗗悕绉� + this.unPassForm.materialName = res.data.insOrder.sampleType // 鐗╂枡鍚嶇О + this.unPassForm.productionBatch = res.data.insOrderTemplate.updateBatchNo // 鐢熶骇鎵规 + this.unPassForm.cargoQuantity = res.data.insOrderTemplate.qtyArrived + res.data.insOrderTemplate.buyUnitMeas // 鍒拌揣鏁伴噺 + this.unPassForm.specsModels = res.data.insOrder.partDetail // 瑙勬牸鍨嬪彿 + this.unPassForm.inspectTime = res.data.insOrderTemplate.sendTime.substring(0, 10) // 鎶ユ鏃堕棿 + this.unPassForm.feedbackTime = new Date().toISOString().substring(0, 10) // 鎶ユ鏃堕棿 + this.unPassForm.feedbackUser = JSON.parse(localStorage.getItem("user")).name // 鍙嶉浜� + } + }) + } else { + this.getInfo(row.handlerId) + this.unPassForm = { ...row } + } + }, + getInfo(handlerId) { + getUnqualifiedHandler({ + id: handlerId + }).then(res => { + if (res.code === 200) { + this.unqualifiedHandlerFiles = this.HaveJson(res.data.unqualifiedHandlerFiles) + } + }) + }, + handleDown(row) { + downFile({ + id: row.id, + }).then(res => { + if (res.code === 200) { + let url = ''; + if (res.data.type == 1) { + url = this.javaApi + '/img/' + res.data.fileUrl + this.$download.saveAs(url, row.fileName); + } else { + url = this.javaApi + '/word/' + res.data.fileUrl + this.$download.saveAs(url, row.fileName); + } + } + }).catch(error => { + + }) + }, + // 鎻愪氦涓嶅悎鏍煎鐞� + handlunPass() { + this.$refs['unPassForm'].validate((valid) => { + if (valid) { + this.unPassForm.unqualifiedHandlerFiles.forEach(item => { + delete item.orderBy + }) + this.handlunPassLoading = true + addUnqualifiedHandler(this.unPassForm).then(res => { + if (res.code === 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.$emit('resetForm') + } + this.handlunPassLoading = false + }) + } else { + console.log('error submit!!'); + return false; + } + }); + }, + getUnpassUrl(response, file, fileList) { + // 闄勪欢涓婁紶鎴愬姛鍚庯紝灏唘rl鍦ㄦ彁浜や笉鍚堟牸澶勭悊鏃朵紶缁欏悗鍙� + if (response.code == 200) { + this.$message.success('涓婁紶鎴愬姛') + this.unPassForm.unqualifiedHandlerFiles.push(response.data) + } + }, + // 绉婚櫎闄勪欢 + handleRemoveFile(file) { + const index = this.unPassForm.unqualifiedHandlerFiles.findIndex(val => val === file.response.data) + if (index > -1) { + this.unPassForm.unqualifiedHandlerFiles.splice(index, 1) + } + }, + beforeUpload(file) { + if (file.size > 1024 * 1024 * 10) { + this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M'); + this.$refs.upload.clearFiles() + return false; + } else { + this.upLoading = true; + return true; + } + }, + onError(err, file, fileList) { + this.$message.error('涓婁紶澶辫触') + this.$refs.upload.clearFiles() + }, + getClassificationOptions() { + // 涓嶅悎鏍煎垎绫� + this.getDicts("categories_no_conformities").then((response) => { + this.classificationOptions = this.dictToValue(response.data); + }); + }, + getOffGradeAscriptionOptions() { + // 涓嶅悎鏍煎綊灞� + this.getDicts("attribution_no_conformities").then((response) => { + this.offGradeAscriptionOptions = this.dictToValue(response.data); + }); + }, + }, + computed: { + headers() { + return { + 'token': sessionStorage.getItem('token') + } + }, + action2() { + return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified' + } + }, +} +</script> + +<style scoped> +.headLine>>>.el-form-item__content { + width: 68%; +} +</style> diff --git a/vue.config.js b/vue.config.js index 14e2478..018c3bb 100644 --- a/vue.config.js +++ b/vue.config.js @@ -59,6 +59,19 @@ "@": resolve("src"), }, }, + module: { + rules: [ + { + test: /\.worker\.js$/, + use: { + loader: "worker-loader", + options: { + inline: "fallback", + }, + }, + }, + ], + }, plugins: [ // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#浣跨敤gzip瑙e帇缂╅潤鎬佹枃浠� new CompressionPlugin({ -- Gitblit v1.9.3