2
3
lining 6 سال پیش
والد
کامیت
78b0d5f262

+ 2 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -9,6 +9,7 @@ type OilSupplierCertSub struct {
 	SupplierId           int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
 	SupplierCertId       int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
 	SupplierCertAppendId int       `xorm:"not null comment('增项信息表ID') INT(10)"`
+	GoodsLevel           string    `xorm:"not null default '' comment('级别')"`
 	IsManufacturer		 int	   `xorm:"not null comment('是否为供应商') INT(11)"`
 	SupplierTypeCode     string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
 	SubClassId           int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
@@ -55,6 +56,7 @@ type goodsChecked struct {
 	Code     string
 	Name     string
 	CodeName string
+	GoodsLevel string
 }
 type SupplierCertSubModel struct {
 	CheckList        []goodsChecked //批量添加准入范围

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

@@ -877,7 +877,11 @@ func (this *OilGoodsAptitudeController) GoodsChildList() {
 // @router /goodschildlistbypid/:parentid [get]
 func (this *OilGoodsAptitudeController) GoodsChildLisByParentId() {
 	ParentId := this.Ctx.Input.Param(":parentid")
-	sqlStr := "SELECT Id, `Code`, `Name`, concat(Code, '  ', Name) as CodeName, ParentId, (CASE WHEN length(Code)>=8 THEN '1' ELSE '0' END) as Leaf FROM OilGoodsAptitudeClass WHERE ParentId = '" + ParentId + "' AND Edition='1' AND DeletionStateCode = 0 order by Code"
+	sqlStr := "SELECT o.Id, o.`Code`, o.`Name`, concat(o.Code, '  ', o.Name) as CodeName, o.ParentId, g.GoodsLevel," +
+		" (CASE WHEN length(Code)>=8 THEN '1' ELSE '0' END) as Leaf FROM OilGoodsAptitudeClass o " +
+		" LEFT JOIN `OilGoodsAptitude` g ON (g.ClassId = o.Id)" +
+		" WHERE o.ParentId = '" + ParentId + "' AND o.Edition='1' AND o.DeletionStateCode = 0 order by o.Code"
+
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	list, _ := svc.DBE.QueryString(sqlStr)
 	var datainfo DataInfo

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

@@ -375,6 +375,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
 			datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
 			datamain.Code = dataother.CheckList[n].Code
 			datamain.Name = dataother.CheckList[n].Name
+			datamain.GoodsLevel = dataother.CheckList[n].GoodsLevel
 			datamain.Remark = dataother.Remark
 			datamain.IsDelete = 0
 			datamain.CreateBy = this.User.Realname

+ 20 - 8
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist.vue

@@ -30,12 +30,19 @@
         <el-table-column prop="Name"
                          label="分类名称"
                          show-overflow-tooltip></el-table-column>
-        <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,canadd,newcanadd)">非制造商</el-button>
-                    <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope,canadd,newcanadd)">制造商</el-button>
-                  </template>
+        <el-table-column prop="GoodsLevel"
+                         label="级别" width="80px"
+                         show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span v-if="scope.row.GoodsLevel=='1'">一级</span>
+            <span v-if="scope.row.GoodsLevel=='2'">二级</span>
+          </template>
+        </el-table-column>
+        <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,canadd,newcanadd)" :disabled="operType != '制造商'">非制造商</el-button>
+            <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" @click="type_change(scope,canadd,newcanadd)" :disabled="operType != '制造商'">制造商</el-button>
+          </template>
         </el-table-column>
         <el-table-column prop="CertSubStatus"
                          label="状态"
@@ -232,6 +239,10 @@ export default {
   name: 'GoodsList',
   components: {},
   props: {
+    operType: {
+      type: String,
+      default: ''
+    },
     canadd: {
       type: Boolean,
       default: false
@@ -278,6 +289,7 @@ export default {
       orgtreeprops: {
         value: 'Id',
         label: 'CodeName',
+        GoodsLevel: 'GoodsLevel',
         children: 'children',
         isLeaf: 'Leaf',
         disabled: 'disabled'
@@ -498,7 +510,7 @@ export default {
         return
       }
       _this.loading = true
-      _this.$axios.post('/suppliercertsub/addgoodsbus', params)
+        _this.$axios.post('/suppliercertsub/addgoodsbus', params)
         .then(res => {
           if (res.data.code === 0) {
             _this.$message({
@@ -589,7 +601,7 @@ export default {
       let name = _this.searchText
       this.$axios.get('goodsaptitude/goodsparentlist/' + name)
         .then(res => {
-          _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName')
+          _this.sectreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Code,Name,CodeName,GoodsLevel')
         })
         .catch(err => {
           console.error(err)

+ 1 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -310,6 +310,7 @@
                       @close="getbuslist"
                       :canadd="add_flat"
                       :candelete="delete_flat"
+                      :operType="formData.OperType"
                       height="360px"
                       style="margin-top: 20px"></goods-list>
         </el-tab-pane>