3
2
Просмотр исходного кода

检测任务实际检测为0时隐藏

Liuqi 6 лет назад
Родитель
Сommit
b630f32c62
1 измененных файлов с 141 добавлено и 144 удалено
  1. 141 144
      src/dashoo.cn/frontend_web/src/pages/lims/tasksentrust/_opera/operation.vue

+ 141 - 144
src/dashoo.cn/frontend_web/src/pages/lims/tasksentrust/_opera/operation.vue

@@ -145,7 +145,7 @@
           </el-col>
           <el-col :span="8" v-if="mainForm.EntrustStatus == 1">
             <el-form-item label="实际检测
-数量">
+数量" v-if="TestSampleNum != 0">
               <span>{{ TestSampleNum }}</span>
             </el-form-item>
           </el-col>
@@ -417,9 +417,9 @@
   import {
     mapGetters
   } from 'vuex'
-  import axios from "../../../../../.nuxt/axios"
+  import axios from '../../../../../.nuxt/axios'
   import docTemplateApi from '@/api/lims/docTemplate'
-  import entrustApi from "@/api/lims/limsentrust"
+  import entrustApi from '@/api/lims/limsentrust'
   import entrustEquipmentApi from '@/api/lims/entrustEquipment'
 
   export default {
@@ -599,13 +599,13 @@
           SampleNum: [{
             type: 'number',
             message: '样品数量必须为数值',
-            trigger: 'blur',
+            trigger: 'blur'
           }],
           SampleCode: [{
             required: true,
             message: '请输入样品编号',
             trigger: 'blur'
-          }],
+          }]
         },
         tableColumns: [
           {
@@ -683,26 +683,26 @@
           Courier: '',
           Sender: '',
           Notes: '',
-          ISsend: 0,
+          ISsend: 0
         },
         rulesTransport: {
           Sender: [{
             required: true,
             message: '请填写发件人',
-            trigger: 'blur',
-          }],
+            trigger: 'blur'
+          }]
         },
-        //分配信息弹窗
+        // 分配信息弹窗
         balanceShow: false,
         partuserlist: [],
         balanceForm: {
           ConUserId: '',
           ConUserBy: '',
-          Remark: '',
+          Remark: ''
         },
         OfficerList: [],
         docTemplateDictList: [],
-        //审核信息弹窗
+        // 审核信息弹窗
         auditorShow: false,
         shenheForm: {
           SuccessStatus: 0,
@@ -712,13 +712,13 @@
         permissionscode: {
           add: 'lims.deliver.add',
           edit: 'lims.entrust.edit',
-          balance: 'lims.balance.edit',
+          balance: 'lims.balance.edit'
         },
         permissions: {
           'lims.deliver.add': false,
           'lims.entrust.edit': false,
-          'lims.balance.edit': false,
-        },
+          'lims.balance.edit': false
+        }
       }
     },
     created () {
@@ -767,7 +767,7 @@
       },
 
       // 列表排序功能
-      orderby(column) {
+      orderby (column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -787,11 +787,11 @@
         this.initDeviceList()
       },
 
-      //验证单号是否唯一
-      trueEntrustNo() {
+      // 验证单号是否唯一
+      trueEntrustNo () {
         let _this = this
         if (_this.ServiceId === 'addentrust') {
-          _this.$axios.get("/limsentrust/entrustmakesure?EntrustNo=" + _this.mainForm.EntrustNo, {})
+          _this.$axios.get('/limsentrust/entrustmakesure?EntrustNo=' + _this.mainForm.EntrustNo, {})
             .then(function (response) {
               _this.entrustTotal = response.data.items
               if (_this.entrustTotal === 0) {
@@ -807,11 +807,11 @@
           _this.checkField()
         }
       },
-      //检查字段是否为空
-      checkField() {
+      // 检查字段是否为空
+      checkField () {
         let _this = this
-        if (_this.selectedorg && _this.selectedorg.length > 0) { //验证样本
-          if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { //验证委托方
+        if (_this.selectedorg && _this.selectedorg.length > 0) { // 验证样本
+          if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { // 验证委托方
             // if (!_this.tjz) {
             //   if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { //验证检测地点
             //     _this.saveEntity()
@@ -838,8 +838,8 @@
           })
         }
       },
-      //保存数据
-      saveEntity() {
+      // 保存数据
+      saveEntity () {
         if (this.ServiceId === 'addentrust' || this.ServiceId <= '0') {
           this.addEntrust()
         } else {
@@ -847,7 +847,7 @@
         }
       },
 
-      addEntrust() {
+      addEntrust () {
         let _this = this
         this.$refs['mainForm'].validate((valid) => {
           if (valid) {
@@ -875,9 +875,9 @@
                     message: res.data.message
                   })
                   _this.ServiceId = res.data.item
-                  //刷新一下界面
+                  // 刷新一下界面
                   _this.getEntrustInfo()
-                  console.log("-==--tianjia--", this.mainForm.DataTemplateId)
+                  console.log('-==--tianjia--', this.mainForm.DataTemplateId)
                   _this.getpartuserlist(this.mainForm.DataTemplateId)
                 } else {
                   _this.$message({
@@ -895,7 +895,7 @@
           }
         })
       },
-      editEntrust() {
+      editEntrust () {
         let _this = this
         this.$refs['mainForm'].validate((valid) => {
           if (valid) {
@@ -940,7 +940,7 @@
           }
         })
       },
-      getEntrustInfo() {
+      getEntrustInfo () {
         let _this = this
         this.$axios.get('limsentrust/getentrustinfo/' + _this.ServiceId, {})
           .then(res => {
@@ -980,9 +980,9 @@
           })
       },
 
-      //任务分配
-      balance() {
-        this.balanceForm.ConUserId = this.OfficerList.join(',');
+      // 任务分配
+      balance () {
+        this.balanceForm.ConUserId = this.OfficerList.join(',')
         if (!this.balanceForm.ConUserId || this.balanceForm.ConUserId === '') {
           this.$message({
             type: 'warning',
@@ -994,23 +994,23 @@
         _this.testcodec()
         _this.saveDetail()
       },
-      saveDetail() {
+      saveDetail () {
         let _this = this
-        //负责人姓名
-        let tempOfficers = [];
+        // 负责人姓名
+        let tempOfficers = []
         for (let idx in _this.OfficerList) {
-          let selectId = _this.OfficerList[idx];
+          let selectId = _this.OfficerList[idx]
           for (let idx2 in _this.partuserlist) {
-            let item = _this.partuserlist[idx2];
+            let item = _this.partuserlist[idx2]
             if (item.Id == selectId) {
-              tempOfficers.push(item.Realname);
-              break;
+              tempOfficers.push(item.Realname)
+              break
             }
           }
         }
-        _this.balanceForm.ConUserBy = tempOfficers.join(',');
+        _this.balanceForm.ConUserBy = tempOfficers.join(',')
         _this.$axios.post('/limsentrust/taskbalance/' + _this.mainForm.Id + '?samplecode=' + _this.sampleForm.SampleCode,
-            _this.balanceForm)
+          _this.balanceForm)
           .then(res => {
             // response
             if (res.data.code === 0) {
@@ -1019,7 +1019,7 @@
                 message: res.data.message
               })
               _this.balanceShow = false
-              _this.getEntrustInfo() //更新界面
+              _this.getEntrustInfo() // 更新界面
             } else {
               _this.$message({
                 type: 'warning',
@@ -1033,8 +1033,8 @@
           })
       },
 
-      //保存委托样本明细信息
-      addSample() {
+      // 保存委托样本明细信息
+      addSample () {
         let _this = this
         this.$refs['sampleForm'].validate((valid) => {
           if (valid) {
@@ -1076,10 +1076,10 @@
           }
         })
       },
-      showSample(val) {
+      showSample (val) {
         let _this = this
         _this.deliver_flag = 'showSample'
-        _this.deliverTitle = "样品交接详情"
+        _this.deliverTitle = '样品交接详情'
         _this.sampleForm.Id = val.Id
         _this.sampleForm.SampleCode = val.SampleCode
         _this.sampleForm.DetectSampleId = val.DetectSampleId
@@ -1098,7 +1098,7 @@
         _this.sampleForm.Remark = val.Remark
         _this.deliverShow = true
       },
-      editSample() {
+      editSample () {
         let _this = this
         this.$refs['sampleForm'].validate((valid) => {
           if (valid) {
@@ -1133,41 +1133,41 @@
           }
         })
       },
-      deleteSample(val) {
-        let _this = this;
-        _this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+      deleteSample (val) {
+        let _this = this
+        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             _this.$axios
-              .delete("limsentrustsample/entrustsampledelete/" + val.Id, {})
+              .delete('limsentrustsample/entrustsampledelete/' + val.Id, {})
               .then(function (response) {
                 // response
                 if (response.data.code === 0) {
                   _this.$message({
-                    type: "success",
+                    type: 'success',
                     message: response.data.message
-                  });
+                  })
                   // 更新界面
                   _this.getEntrustInfo()
-                  //刷新样品明显列表
+                  // 刷新样品明显列表
                   _this.getSampleList()
                 } else {
                   _this.$message({
-                    type: "warning",
+                    type: 'warning',
                     message: response.data.message
-                  });
+                  })
                 }
               })
               .catch(function (error) {
-                console.log(error);
-              });
+                console.log(error)
+              })
           })
-          .catch(() => {});
+          .catch(() => {})
       },
-      sampleDialog() {
+      sampleDialog () {
         this.deliverShow = true
         this.deliverTitle = '新增样品信息'
         this.deliver_flag = 'adddeliver'
@@ -1187,10 +1187,10 @@
         this.sampleForm.Notes = ''
         this.testcodec()
       },
-      getSampleList() {
+      getSampleList () {
         let _this = this
         // request
-        this.$axios.get("/limsentrustsample/getentrustsamplelist/" + _this.ServiceId, {})
+        this.$axios.get('/limsentrustsample/getentrustsamplelist/' + _this.ServiceId, {})
           .then(res => {
             _this.deliverList = res.data.items
           })
@@ -1200,14 +1200,14 @@
           })
       },
 
-      //ln
-      deletetesttype(val) {
-        let _this = this;
-        this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+      // ln
+      deletetesttype (val) {
+        let _this = this
+        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             _this.$axios
               .delete('/limsentrustsample/deletetesttype/' + val.Id)
@@ -1231,7 +1231,7 @@
           })
           .catch(() => {})
       },
-      addTestType() {
+      addTestType () {
         this.$axios.post('/limsentrustsample/addtesttype/' + this.EntrustSampleId, this.typevalue)
           .then(response => {
             if (response.data.code === 0) {
@@ -1251,28 +1251,28 @@
           })
         this.typevalue = []
       },
-      //详情
-      details(val) {
+      // 详情
+      details (val) {
         this.EntrustSampleId = val.Id
-        this.$axios.get("/limsentrustsample/getdetails/" + val.Id)
+        this.$axios.get('/limsentrustsample/getdetails/' + val.Id)
           .then(response => {
             this.testdetails = response.data.item
             this.testtypes = response.data.types
           })
         this.detailsDialog = true
       },
-      details1(id) {
-        this.$axios.get("/limsentrustsample/getdetails/" + id)
+      details1 (id) {
+        this.$axios.get('/limsentrustsample/getdetails/' + id)
           .then(response => {
             this.testdetails = response.data.item
             this.testtypes = response.data.types
           })
         this.detailsDialog = true
       },
-      //ln
+      // ln
 
-      //发送
-      transportShow() {
+      // 发送
+      transportShow () {
         if (this.mainForm.DeliverStatus == 0) {
           this.getDeliverNo()
         } else {
@@ -1280,14 +1280,14 @@
         }
         this.transportDialog = true
       },
-      getDeliverInfo() {
+      getDeliverInfo () {
         let _this = this
         let params = {
           ServiceId: _this.mainForm.Id
         }
         _this.$axios.get('/limsdeliver/deliverinfo', {
-            params
-          })
+          params
+        })
           .then(res => {
             _this.deliverForm = res.data.items
           }).catch(err => {
@@ -1295,14 +1295,14 @@
             console.error(err)
           })
       },
-      saveDeliver() {
+      saveDeliver () {
         if (this.mainForm.DeliverStatus == 0) {
           this.addDeliver('deliverForm')
         } else if (this.mainForm.DeliverStatus == 1) {
           this.editDeliver('deliverForm')
         }
       },
-      addDeliver(formName) {
+      addDeliver (formName) {
         let _this = this
         this.$refs['deliverForm'].validate((valid) => {
           if (valid) {
@@ -1332,12 +1332,12 @@
                 }
               })
           } else {
-            console.log('error submit!!');
-            return false;
+            console.log('error submit!!')
+            return false
           }
         })
       },
-      editDeliver(formName) {
+      editDeliver (formName) {
         let _this = this
         this.$refs['deliverForm'].validate((valid) => {
           if (valid) {
@@ -1359,12 +1359,12 @@
                 }
               })
           } else {
-            console.log('error submit!!');
-            return false;
+            console.log('error submit!!')
+            return false
           }
         })
       },
-      sendTransport() {
+      sendTransport () {
         if (this.deliverForm.Sender || this.deliverForm.Sender != '') {
           this.deliverForm.ISsend = 1
           this.editDeliver()
@@ -1376,13 +1376,13 @@
         }
       },
 
-      auditor() {
+      auditor () {
         let _this = this
-        _this.$confirm("确定审核该检测任务?审核后所有信息将不可修改!", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
+        _this.$confirm('确定审核该检测任务?审核后所有信息将不可修改!', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
           .then(() => {
             if (_this.shenheForm.SuccessStatus == 0) {
               _this.mainForm.EntrustStatus = 1
@@ -1396,7 +1396,7 @@
           })
           .catch(() => {})
       },
-      makesure() {
+      makesure () {
         if (this.ServiceId <= 0) {
           this.$message({
             type: 'warning',
@@ -1420,17 +1420,16 @@
           }
         }).catch(err => {
           console.error(err)
-        });
-
+        })
       },
 
-      testcodec() {
+      testcodec () {
         this.$axios.get('/codesequence/GetProjectCenterDailySequence')
           .then(res => {
             this.sampleForm.SampleCode = res.data.items
-          });
+          })
       },
-      getCode() {
+      getCode () {
         console.log(this.ServiceId)
         if (this.ServiceId == 'addentrust') {
           if (this.tjz) {
@@ -1445,35 +1444,35 @@
           }
         }
       },
-      getEntrustNo() {
+      getEntrustNo () {
         let _this = this
         _this.$axios.get('orderadd/getOrderNumgene')
           .then(function (response) {
             _this.mainForm.EntrustNo = response.data.items + ''
           })
       },
-      getReportNo() {
+      getReportNo () {
         let _this = this
         let params = {
           TemplateCode: _this.templatecode
         }
         console.log(params, 'paramsparamsparamsparams')
         _this.$axios.get('limsentrust/getentrustno', {
-            params
-          })
+          params
+        })
           .then(function (response) {
             _this.mainForm.EntrustNo = response.data.items + ''
           })
       },
-      getDeliverNo() {
+      getDeliverNo () {
         let _this = this
         _this.$axios.get('orderadd/getOrderNumgene')
           .then(function (response) {
             _this.deliverForm.DeliverNo = response.data.items + ''
           })
       },
-      //检测报告
-      getProjectType() {
+      // 检测报告
+      getProjectType () {
         // let _this = this
         // _this.$axios.get('/testtype/testypetreebyorg', {})
         //   .then(res => {
@@ -1527,29 +1526,29 @@
               _this.getProjectType()
             }).catch(
             function (error) {
-              console.log(error);
+              console.log(error)
             })
       },
-      balanceaction(){
-        this.balanceShow=true
+      balanceaction () {
+        this.balanceShow = true
         this.getpartuserlist(this.mainForm.DataTemplateId)
       },
-      getDictList() {
+      getDictList () {
         docTemplateApi.getDictList(this.$axios).then(res => {
-          this.docTemplateDictList = res.data;
-        });
+          this.docTemplateDictList = res.data
+        })
       },
-      getpartuserlist(val) {
-        this.partuserlist = ""
-        let docTempType = '';
+      getpartuserlist (val) {
+        this.partuserlist = ''
+        let docTempType = ''
         for (let idx in this.docTemplateDictList) {
           if (val == this.docTemplateDictList[idx].Id) {
-            docTempType = this.docTemplateDictList[idx].TemplateCode;
+            docTempType = this.docTemplateDictList[idx].TemplateCode
           }
         }
 
-        if (val != "") {
-          if (docTempType === "DAYT.LightProtect.Report" || docTempType === "DAYT.Equipotent.Report") {
+        if (val != '') {
+          if (docTempType === 'DAYT.LightProtect.Report' || docTempType === 'DAYT.Equipotent.Report') {
             this.lightpermission = true
           } else {
             this.lightpermission = false
@@ -1566,8 +1565,8 @@
             console.error(err)
           })
       },
-      //获取委托类型
-      getEntypeList() {
+      // 获取委托类型
+      getEntypeList () {
         let _this = this
         _this.$axios.get('/items/worditem?code=DelegateType', {})
           .then(res => {
@@ -1622,8 +1621,7 @@
           })
       },
 
-
-      SampleTypeChangeHandler() {
+      SampleTypeChangeHandler () {
         this.mainForm.DetectSampleId = ''
         this.selectedorg = []
         this.getCode()
@@ -1631,15 +1629,15 @@
       },
 
       // 获取样品数量单位
-      getsamplesnumlist() {
+      getsamplesnumlist () {
         let _this = this
         _this.$axios.get('/items/worditem?code=SamplesNum', {})
           .then(res => {
             _this.sampeunitlist = res.data
           })
       },
-      //样品名称
-      getSampleTypeOrigList() {
+      // 样品名称
+      getSampleTypeOrigList () {
         let _this = this
         _this.$axios.get('/limsampletype/sampletypetree', {})
           .then(function (res) {
@@ -1653,7 +1651,7 @@
             console.error(err)
           })
       },
-      getSampleType() {
+      getSampleType () {
         let _this = this
         _this.sampleTypeList = []
         for (var i = 0; _this.sampleTypeOrigList && i < _this.sampleTypeOrigList.length; i++) {
@@ -1674,16 +1672,16 @@
         _this.sampleTypeTreeList = window.toolfun_gettreejson(_this.sampleTypeList, 'Id', 'ParentId',
           'Id,FullName')
       },
-      getDetectSampleName(sampleId) {
+      getDetectSampleName (sampleId) {
         let ret = ''
         for (let idx in this.sampleTypeList) {
           if (sampleId === this.sampleTypeList[idx].Id) {
             ret = this.sampleTypeList[idx].FullName
           }
         }
-        return ret;
+        return ret
       },
-      SamplePropertyHandler() {
+      SamplePropertyHandler () {
         let _this = this
         var sampleid = _this.selectedorg[_this.selectedorg.length - 1]
         this.$axios.get('limsampletype/getsampleproperty/' + sampleid, {})
@@ -1698,21 +1696,21 @@
             console.error(err)
           })
       },
-      //获取权限
-      getPermissions() {
+      // 获取权限
+      getPermissions () {
         let _this = this
         // request
         let params = {
           percodes: `'${this.permissionscode.add}','${this.permissionscode.edit}','${this.permissionscode.balance}'`
         }
         this.$axios.get('/permissions/isauths', {
-            params
-          })
+          params
+        })
           .then(res => {
             if (res.data instanceof Array && res.data.length > 0) {
               res.data.forEach(element => {
                 _this.permissions[element.Code] = element.Isperm
-              });
+              })
             }
           })
           .catch(err => {
@@ -1720,7 +1718,7 @@
             console.error(err)
           })
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1731,11 +1729,10 @@
           val = val.replace('T', ' ')
           return val.substring(0, 10)
         }
-      },
+      }
 
     }
   }
-
 </script>
 
 <style lang="scss">