Browse Source

外部单位添加委托任务

lining 6 years ago
parent
commit
f7ddc0c23e

+ 61 - 21
src/dashoo.cn/frontend_web/src/pages/lims/tasksentrust/_opera/operation.vue

@@ -544,6 +544,25 @@
             trigger: 'blur'
           }]
         },
+        options: [{
+          label: '特检',
+          options: [
+            {Id: 179, FullName: '电气接地装置检测'},
+            {Id: 286, FullName: '防雷装置检测'},
+            {Id: 187, FullName: '防雷装置(等电位)检测'},
+            {Id: 181, FullName: '漏电保护器检测'}
+          ]
+        }, {
+          label: '宇信',
+          options: [
+            {Id: 156, FullName: '阻火器检测'},
+            {Id: 183, FullName: '呼吸阀检测'},
+            {Id: 154, FullName: '液压安全阀检测'},
+            {Id: 189, FullName: '空气泡沫产生器检测'},
+            {Id: 141, FullName: '游梁式抽油机检测'},
+            {Id: 173, FullName: '无游梁式抽油机检测'}
+          ]
+        }],
         status_flag: false,
         deliverShow: false,
         deliverList: [],
@@ -721,7 +740,7 @@
       this.getEntypeList()
       this.getsamplesnumlist()
       this.getCustomer()
-      this.getProjectType()
+      // this.getProjectType()
       this.getSampleTypeOrigList()
       // this.getpartuserlist()
       this.getDictList()
@@ -1412,6 +1431,7 @@
           });
       },
       getCode() {
+        console.log(this.ServiceId)
         if (this.ServiceId == 'addentrust') {
           if (this.tjz) {
             for (var i = 0; i < this.projectTypeList.length; i++) {
@@ -1452,6 +1472,44 @@
             _this.deliverForm.DeliverNo = response.data.items + ''
           })
       },
+      //检测报告
+      getProjectType() {
+        // let _this = this
+        // _this.$axios.get('/testtype/testypetreebyorg', {})
+        //   .then(res => {
+        //     _this.testTypeList = res.data.items
+        //     if (!_this.testTypeList) {
+        //       return false
+        //     }
+        //     for (var i = 0; i < _this.testTypeList.length; i++) {
+        //       if (_this.testTypeList[i].ParentId === 0) {
+        //         _this.projectTypeList.push(_this.testTypeList[i])
+        //       }
+        //     }
+        //     console.log(_this.projectTypeList, '_this.projectTypeList')
+        //   })
+        //   .catch(err => {
+        //     // handle error
+        //     console.error(err)
+        //   })
+        if (this.tjz) {
+          this.projectTypeList = [
+            {Id: 179, FullName: '电气接地装置检测', TemplateCode: 'DAYT.ElecGround.Report'},
+            {Id: 286, FullName: '防雷装置检测', TemplateCode: 'DAYT.LightProtect.Report'},
+            {Id: 187, FullName: '防雷装置(等电位)检测', TemplateCode: 'DAYT.Equipotent.Report'},
+            {Id: 181, FullName: '漏电保护器检测', TemplateCode: 'DAYT.LeakProtect.Report'}
+          ]
+        } else {
+          this.projectTypeList = [
+            {Id: 156, FullName: '阻火器检测', TemplateCode: ''},
+            {Id: 183, FullName: '呼吸阀检测', TemplateCode: ''},
+            {Id: 154, FullName: '液压安全阀检测', TemplateCode: ''},
+            {Id: 189, FullName: '空气泡沫产生器检测', TemplateCode: ''},
+            {Id: 141, FullName: '游梁式抽油机检测', TemplateCode: ''},
+            {Id: 173, FullName: '无游梁式抽油机检测', TemplateCode: ''}
+          ]
+        }
+      },
       // 判断组织结构确定流程
       getOrganizeListById () {
         let _this = this
@@ -1466,6 +1524,7 @@
                   // _this.mainForm.EntrustTypeId = 329 //委托检测
                 }
               }
+              _this.getProjectType()
             }).catch(
             function (error) {
               console.log(error);
@@ -1562,26 +1621,7 @@
             console.error(err)
           })
       },
-      //检测报告
-      getProjectType() {
-        let _this = this
-        _this.$axios.get('/testtype/testypetreebyorg', {})
-          .then(res => {
-            _this.testTypeList = res.data.items
-            if (!_this.testTypeList) {
-              return false
-            }
-            for (var i = 0; i < _this.testTypeList.length; i++) {
-              if (_this.testTypeList[i].ParentId === 0) {
-                _this.projectTypeList.push(_this.testTypeList[i])
-              }
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
+
 
       SampleTypeChangeHandler() {
         this.mainForm.DetectSampleId = ''

+ 51 - 0
src/dashoo.cn/frontend_web/src/pages/system/externalOrganize.vue

@@ -55,6 +55,9 @@
             </el-table-column>
             <el-table-column prop="Fullname" align="center" label="组织名称" show-overflow-tooltip></el-table-column>
             <el-table-column prop="Parentname" align="center" label="上级组织" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="Category" align="center" label="单位级别" show-overflow-tooltip :formatter="formatUnit"></el-table-column>
+            <el-table-column prop="Phone" align="center" label="联系电话" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="Address" align="center" label="地址" show-overflow-tooltip></el-table-column>
             <el-table-column prop="Description" align="center" label="备注" show-overflow-tooltip></el-table-column>
             <el-table-column label="操作时间" align="center" prop="Modifiedon">
               <template slot-scope="scope">
@@ -79,6 +82,25 @@
         <el-form-item label="组织名称" prop="fullname" label-width="120px">
           <el-input v-model="organizeform.fullname" auto-complete="off"></el-input>
         </el-form-item>
+        <el-form-item label="所在单位级别"  label-width="120px">
+          <el-select v-model="unitvalue" placeholder="请选择">
+            <el-option
+              v-for="item in unitoptions"
+              :key="item.unitvalue"
+              :label="item.unitlabel"
+              :value="item.unitvalue">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="联系人" label-width="120px">
+          <el-input v-model="organizeform.Contacts" auto-complete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="电话" label-width="120px">
+          <el-input v-model="organizeform.Phone" auto-complete="off"></el-input>
+        </el-form-item>
+        <el-form-item label="地址" label-width="120px">
+          <el-input v-model="organizeform.Address" auto-complete="off"></el-input>
+        </el-form-item>
         <el-form-item label="描述" label-width="120px">
           <el-input type="textarea" v-model="organizeform.description" auto-complete="off"></el-input>
         </el-form-item>
@@ -127,11 +149,26 @@
         parentid: '',
         datadialogVisible: false,
         dialogtitle: '',
+        unitvalue: '',
+        unitoptions: [{
+          unitvalue: '',
+          unitlabel: '无'
+        }, {
+          unitvalue: 'unit',
+          unitlabel: '二级单位'
+        }, {
+          unitvalue: 'ThrUnit',
+          unitlabel: '三级单位'
+        }],
         organizeform: {
           IsInnerOrganize: 0,
           parentid: 0,
           fullname: '',
+          Category: '',
           description: '',
+          Contacts: '',
+          Phone: '',
+          Address: '',
           id: 0
         },
         rulesorganize: {
@@ -334,6 +371,10 @@
                 _this.dialogtitle = `编辑组织信息(${v.Fullname})`
                 _this.organizeform.parentid = v.Parentid
                 _this.organizeform.fullname = v.Fullname
+                _this.organizeform.Contacts = v.Contacts
+                _this.unitvalue = v.Category
+                _this.organizeform.Phone = v.Phone
+                _this.organizeform.Address = v.Address
                 _this.organizeform.description = v.Description
                 _this.organizeform.id = v.Id
                 // 选中状态
@@ -360,6 +401,7 @@
       },
       savedata(formName) {
         let _this = this
+        _this.organizeform.Category = _this.unitvalue
         this.$refs[formName].validate((valid) => {
           if (valid) {
             _this.organizeform.parentid = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
@@ -482,6 +524,15 @@
       clearSearch() {
         this.keyword = ''
         this.initData()
+      },
+      formatUnit (row, column) {
+        if (row.Category === '') {
+          return ''
+        } else if (row.Category === 'unit') {
+          return '二级单位'
+        } else {
+          return '三级单位'
+        }
       }
     }
   }