Browse Source

前:可以修改准入范围的制造商非制造商

dubch 4 years ago
parent
commit
e27a4e8262

+ 119 - 8
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -25,13 +25,22 @@
             <span v-if="scope.row.GoodsLevel=='2'">二级</span>
           </template>
         </el-table-column>
-        <el-table-column
-                  label="是否为制造商" width="120px" v-if="SupplierTypeCode == '01'" sortable>
-                  <template slot-scope="scope">
-                    <el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
-                    <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
-                    <span v-else>——</span>
-                  </template>
+        <el-table-column width="220px" align="center" v-if="SupplierTypeCode == '01'" sortable prop="IsManufacturer">
+          <template slot="header" slot-scope="scope">
+            <el-button-group >
+              <el-button type="plain" :disabled="isDisabledBtn(1)" size="mini" @click="setManufacturer(1)">制造商</el-button>
+              <el-button type="plain" :disabled="isDisabledBtn(2)" size="mini" @click="setManufacturer(2)">非制造商</el-button>
+            </el-button-group>
+          </template>
+<!--                  <template slot-scope="scope">-->
+<!--                    <el-tag type="info" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row)" :disabled="isDisabledBtn(1)">非制造商</el-tag>-->
+<!--                    <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row)" :disabled="isDisabledBtn(2)">制造商</el-tag>-->
+<!--                    <span v-else>——</span>-->
+<!--                  </template>-->
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row)" :disabled="isDisabledBtn(1)">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row)" :disabled="isDisabledBtn(2)">制造商</el-button>
+          </template>
         </el-table-column>
          <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip sortable>
             <template slot-scope="scope">
@@ -135,6 +144,10 @@
     name: 'EquipmentList',
     components: {},
     props: {
+      operType: {
+        type: String,
+        default: ''
+      },
       canadd: {
         type: Boolean,
         default: false
@@ -179,6 +192,7 @@
         loading: false,
         Ids: [],
         SupplierId: 0,
+        Status: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
         // 列表排序
@@ -248,6 +262,99 @@
         this.currentPage = 1
         this.initData()
       },
+      isDisabledBtn (val) {
+        if (this.operType !== '制造商') {
+          if ((this.Status <= 0) && val === 2) {
+            return false
+          }
+          return true
+        } else {
+          if (this.Status <= 0) {
+            return false
+          } else {
+            return true
+          }
+        }
+      },
+      setManufacturer (operTag) {
+        let _this = this
+        let message = '是否将全部准入范围改为'
+        if (operTag === 1) {
+          message += '制造商?'
+        } else {
+          message += '非制造商?'
+        }
+        _this.$confirm(message, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            const delload = this.$loading({
+              lock: true,
+              text: '正在设置请稍后...'
+            })
+            let postData = {
+              CertSubIdList: [],
+              SupplierId: parseInt(this.SupplierId),
+              SupplierCertId: parseInt(this.SupplierCertId),
+              IsManufacturer: operTag
+            }
+            _this.$axios.post('suppliercertsub/modify-manufacturers/' + this.SupplierCertId, postData)
+              .then(function (response) {
+                if (response.data.code === 0) {
+                  _this.$message({
+                    duration: 10000,
+                    type: 'success',
+                    message: response.data.message
+                  })
+                  delload.close()
+                  _this.initData()
+                } else {
+                  delload.close()
+                  _this.$message({
+                    duration: 10000,
+                    type: 'warning',
+                    message: response.data.message
+                  })
+                }
+              })
+              .catch(function (error) {
+                console.log(error)
+              })
+          })
+          .catch((ex) => {
+            console.error(ex)
+          })
+      },
+      type_change (val) {
+        if (this.Status <= 0) {
+          let postData = {
+            CertSubIdList: [],
+            SupplierId: parseInt(this.SupplierId),
+            SupplierCertId: parseInt(this.SupplierCertId),
+            IsManufacturer: val.IsManufacturer === 1 ? 2 : 1
+          }
+          this.$axios.post('suppliercertsub/modify-manufacturer/' + val.Id, postData).then(res => {
+            if (res.data.code === 0) {
+              this.$message({
+                duration: 10000,
+                type: 'success',
+                message: '更改成功'
+              })
+              this.initData()
+            } else {
+              this.$message({
+                duration: 10000,
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+        }
+      },
       changeCertSubStatus (row, column, cell, event) {
         if (this.newcanadd && column.property === 'CertSubStatus') {
           this.$confirm('确定更改此准入范围状态吗?', '提示', {
@@ -278,12 +385,16 @@
           this.Ids.push(val[i].Id)
         }
       },
-      getvalue (SupplierId, SupplierTypeCode, certId) {
+      getvalue (SupplierId, SupplierTypeCode, certId, Status) {
         this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
         this.SupplierCertId = certId
+        this.Status = Status
         this.initData()
       },
+      getvalue1 (Status) {
+        this.Status = Status
+      },
       // 列表排序功能
       orderby (column) {
         if (column.order == 'ascending') {

+ 9 - 6
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -59,16 +59,16 @@
           </template>
         </el-table-column>
 
-        <el-table-column align="center" width="200">
+        <el-table-column align="center" width="220" sortable prop="IsManufacturer">
           <template slot="header" slot-scope="scope">
             <el-button-group >
-              <el-button type="plain" :disabled="isDisabledBtn()" size="mini" @click="setManufacturer(1)">制造商</el-button>
-              <el-button type="plain" :disabled="isDisabledBtn()" size="mini" @click="setManufacturer(2)">非制造商</el-button>
+              <el-button type="plain" :disabled="isDisabledBtn(1)" size="mini" @click="setManufacturer(1)">制造商</el-button>
+              <el-button type="plain" :disabled="isDisabledBtn(2)" size="mini" @click="setManufacturer(2)">非制造商</el-button>
             </el-button-group>
           </template>
           <template slot-scope="scope">
-            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">非制造商</el-button>
-            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn()">制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn(1)">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope.row,canadd,newcanadd)" :disabled="isDisabledBtn(2)">制造商</el-button>
           </template>
         </el-table-column>
         <el-table-column prop="CertSubStatus"
@@ -414,8 +414,11 @@
         this.Column.Prop = column.prop
         this.initData()
       },
-      isDisabledBtn () {
+      isDisabledBtn (val) {
         if (this.operType !== '制造商') {
+          if ((this.canadd || this.newcanadd) && val === 2) {
+            return false
+          }
           return true
         } else {
           if (this.canadd || this.newcanadd) {

+ 2 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -890,7 +890,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" :canadd="false" height="360px"
+          <business-list ref="businessList" :data.sync="businessList" :canadd="false" :operType="formData.OperType" height="360px"
                          style="margin-top: 20px"></business-list>
         </el-tab-pane>
 
@@ -2724,6 +2724,7 @@
               this.$refs['patentList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
               this.$refs['winningList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
               this.$refs['businessList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
+              this.$refs['businessList'].getvalue1(this.Status)
               this.$refs['manufacturerList'].getvalue(this.certId)
               // this.$refs['subfileList'].getvalue(res.data.Id, this.SupplierTypeCode, this.certId)
               if (this.certId && this.WorkflowId && this.$refs['WfHistory']) {

+ 36 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -746,8 +746,8 @@
                     <el-table-column
                       label="是否为制造商" width="100">
                       <template slot-scope="scope">
-                        <el-tag type="info" size="small" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
-                        <el-tag type="success" size="small" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
+                        <el-tag type="info" size="small" v-if="scope.row.IsManufacturer == 2" @click="type_change1(scope.row)" :disabled="isDisabledBtn(1)">非制造商</el-tag>
+                        <el-tag type="success" size="small" v-else-if="scope.row.IsManufacturer == 1" @click="type_change1(scope.row)" :disabled="isDisabledBtn(2)">制造商</el-tag>
                         <span v-else>——</span>
                       </template>
                     </el-table-column>
@@ -795,8 +795,8 @@
                     <el-table-column
                       label="是否为制造商" width="110">
                       <template slot-scope="scope">
-                        <el-button type="primary" plain size="small" v-if="scope.row.IsManufacturer == 2" :disabled="isDisabledBtn()" @click="type_change(scope)">非制造商</el-button>
-                        <el-button type="primary" plain size="small" v-if="scope.row.IsManufacturer == 1" :disabled="isDisabledBtn()" @click="type_change(scope)">制造商</el-button>
+                        <el-button type="primary" plain size="small" v-if="scope.row.IsManufacturer == 2" :disabled="isDisabledBtn(1)" @click="type_change(scope)">非制造商</el-button>
+                        <el-button type="primary" plain size="small" v-if="scope.row.IsManufacturer == 1" :disabled="isDisabledBtn(2)" @click="type_change(scope)">制造商</el-button>
                       </template>
                     </el-table-column>
                     <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
@@ -2201,8 +2201,11 @@
           console.error(err)
         })
       },
-      isDisabledBtn () {
+      isDisabledBtn (val) {
         if (this.OperType !== '制造商') {
+          if (val === 2) {
+            return false
+          }
           return true
         } else {
           return false
@@ -2517,6 +2520,34 @@
         }
         this.getSortList()
       },
+      type_change1 (val) {
+        if (this.currentStatus <= 0 && this.currentStatus != -5) {
+          let postData = {
+            CertSubIdList: [],
+            SupplierId: parseInt(this.SupplierId),
+            SupplierCertId: parseInt(this.SupplierCertId),
+            IsManufacturer: val.IsManufacturer === 1 ? 2 : 1
+          }
+          this.$axios.post('suppliercertsub/modify-manufacturer/' + val.Id, postData).then(res => {
+            if (res.data.code === 0) {
+              this.$message({
+                duration: 10000,
+                type: 'success',
+                message: '更改成功'
+              })
+              this.initData()
+            } else {
+              this.$message({
+                duration: 10000,
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
+        }
+      },
       getFirAuditerByDept () {
         let deptid = this.authUser.Profile.DepartmentId
         this.userOptions = []

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue

@@ -17,8 +17,8 @@
                 <!--style="margin-left:10px; margin-top: -4px;">添加</el-button>-->
             <!--</router-link>-->
             <el-button v-if="IsCompanyUser == 0" type="primary" size="mini"
-                       style="margin-left:10px; margin-top: -4px;" @click="addappend">添加</el-button>
-            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                       style="margin-left:10px; margin-top: -3px;" @click="addappend">添加</el-button>
+            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -3px;"
               @click="addAppendCom" :loading="addLoading">添加
             </el-button>
           </span>

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue

@@ -16,8 +16,8 @@
               <!---->
             <!--</router-link>-->
             <el-button v-if="IsCompanyUser == 0" type="primary" size="mini"
-                       style="margin-left:10px; margin-top: -4px;" @click="addappend">添加</el-button>
-            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                       style="margin-left:10px; margin-top: -3px;" @click="addappend">添加</el-button>
+            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -3px;"
               @click="addAppendCom" :loading="addLoading">添加
             </el-button>
           </span>

+ 2 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

@@ -17,8 +17,8 @@
                 <!--style="margin-left:10px; margin-top: -4px;">添加</el-button>-->
             <!--</router-link>-->
             <el-button v-if="IsCompanyUser == 0" type="primary" size="mini"
-                       style="margin-left:10px; margin-top: -4px;" @click="addappend">添加</el-button>
-            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                       style="margin-left:10px; margin-top: -3px;" @click="addappend">添加</el-button>
+            <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -3px;"
               @click="addAppendCom" :loading="addLoading">添加
             </el-button>
           </span>