From 41e0df8413624e6034c967f3afae30da59370879 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 11 十二月 2023 16:20:15 +0800
Subject: [PATCH] 	modified:   src/components/verifition/Verify/VerifyPoints.vue 	modified:   src/const/crud/admin/sys-public-param.js 	modified:   src/page/full-screen/fullScreenPlus.vue 	modified:   src/page/index/logo.vue 	modified:   src/page/index/sidebar/sidebarItem.vue 	modified:   src/page/login/index.vue 	modified:   src/page/login/thirdpartylogin.vue 	modified:   src/util/elAttr.js 	modified:   src/views/accounting/unitworkfactor/unitworkfactor-form.vue 	modified:   src/views/accounting/unitworkfactor/updateQuota-form.vue 	modified:   src/views/basic/discmaintenance/discmaintenance-form.vue 	modified:   src/views/basic/log/index.vue 	modified:   src/views/basic/part/part-form.vue 	modified:   src/views/basic/part/print-label-form.vue 	modified:   src/views/basic/poc/index.vue 	modified:   src/views/basic/tabletest/index.vue 	modified:   src/views/basic/template/index.vue 	modified:   src/views/basic/template/template-form.vue 	modified:   src/views/basic/workstation/workstation-form.vue 	modified:   src/views/common/custom-table.vue 	modified:   src/views/common/documentDetail.vue 	modified:   src/views/common/operationParamTemplate.vue 	modified:   src/views/common/rawMaterial-part.vue 	modified:   src/views/common/search-select.vue 	modified:   src/views/common/ztt-table.vue 	modified:   src/views/huawei/code19bind/list.vue 	modified:   src/views/huawei/code19gen/form.vue 	modified:   src/views/huawei/grossweightcode/list.vue 	modified:   src/views/huawei/grossweightcode/task-secret-form.vue 	modified:   src/views/oa/JiegouModal.vue 	modified:   src/views/oa/PeizhiModal.vue 	modified:   src/views/oa/technology-document-new.vue 	modified:   src/views/oa/technology-document.vue 	modified:   src/views/plan/customer/index.vue 	modified:   src/views/plan/customerorder/confirm-pull-customerorder.vue 	modified:   src/views/plan/customerorder/customerorder-config-history.vue 	modified:   src/views/plan/customerorder/customerorder-form.vue 	modified:   src/views/plan/customerorder/customerorder-return.vue 	modified:   src/views/plan/customerorder/customerorder-ztt-table.vue 	modified:   src/views/plan/customerorder/index.vue 	modified:   src/views/plan/customerorder/other-customer-order-line.vue 	modified:   src/views/plan/customerorder/sample-customerorder-form.vue 	modified:   src/views/plan/customerorder/schedule-table.vue 	modified:   src/views/plan/manufacturingorder/auto-operationtask.vue 	modified:   src/views/plan/manufacturingorder/customerorder.vue 	modified:   src/views/plan/manufacturingorder/customize-param-template.vue 	modified:   src/views/plan/manufacturingorder/order-operation-form.vue 	modified:   src/views/plan/manufacturingorder/productorder-form.vue 	modified:   src/views/plan/manufacturingorderapply/index.vue 	modified:   src/views/plan/masterproductionschedule/auto-manufacturingorder.vue 	modified:   src/views/plan/operationtask/gantt.vue 	modified:   src/views/plan/operationtask/operationtask-form.vue 	modified:   src/views/plan/operationtask/task-material.vue 	modified:   src/views/plan/productionschedul/index.vue 	modified:   src/views/plan/productionschedul/template-form.vue 	modified:   src/views/plan/schedule/gantt.vue 	modified:   src/views/plan/schedulelookover/ganttview.vue 	modified:   src/views/plan/segmentmerge/index.vue 	modified:   src/views/plan/segmentmerge/operate-dialog.vue 	modified:   src/views/plan/segmentmerge/operation-technology-form.vue 	modified:   src/views/product/dutyrecord/index.vue 	modified:   src/views/product/producttraceability/index.vue 	modified:   src/views/product/producttraceability/traceability-diagram.vue 	modified:   src/views/product/workbench/batchproductout-form-new.vue 	modified:   src/views/product/workbench/batchproductout-form.vue 	modified:   src/views/product/workbench/feed-form.vue 	modified:   src/views/product/workbench/feed-pane.vue 	modified:   src/views/product/workbench/feed-tab.vue 	modified:   src/views/product/workbench/handymantype.vue 	modified:   src/views/product/workbench/index.vue 	modified:   src/views/product/workbench/mould-pane.vue 	modified:   src/views/product/workbench/operation-task-pane.vue 	modified:   src/views/product/workbench/product-record-form.vue 	modified:   src/views/product/workbench/productout-form-by-batch.vue 	modified:   src/views/product/workbench/productout-form.vue 	modified:   src/views/product/workbench/productrecord-tab.vue 	modified:   src/views/product/workbench/producttracking-tab.vue 	modified:   src/views/product/workbench/shift-productout-form.vue 	modified:   src/views/product/workbench/splitTaskForm.vue 	modified:   src/views/product/workbench/taskinfo-pane.vue 	modified:   src/views/quality/Packaging_ledger/pack-from.vue 	modified:   src/views/quality/apply/index.vue 	modified:   src/views/quality/exception/exception.vue 	modified:   src/views/quality/exception/index.vue 	modified:   src/views/quality/finishedProductInspection/finishedProduct-form.vue 	modified:   src/views/quality/finishedProductInspection/finishedProduct-print.vue 	modified:   src/views/quality/finishedProductInspection/finishedProducter-print.vue 	modified:   src/views/quality/finishedProductInspection/index.vue 	modified:   src/views/quality/newReport/ReportForm.vue 	modified:   src/views/quality/processInspect/index.vue 	modified:   src/views/quality/processInspect/processInspect-form.vue 	modified:   src/views/quality/processconfiguration/index.vue 	modified:   src/views/quality/processconfiguration/table-form.vue 	modified:   src/views/quality/rawMaterial/QrcodeReader.vue 	modified:   src/views/quality/rawMaterial/index.vue 	modified:   src/views/quality/rawMaterial/rawMaterial-form.vue 	modified:   src/views/quality/report/index.vue 	modified:   src/views/quality/standardbind/standardbind-form.vue 	modified:   src/views/quality/statistics/rateChart.vue 	modified:   src/views/quality/testitemlayout/index.vue 	modified:   src/views/quality/testplan/testplan-form.vue 	modified:   src/views/quality/unqualifiedprocess/examineApproveform.vue 	modified:   src/views/quality/unqualifiedprocess/index.vue 	modified:   src/views/quality/unqualifiedprocess/loaction-form.vue 	modified:   src/views/quality/unqualifiedprocess/unqualifiedprocessform.vue 	modified:   src/views/technology/completeproductstructure/completeproductstructure-form.vue 	modified:   src/views/technology/document/checkStandardTable.vue 	modified:   src/views/technology/document/document-form.vue 	modified:   src/views/technology/document/extendsOperation.vue 	modified:   src/views/technology/document/extendsTestStandard.vue 	modified:   src/views/technology/document/extendsTestStandardParam.vue 	modified:   src/views/technology/document/teststandard.vue 	modified:   src/views/technology/structure/single-structure-form.vue 	modified:   src/views/warehouse/changestock/index.vue 	modified:   src/views/warehouse/check/check-detail.vue 	modified:   src/views/warehouse/pallettransports/ifslocation-form.vue 	modified:   src/views/warehouse/pallettransports/ifsstock-form.vue 	modified:   src/views/warehouse/pallettransports/index.vue 	modified:   src/views/warehouse/returnstock/ifslocation-form.vue 	modified:   src/views/warehouse/returnstock/index.vue 	modified:   src/views/warehouse/returnstock/returnstock-form.vue 	modified:   src/views/warehouse/returnstock/stock-part.vue 	modified:   src/views/warehouse/stock/print-label-form.vue 	modified:   src/views/warehouse/stock/small-print-label-form.vue 	modified:   src/views/warehouse/stock/small-warehousing-label-form.vue 	modified:   src/views/warehouse/stock/stock-table.vue 	modified:   src/views/warehouse/stock/warehousing-label-form.vue 	modified:   src/views/zte/pkgidbind/index.vue

---
 src/views/quality/teststandard/standard-form.vue |  332 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 175 insertions(+), 157 deletions(-)

diff --git a/src/views/quality/teststandard/standard-form.vue b/src/views/quality/teststandard/standard-form.vue
index 4abc0be..3b0cbde 100644
--- a/src/views/quality/teststandard/standard-form.vue
+++ b/src/views/quality/teststandard/standard-form.vue
@@ -155,6 +155,23 @@
     ZttMonacoEditor,
     operationDialog
   },
+  watch:{
+    visible(newVal){
+      if(!newVal){
+        this.dataForm = {
+          id: 0,
+          standardName: '',
+          standardNo: '',
+          remark: '',
+          judgeFormula: '',
+          inspectionType: null,
+          operationId: null,
+          operationNo: null,
+          operationName: null,
+        }
+      }
+    }
+  },
   created() {
     this.funcs = funcForStandard()
     this.constants = constantForStandard()
@@ -197,11 +214,11 @@
         if (this.dataForm.id) {
           getTestStandard(this.dataForm.id).then((response) => {
             this.dataForm = response.data.data
-            this.$refs.templateJudgmentCondition.setVal(
-              this.dataForm.judgeFormula == null
-                ? ''
-                : this.dataForm.judgeFormula
-            )
+            // this.$refs.templateJudgmentCondition.setVal(
+            //   this.dataForm.judgeFormula == null
+            //     ? ''
+            //     : this.dataForm.judgeFormula
+            // )
           })
           this.params = []
           getTestStandardParams(
@@ -237,162 +254,163 @@
     // 琛ㄥ崟鎻愪氦
     dataFormSubmit() {
       this.isSubmit = true
-      // 鏍¢獙鍒ゅ畾鍏紡
-      let judgeFormula = this.$refs.templateJudgmentCondition.getVal()
-      // 鏇挎崲鍏紡涓殑pi甯搁噺涓�3.14
-      if (judgeFormula.length > 0) {
-        const piExistIndex = judgeFormula.indexOf('pi')
-        if (piExistIndex >= 0) {
-          judgeFormula = judgeFormula.replace(/pi/g, '3.14')
-        }
-      }
-      // 鏇挎崲鍏紡涓殑passAll()鍑芥暟涓簍rue
-      if (judgeFormula.length > 0) {
-        const piExistIndex = judgeFormula.indexOf('passAll()')
-        if (piExistIndex >= 0) {
-          judgeFormula = judgeFormula.replace(/passAll[(][)]/g, 'true')
-        }
-      }
-      // 鍏堝垽瀹氬叕寮忎腑鍑芥暟鏍煎紡鏄惁姝g‘锛屽啀鐢ㄩ粯璁ゅ�艰绠楀嚭鍑芥暟鍊硷紝鏇挎崲杩涘叕寮忥紝鏈�鍚庡皢鍏紡涓墿浣欑殑鍙傛暟杩涜榛樿鍊兼浛鎹紝鍒╃敤js eval鍑芥暟杩涜鍏紡鏍¢獙
-      let flag = true
-      let funcEl
-      for (let j = 0; j < this.funcs.length; j++) {
-        funcEl = this.funcs[j]
-        // 璁$畻鍑芥暟鍏抽敭鍦ㄥ叕寮忎腑鍑虹幇鐨勬鏁�
-        const num = this.getNumCharInStr(judgeFormula, funcEl.name, 0)
-        // for寰幆娆℃暟鏍¢獙鏇挎崲
-        for (let k = 0; k < num; k++) {
-          const existIndex = judgeFormula.indexOf(funcEl.name)
-          if (existIndex >= 0) {
-            // 鍑芥暟鍏抽敭瀛楀湪鍏紡涓瓨鍦�
-            const prefixStr = judgeFormula.substring(0, existIndex)
-            const startToEndStr = judgeFormula.substring(
-              existIndex + funcEl.name.length
-            )
-            if (startToEndStr.length > 0) {
-              const paramStartIndex = startToEndStr.indexOf('(')
-              const paramEndIndex = startToEndStr.indexOf(')')
-              if (paramStartIndex === 0 && paramEndIndex > 0) {
-                const suffixStr = startToEndStr.substring(paramEndIndex + 1)
-                const paramStr = startToEndStr.substring(
-                  paramStartIndex + 1,
-                  paramEndIndex
-                )
-                if (paramStr.trim() !== '') {
-                  const paramArr = paramStr.split(',')
-                  if (paramArr.length > 0) {
-                    if (
-                      (funcEl.singleParam && paramArr.length === 1) ||
-                      !funcEl.singleParam
-                    ) {
-                      let paramFlag = true
-                      for (let i = 0; i < paramArr.length; i++) {
-                        const param = this.params.find(
-                          (item) =>
-                            paramArr[i].trim() === 'V[' + item.code + ']'
-                        )
-                        if (param !== undefined) {
-                        } else {
-                          flag = false
-                          paramFlag = false
-                          this.$message.error('鍑芥暟鍙傛暟涓嶅瓨鍦�')
-                        }
-                      }
-                      if (paramFlag) {
-                        if (funcEl.returnType === 'number') {
-                          judgeFormula = prefixStr + '1' + suffixStr
-                        } else {
-                          judgeFormula = prefixStr + 'true' + suffixStr
-                        }
-                      } else {
-                        break
-                      }
-                    } else {
-                      flag = false
-                      this.$message.error('鍑芥暟鍙傛暟涓暟涓嶆纭�')
-                      break
-                    }
-                  } else {
-                    break
-                  }
-                } else {
-                  flag = false
-                  this.$message.error('鍑芥暟蹇呴』瑕佹湁鍙傛暟')
-                  break
-                }
-              } else {
-                flag = false
-                this.$message.error(
-                  '鍑芥暟闇�鍖呭惈宸﹀彸灏忔嫭鍙凤紝涓斿乏渚у皬鎷彿闇�绱ч偦鍑芥暟'
-                )
-                break
-              }
-            } else {
-              flag = false
-              this.$message.error('鍑芥暟闇�鍖呭惈宸﹀彸灏忔嫭鍙�')
-              break
-            }
-          }
-        }
-      }
-      if (flag) {
-        // 灏嗗叕寮忎腑鍓╀綑鐨勫弬鏁拌繘琛岄粯璁ゅ�兼浛鎹�
-        let param
-        for (let x = 0; x < this.params.length; x++) {
-          param = this.params[x]
-          // 璁$畻鍙傛暟鍦ㄥ叕寮忎腑鍑虹幇鐨勬鏁�
-          const num = this.getNumCharInStr(
-            judgeFormula,
-            'V[' + param.code + ']',
-            0
-          )
-          // for寰幆娆℃暟鏍¢獙鏇挎崲
-          for (let y = 0; y < num; y++) {
-            const existIndex = judgeFormula.indexOf('V[' + param.code + ']')
-            if (existIndex >= 0) {
-              const prefixStr = judgeFormula.substring(0, existIndex)
-              const suffixStr = judgeFormula.substring(
-                existIndex + ('V[' + param.code + ']').length
-              )
-              judgeFormula = prefixStr + this.getRandom() + suffixStr
-            }
-          }
-        }
-        try {
-          eval(judgeFormula)
-        } catch (exception) {
-          flag = false
-        }
-        if (flag) {
-          this.dataForm.judgeFormula = this.$refs.templateJudgmentCondition.getVal()
-          this.$refs.dataForm.validate((valid) => {
-            if (valid) {
-              if (this.dataForm.id) {
-                putTestStandard(this.dataForm).then((data) => {
-                  this.$message.success('淇敼鎴愬姛')
-                  this.visible = false
-                  this.isSubmit = false
-                  this.$emit('refreshDataList')
-                })
-              } else {
-                addTestStandard(this.dataForm).then((data) => {
-                  this.$message.success('娣诲姞鎴愬姛')
-                  this.visible = false
-                  this.isSubmit = false
-                  this.$emit('refreshDataList')
-                })
-              }
-            } else {
+      this.$refs.dataForm.validate((valid) => {
+        if (valid) {
+          if (this.dataForm.id) {
+            putTestStandard(this.dataForm).then((data) => {
+              this.$message.success('淇敼鎴愬姛')
+              this.visible = false
               this.isSubmit = false
-            }
-          })
+              this.$emit('refreshDataList')
+            })
+          } else {
+            addTestStandard(this.dataForm).then((data) => {
+              this.$message.success('娣诲姞鎴愬姛')
+              this.visible = false
+              this.isSubmit = false
+              this.$emit('refreshDataList')
+            })
+          }
         } else {
           this.isSubmit = false
-          this.$message.error('鍏紡鏍煎紡閿欒锛岃浠旂粏妫�鏌�')
         }
-      } else {
-        this.isSubmit = false
-      }
+      })
+      // 鏍¢獙鍒ゅ畾鍏紡
+      // let judgeFormula = this.$refs.templateJudgmentCondition.getVal()
+      // // 鏇挎崲鍏紡涓殑pi甯搁噺涓�3.14
+      // if (judgeFormula.length > 0) {
+      //   const piExistIndex = judgeFormula.indexOf('pi')
+      //   if (piExistIndex >= 0) {
+      //     judgeFormula = judgeFormula.replace(/pi/g, '3.14')
+      //   }
+      // }
+      // // 鏇挎崲鍏紡涓殑passAll()鍑芥暟涓簍rue
+      // if (judgeFormula.length > 0) {
+      //   const piExistIndex = judgeFormula.indexOf('passAll()')
+      //   if (piExistIndex >= 0) {
+      //     judgeFormula = judgeFormula.replace(/passAll[(][)]/g, 'true')
+      //   }
+      // }
+      // // 鍏堝垽瀹氬叕寮忎腑鍑芥暟鏍煎紡鏄惁姝g‘锛屽啀鐢ㄩ粯璁ゅ�艰绠楀嚭鍑芥暟鍊硷紝鏇挎崲杩涘叕寮忥紝鏈�鍚庡皢鍏紡涓墿浣欑殑鍙傛暟杩涜榛樿鍊兼浛鎹紝鍒╃敤js eval鍑芥暟杩涜鍏紡鏍¢獙
+      // let flag = true
+      // let funcEl
+      // for (let j = 0; j < this.funcs.length; j++) {
+      //   funcEl = this.funcs[j]
+      //   // 璁$畻鍑芥暟鍏抽敭鍦ㄥ叕寮忎腑鍑虹幇鐨勬鏁�
+      //   const num = this.getNumCharInStr(judgeFormula, funcEl.name, 0)
+      //   // for寰幆娆℃暟鏍¢獙鏇挎崲
+      //   for (let k = 0; k < num; k++) {
+      //     const existIndex = judgeFormula.indexOf(funcEl.name)
+      //     if (existIndex >= 0) {
+      //       // 鍑芥暟鍏抽敭瀛楀湪鍏紡涓瓨鍦�
+      //       const prefixStr = judgeFormula.substring(0, existIndex)
+      //       const startToEndStr = judgeFormula.substring(
+      //         existIndex + funcEl.name.length
+      //       )
+      //       if (startToEndStr.length > 0) {
+      //         const paramStartIndex = startToEndStr.indexOf('(')
+      //         const paramEndIndex = startToEndStr.indexOf(')')
+      //         if (paramStartIndex === 0 && paramEndIndex > 0) {
+      //           const suffixStr = startToEndStr.substring(paramEndIndex + 1)
+      //           const paramStr = startToEndStr.substring(
+      //             paramStartIndex + 1,
+      //             paramEndIndex
+      //           )
+      //           if (paramStr.trim() !== '') {
+      //             const paramArr = paramStr.split(',')
+      //             if (paramArr.length > 0) {
+      //               if (
+      //                 (funcEl.singleParam && paramArr.length === 1) ||
+      //                 !funcEl.singleParam
+      //               ) {
+      //                 let paramFlag = true
+      //                 for (let i = 0; i < paramArr.length; i++) {
+      //                   const param = this.params.find(
+      //                     (item) =>
+      //                       paramArr[i].trim() === 'V[' + item.code + ']'
+      //                   )
+      //                   if (param !== undefined) {
+      //                   } else {
+      //                     flag = false
+      //                     paramFlag = false
+      //                     this.$message.error('鍑芥暟鍙傛暟涓嶅瓨鍦�')
+      //                   }
+      //                 }
+      //                 if (paramFlag) {
+      //                   if (funcEl.returnType === 'number') {
+      //                     judgeFormula = prefixStr + '1' + suffixStr
+      //                   } else {
+      //                     judgeFormula = prefixStr + 'true' + suffixStr
+      //                   }
+      //                 } else {
+      //                   break
+      //                 }
+      //               } else {
+      //                 flag = false
+      //                 this.$message.error('鍑芥暟鍙傛暟涓暟涓嶆纭�')
+      //                 break
+      //               }
+      //             } else {
+      //               break
+      //             }
+      //           } else {
+      //             flag = false
+      //             this.$message.error('鍑芥暟蹇呴』瑕佹湁鍙傛暟')
+      //             break
+      //           }
+      //         } else {
+      //           flag = false
+      //           this.$message.error(
+      //             '鍑芥暟闇�鍖呭惈宸﹀彸灏忔嫭鍙凤紝涓斿乏渚у皬鎷彿闇�绱ч偦鍑芥暟'
+      //           )
+      //           break
+      //         }
+      //       } else {
+      //         flag = false
+      //         this.$message.error('鍑芥暟闇�鍖呭惈宸﹀彸灏忔嫭鍙�')
+      //         break
+      //       }
+      //     }
+      //   }
+      // }
+      // if (flag) {
+      //   // 灏嗗叕寮忎腑鍓╀綑鐨勫弬鏁拌繘琛岄粯璁ゅ�兼浛鎹�
+      //   let param
+      //   for (let x = 0; x < this.params.length; x++) {
+      //     param = this.params[x]
+      //     // 璁$畻鍙傛暟鍦ㄥ叕寮忎腑鍑虹幇鐨勬鏁�
+      //     const num = this.getNumCharInStr(
+      //       judgeFormula,
+      //       'V[' + param.code + ']',
+      //       0
+      //     )
+      //     // for寰幆娆℃暟鏍¢獙鏇挎崲
+      //     for (let y = 0; y < num; y++) {
+      //       const existIndex = judgeFormula.indexOf('V[' + param.code + ']')
+      //       if (existIndex >= 0) {
+      //         const prefixStr = judgeFormula.substring(0, existIndex)
+      //         const suffixStr = judgeFormula.substring(
+      //           existIndex + ('V[' + param.code + ']').length
+      //         )
+      //         judgeFormula = prefixStr + this.getRandom() + suffixStr
+      //       }
+      //     }
+      //   }
+      //   try {
+      //     eval(judgeFormula)
+      //   } catch (exception) {
+      //     flag = false
+      //   }
+      //   if (flag) {
+      //     this.dataForm.judgeFormula = this.$refs.templateJudgmentCondition.getVal()
+
+      //   } else {
+      //     this.isSubmit = false
+      //     this.$message.error('鍏紡鏍煎紡閿欒锛岃浠旂粏妫�鏌�')
+      //   }
+      // } else {
+      //   this.isSubmit = false
+      // }
     },
     openOperationDialog() {
       this.showOperate = true

--
Gitblit v1.9.3