lining 6 anos atrás
pai
commit
23d363c423

+ 40 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappendsub.go

@@ -57,6 +57,46 @@ func (this *OilSupplierCertAppendSubController) GetList() {
 	this.ServeJSON()
 }
 
+// @Title 获取列表
+// @Description 获取列表
+// @Success 200 {object} []suppliercertappendsub.OilSupplierCertAppendSub
+// @router /getListInandApp [get]
+func (this *OilSupplierCertAppendSubController) GetListInAndApp() {
+
+	//获取分页信息
+	//page := this.GetPageInfoForm()
+	//where := " 1=1 "
+	//orderby := "Id"
+	//asc := false
+	//Order := this.GetString("Order")
+	//Prop := this.GetString("Prop")
+	//if Order != "" && Prop != "" {
+	//	orderby = Prop
+	//	if Order == "asc" {
+	//		asc = true
+	//	}
+	//}
+
+	//SupplierCertAppendId := this.GetString("SupplierCertAppendId")
+	//if SupplierCertAppendId != "" {
+	//	where = where + " and SupplierCertAppendId = " + SupplierCertAppendId
+	//}
+	SupplierCertId := this.GetString("SupCertId")
+	SupplierTypeCode := this.GetString("SupTypeCode")
+	SupplierCertAppendId := this.GetString("SupplierCertAppendId")
+	suwhere := `((SupplierCertId = ` + SupplierCertId + ` AND SupplierTypeCode = '` + SupplierTypeCode + `' AND TYPE IN ('1', '3'))
+				OR (SupplierCertId =  ` + SupplierCertId + ` AND SupplierTypeCode = '` + SupplierTypeCode + `' AND SupplierCertAppendId = ` + SupplierCertAppendId + `)) `
+		//" SupplierCertId = "+ SupplierCertId+ " and SupplierTypeCode = "+ SupplierTypeCode
+	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+	var list []suppliercertsub.OilSupplierCertSub
+	//svc.GetEntitysByWhere(OilSupplierCertAppendSubName, where, &list)
+	svc.GetEntitysByOrderbyWhere(OilSupplierCertSubName, suwhere,"CreateOn asc", &list)
+	var datainfo ErrorDataInfo
+	datainfo.Item = list
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 获取列表
 // @Description 获取列表
 // @Success 200 {object} []suppliercertappendsub.OilSupplierCertAppendSub

+ 1 - 1
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -169,7 +169,7 @@ module.exports = {
     'pages/oilsupplier/infochange/*.*',
     'pages/oilsupplier/infochangech/*.*',
     // 'pages/oilsupplier/supplier/*.*',
-    'pages/oilsupplier/supplierappend/*.*',
+    // 'pages/oilsupplier/supplierappend/*.*',
     'pages/oilsupplier/supplieraudit/*.*',
     'pages/oilsupplier/suppliercert/*.*',
     'pages/oilsupplier/supplierfile/*.*',

+ 22 - 15
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplierappendsub.js

@@ -1,49 +1,56 @@
 export default {
-  getList(params, myAxios) {
+  getList (params, myAxios) {
     return myAxios({
       url: '/suppliercertappendsub/getList',
       method: 'GET',
       params: params
-    });
+    })
+  },
+  getListInandApp (params, myAxios) {
+    return myAxios({
+      url: '/suppliercertappendsub/getListInandApp',
+      method: 'GET',
+      params: params
+    })
   },
-  getMyList(params, myAxios) {
+  getMyList (params, myAxios) {
     return myAxios({
       url: '/suppliercertappendsub/getMyList',
       method: 'GET',
       params: params
-    });
+    })
   },
-  getListAppend(params, myAxios) {
+  getListAppend (params, myAxios) {
     return myAxios({
       url: '/suppliercertappendsub/getListappend',
       method: 'GET',
       params: params
-    });
+    })
   },
-  getEntity(entityId, myAxios) {
+  getEntity (entityId, myAxios) {
     return myAxios({
-      url: '/suppliercertappendsub/get/'+entityId,
-      method: 'GET',
+      url: '/suppliercertappendsub/get/' + entityId,
+      method: 'GET'
     })
   },
-  addEntity(formData, myAxios) {
+  addEntity (formData, myAxios) {
     return myAxios({
       url: '/suppliercertappendsub/add',
       method: 'post',
       data: formData
     })
   },
-  updateEntity(entityId, formData, myAxios) {
+  updateEntity (entityId, formData, myAxios) {
     return myAxios({
-      url: '/suppliercertappendsub/update/'+entityId,
+      url: '/suppliercertappendsub/update/' + entityId,
       method: 'post',
       data: formData
     })
   },
-  deleteEntity(entityId, myAxios) {
+  deleteEntity (entityId, myAxios) {
     return myAxios({
-      url: '/suppliercertappendsub/delete/'+entityId,
+      url: '/suppliercertappendsub/delete/' + entityId,
       method: 'delete'
     })
-  },
+  }
 }

+ 68 - 24
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -5,7 +5,7 @@
       <el-breadcrumb-item :to="{ path: '/oilsupplier/supplierappend/goodslist' }">物资类列表</el-breadcrumb-item>
       <el-breadcrumb-item>编辑</el-breadcrumb-item>
     </el-breadcrumb>
-    <el-card class="box-card">
+    <el-card class="box-card" v-loading="cardloading">
       <div slot="header">
         <span>
           <i class="icon icon-table2"></i> 编辑
@@ -147,8 +147,8 @@
                 <el-table-column
                           label="是否为制造商" width="100">
                           <template slot-scope="scope">
-                              <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope)">非制造商</el-button>
-                              <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope)">制造商</el-button>
+                              <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" :disabled="isDisabledBtn()" @click="type_change(scope)">非制造商</el-button>
+                              <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" :disabled="isDisabledBtn()" @click="type_change(scope)">制造商</el-button>
                           </template>
                 </el-table-column>
                 <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
@@ -287,11 +287,13 @@
                v-loading="loading"
                title="物资类业务列表"
                :visible.sync="goodsDialog"
+               @open="opendialogadd"
                top="5vh">
       <el-tabs v-model="tabIdx"
                style="margin-top: -30px;">
         <el-tab-pane label="准入编码"
                      name="1">
+          {{loading}}
           <el-form label-width="150px" v-loading="dialogloading" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData" style="padding-top: 15px">
             <el-row style="margin-top: -10px">
               <el-col :span="12">
@@ -588,6 +590,9 @@
       }
       return {
         // 456
+        Grade: '',
+        OperType: '',
+        cardloading: '',
         Remark: '',
         Remark1: '',
         loading: false,
@@ -622,6 +627,7 @@
         ComAuditdialogShow: false,
         organizeOption: [], // 审批部门
         auditerOption: [], // 审批人
+        SupplierformData: {},
         orgtreeprops: {
           value: 'Id',
           label: 'CodeName',
@@ -794,7 +800,10 @@
         Id: '', // 传的参数
         editFlag: '', // 编辑操作标记
         waituploads: [], // 等待上传的附件列表
-        IsCompanyUser: ''
+        IsCompanyUser: '',
+        isFirstOpen: true,
+        node_had: {},
+        resolve_had: {}
       }
     },
     created () {
@@ -814,6 +823,19 @@
       this.initData2019()
     },
     methods: {
+      isDisabledBtn () {
+        if (this.OperType !== '制造商') {
+          return true
+        } else {
+          return false
+        }
+      },
+      opendialogadd () {
+        if (!this.isFirstOpen) {
+          this.node_had.childNodes = []
+          this.getChildrens(this.node_had, this.resolve_had)
+        }
+      },
       addSortData1 () {
         this.goodsDialog = true
       },
@@ -956,13 +978,22 @@
 
       // 获取下一级所有分类
       getChildrens (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
         }
-        this.$axios.get('goodsaptitude/goodschildlistbypid/' + 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
@@ -1116,6 +1147,18 @@
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.getSortList()
           _this.getMySortList()
+          _this.getSupplier()
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getSupplier () {
+        suppapi.getEntity(this.formData.SupplierId, this.$axios).then(res => {
+          this.SupplierformData = res.data
+          if (this.SupplierformData) {
+            this.Grade = this.SupplierformData.Grade
+            this.OperType = this.SupplierformData.OperType
+          }
         }).catch(err => {
           console.error(err)
         })
@@ -1401,7 +1444,7 @@
         }
 
         // 访问接口
-        api.getList(params, this.$axios).then(res => {
+        api.getListInandApp(params, this.$axios).then(res => {
           this.entityList = res.data.item
           // this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
@@ -1574,8 +1617,9 @@
 
       // 添加增项分类信息
       addSortAppend () {
-        let _this = this
-        _this.loading = true
+        // debugger
+        // let _this = this
+        this.loading = true
         let params = {
           SupplierId: parseInt(this.formData.SupplierId),
           SupplierCertId: parseInt(this.formData.SupplierCertId),
@@ -1585,50 +1629,50 @@
           Remark: this.dialogFormData.Remark,
           Type: '2'
         }
-        if (_this.checkList.length > 0) {
+        if (this.checkList.length > 0) {
           params = Object.assign(params, {
-            CheckList: _this.checkList
+            CheckList: this.checkList
           })
         } else {
-          _this.loading = false
-          _this.$message({
+          this.loading = false
+          this.$message({
             type: 'warning',
             message: '名称不能为空,请选择分类!'
           })
           return
         }
-        _this.$axios.post('/suppliercertappendsub/addgoodsbus/', params)
+        this.$axios.post('/suppliercertappendsub/addgoodsbus/', params)
           .then(res => {
-            _this.dialogloading = false
-            _this.loading = false
+            this.dialogloading = false
+            // _this.loading = false
             if (res.data.code === 0) {
-              _this.$message({
+              this.$message({
                 type: 'success',
                 message: res.data.message
               })
               // 关闭dialog
-              _this.dialogVisible = false
+              this.dialogVisible = false
               // 更新增项分类表
-              _this.loading = false
-              _this.getSortList()
-              _this.getMySortList()
-              _this.getFileList()
+              this.loading = false
+              this.getSortList()
+              this.getMySortList()
+              this.getFileList()
             } else {
-              _this.loading = false
-              _this.$message({
+              this.loading = false
+              this.$message({
                 type: 'warning',
                 message: res.data.message
               })
             }
           })
           .catch(err => {
+            this.loading = false
             console.error(err)
           })
         this.$refs.orgmanagetree.setCheckedKeys([])
         this.$refs.secmanagetree.setCheckedKeys([])
         this.filterText = ''
         this.searchText = ''
-        _this.loading = false
       },
 
       // 删除增项分类信息