Ver Fonte

服务类

白承飞 há 5 anos atrás
pai
commit
c67696bf8f

+ 1 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -612,7 +612,7 @@ func (this *OilSupplierCertSubController) CheckTechCertLost() {
 		}
 
 		var fileist []supplierfile.OilSupplierFile
-		where := "SupplierTypeCode in (03,000) and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
+		where := "SupplierTypeCode in ('03','000') and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
 		svcSupplier.GetEntitysByWhere(OilSupplierFileName, where, &fileist)
 
 		var companyHasHeaders string

+ 138 - 15
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -606,7 +606,7 @@
       </div>
     </el-dialog>
     <!-- 增项分类添加、修改 -->
-    <el-dialog title="添加" :visible.sync="dialogVisible">
+    <el-dialog title="添加" :visible.sync="dialogVisible" @open="opendialogadd">
       <el-form label-width="150px" ref="dialogFormData" v-loading="dialogloading" :rules="sortEntityFormRules" :model="dialogFormData">
         <el-row style="margin-top: -10px">
           <el-col :span="12">
@@ -614,18 +614,50 @@
             <el-button style="float: right;" type="primary" size="mini" @click="getorgtreelist()">查询</el-button>
           </el-col>
         </el-row>
-        <el-row :gutter="20" style="height: calc(100vh - 450px); overflow: auto; margin-top:20px">
-          <el-col :span="20">
-            <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
-              :props="orgtreeprops" ref="orgmanagetree" show-checkbox>
-            </el-tree>
+        <el-row :gutter="15">
+          <el-col :span="14">
+            <el-row :gutter="20" style="height: calc(100vh - 450px); margin-top:10px; overflow: auto;">
+              <el-col :span="20">
+                <el-tree highlight-current :expand-on-click-node="true" node-key="CodeName" :data="orgtreelist"
+                         :props="orgtreeprops" style="width: 100%; height: calc(100vh - 450px);"
+                         @check="checkLostCertTimeOut" ref="orgmanagetree" show-checkbox>
+                </el-tree>
+              </el-col>
+            </el-row>
+            <el-row style="margin-top: 30px">
+              备注信息:
+              <el-col :span="24">
+                <el-input v-model="dialogFormData.Remark"
+                          type="textarea"
+                          :rows=3
+                          placeholder="请输入备注信息"></el-input>
+              </el-col>
+            </el-row>
           </el-col>
-        </el-row>
-        <el-row style="margin-top: 30px">
-          备注信息:
-          <el-col :span="24">
-            <el-input type="textarea" :rows=3 v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%">
-            </el-input>
+          <el-col :span="10">
+            <el-table
+              height="calc(100vh - 325px)"
+              row-class-name="warning-row"
+              highlight-current-row
+              :data="lostTableData"
+              border
+              size="mini"
+              style="width: 100%; margin-top:10px">
+              <el-table-column
+                prop="Code"
+                label="准入编码">
+                <template slot-scope="scope">
+                  {{scope.row.Code + ' ' + scope.row.Name}}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="CertFileName"
+                label="缺少资质">
+                <template slot="header" slot-scope="scope">
+                  <span style="color: red">{{'缺少资质(' + (lostTableData ? lostTableData.length : 0) + ')'}}</span>
+                </template>
+              </el-table-column>
+            </el-table>
           </el-col>
         </el-row>
       </el-form>
@@ -965,6 +997,8 @@
       }
       return {
         firOptions: [],
+        isFirstOpen: true,
+        node_had: {},
         btnloading: false,
         myitemsshow: false,
         disabled: false,
@@ -1436,7 +1470,8 @@
           ],
           EffectDate:
             [{ required: true, validator: effectDate, trigger: 'change' }]
-        }
+        },
+        lostTableData: []
       }
     },
     watch: {
@@ -1540,7 +1575,96 @@
           })
         })
       },
+      checkLostCertTimeOut () {
+        let _this = this
+        this.loading = true
+        setTimeout(function () {
+          _this.$nextTick(() => {
+            _this.checkLostCert()
+          })
+        }, 100)
+      },
+      checkLostCert () {
+        let _this = this
+        let params = {
+          SupplierId: parseInt(_this.formData.SupplierId),
+          SupplierCertId: parseInt(_this.formData.SupplierCertId),
+          SupplierTypeCode: '03',
+          Type: '1',
+          CertSubStatus: '-1',
+          Remark: _this.Remark
+        }
+
+        let val = this.$refs.orgmanagetree.getCheckedNodes()
+        this.checkList = []
+        for (var i = 0; i < val.length; i++) {
+          if (!val[i].children || val[i].children.length <= 0) {
+            this.checkList.push(val[i])
+          }
+        }
+        if (_this.checkList.length > 0) {
+          params = Object.assign(params, {
+            CheckList: _this.checkList
+          })
+        } else {
+          _this.lostTableData = []
+          this.loading = false
+          return
+        }
+        _this.$axios.post('/suppliercertsub/tech-cert-lost', params).then(res => {
+          _this.lostTableData = res.data
+          this.loading = false
+        }).catch(err => {
+          this.loading = false
+          console.error(err)
+        })
+      },
+      // 获取下一级所有分类
+      getChildrens (val, resolve) {
+        console.log('自分类', val, resolve)
+        if (this.isFirstOpen) {
+          this.node_had = val
+          this.resolve_had = resolve
+          this.isFirstOpen = false
+        }
 
+        let Id = 0
+        if (val.level === 0) {
+          Id = 0
+        } else {
+          Id = val.data.Id
+        }
+        let params = {
+          GoodsLevel: this.Grade
+        }
+        this.$axios.get('goodsaptitude/goodschildlistbypid/' + Id, {params})
+          .then(res => {
+            if (!res.data.items || res.data.items.length <= 0) {
+              val.isLeaf = true
+              return resolve([])
+            }
+            for (let idx in res.data.items) {
+              if (res.data.items[idx].Code.length <= 4) {
+                res.data.items[idx].disabled = true
+              }
+              res.data.items[idx].Leaf = res.data.items[idx].Leaf === '1'
+            }
+            return resolve(res.data.items)
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      filterNode (value, data) {
+        if (!value) return true
+        return data.CodeName.indexOf(value) !== -1
+      },
+      opendialogadd () {
+        if (!this.isFirstOpen) {
+          this.node_had.childNodes = []
+          this.getChildrens(this.node_had, this.resolve_had)
+        }
+      },
       lineheight (list) {
         return list * 23 + ''
       },
@@ -2064,8 +2188,6 @@
           }
         })
       },
-
-
       // 获取资质文件
       getFileList () {
         this.SupplierId = this.formData.SupplierId
@@ -2496,6 +2618,7 @@
       // 取消
       cancelOption () {
         this.dialogVisible = false
+
       },
 
       // 确定