Explorar o código

BF: 2019.5.16- 3,4,5,7

yuedefeng %!s(int64=6) %!d(string=hai) anos
pai
achega
0a5d30324b

+ 3 - 3
src/dashoo.cn/backend/api/business/oilsupplier/infochange/infochange.go

@@ -24,8 +24,8 @@ type OilInfoChange struct {
 	OldGrade            string    `xorm:"comment('级别') VARCHAR(2)"`
 	MgrUnit             string    `xorm:"comment('管理单位') VARCHAR(50)"`
 	OldMgrUnit          string    `xorm:"comment('管理单位') VARCHAR(50)"`
-	OperType            string    `xorm:"comment('经营方式') CHAR(1)"`
-	OldOperType         string    `xorm:"comment('经营方式') CHAR(1)"`
+	OperType            string    `xorm:"comment('经营方式') VARCHAR(50)"`
+	OldOperType         string    `xorm:"comment('经营方式') VARCHAR(50)"`
 	Country             string    `xorm:"comment('国家') VARCHAR(20)"`
 	MaunAgent           string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
 	ConstructTeam       string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`
@@ -117,7 +117,7 @@ type SuppModelInfo struct {
 	OilCertificateNo   string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
 	Grade              string    `xorm:"comment('级别') VARCHAR(2)"`
 	MgrUnit            string    `xorm:"comment('管理单位') VARCHAR(50)"`
-	OperType           string    `xorm:"comment('经营方式') CHAR(1)"`
+	OperType           string    `xorm:"comment('经营方式') VARCHAR(50)"`
 	Country            string    `xorm:"comment('国家') VARCHAR(20)"`
 	MaunAgent          string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
 	ConstructTeam      string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -14,7 +14,7 @@ type OilSupplier struct {
 	OilCertificateNo   string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
 	Grade              string    `xorm:"comment('级别') VARCHAR(2)"`
 	MgrUnit            string    `xorm:"comment('管理单位') VARCHAR(50)"`
-	OperType           string    `xorm:"comment('经营方式') CHAR(1)"`
+	OperType           string    `xorm:"comment('经营方式') VARCHAR(50)"`
 	Country            string    `xorm:"comment('国家') VARCHAR(20)"`
 	MaunAgent          string    `xorm:"comment('所代理制造商名称') VARCHAR(100)"`
 	ConstructTeam      string    `xorm:"comment('施工队伍名称') VARCHAR(100)"`

+ 1 - 1
src/dashoo.cn/backend/api/business/register/oilcorporateinfo.go

@@ -11,7 +11,7 @@ type OilCorporateInfo struct {
 	OilCertificateNo string    `xorm:"comment('中石油供应商证书号') VARCHAR(50)"`
 	Grade            string    `xorm:"comment('级别') VARCHAR(2)"`
 	MgrUnit          string    `xorm:"comment('管理单位') VARCHAR(50)"`
-	OperType         string    `xorm:"comment('经营方式') CHAR(1)"`
+	OperType         string    `xorm:"comment('经营方式') VARCHAR(50)"`
 	Country          string    `xorm:"comment('国家') VARCHAR(20)"`
 	CommercialNo     string    `xorm:"comment('工商注册号/统一社会信用代码') VARCHAR(50)"`
 	OrganCode        string    `xorm:"comment('组织机构代码') VARCHAR(50)"`

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

@@ -1412,6 +1412,7 @@ func (this *OilSupplierController) GetDictListByStatus() {
 	dictList["UnitRelation"] = dictSvc.GetKeyValueItems("UnitRelation")
 	dictList["CompanyType"] = dictSvc.GetKeyValueItems("CompanyType")
 	dictList["InOptions"] = dictSvc.GetKeyValueItems("InOptions")
+	dictList["OperType"] = dictSvc.GetKeyValueItems("OperType")
 	var userEntity userRole.Base_User
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)

+ 21 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -34,6 +34,16 @@
             </el-input>
           </el-form-item>
         </el-col> -->
+        <el-col :span="8">
+          <el-form-item label="供应商类型">
+            <el-select ref="OperType" v-model="formData.OperType" :disabled="!canUpdateSupplier"
+                       placeholder="请选择" style="width: 100%">
+              <el-option v-for="item in OperTypeOptions" :key="item.Id" :label="item.Key"
+                         :value="item.Key">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
 
         <el-col :span="8">
           <el-form-item label="单位关系">
@@ -66,7 +76,7 @@
         <el-col :span="8">
           <el-form-item label="准入方式">
             <el-select  ref="inStyle" v-model="formData.InStyle" :disabled="!canUpdateSupplier"
-                       placeholder="请选择" style="width: 100%">
+                       placeholder="请选择" style="width: 100%" @change="InStyleChange">
               <el-option  v-for="item in InOptions" :key="item.Id" :label="item.Key"
                          :value="item.Value">
               </el-option>
@@ -333,12 +343,12 @@
             <el-input v-model="formData.CompanyUrl" placeholder="请输入" style="width: 100%"></el-input>
           </el-form-item>
         </el-col>-->
-        <el-col :span="8">
+        <!--<el-col :span="8">
           <el-form-item label="级别" >
             <el-input v-model="formData.Level" maxlength="255" placeholder="请输入" style="width: 100%">
             </el-input>
           </el-form-item>
-        </el-col>
+        </el-col>-->
         <el-col :span="8">
           <el-form-item label="HSE审查培训">
             <!--<el-input v-model="formData.HseTraining" placeholder="请输入" style="width: 100%"></el-input>-->
@@ -561,6 +571,7 @@
         companynames: [],
         ManagementUnitOptions:[],
         UnitRelationOptions: [],
+        OperTypeOptions: [],
         InOptions: [],
         CompanyTypeOptions: [],
         UnitRelationAry: [],
@@ -714,7 +725,12 @@
       }
     },
     methods: {
-      currentSel(event){
+      InStyleChange (val) {
+        if (val === '2') {
+          this.formData.MgrUnit = '中国石油天然气股份有限公司'
+        }
+      },
+      currentSel (event) {
         if (event==2){
           this.formData.InStyle='5'
           // for(let item of this.$refs.inStyle.options) {
@@ -800,6 +816,7 @@
         if (this.dictData) {
           this.ManagementUnitOptions=this.dictData['ManagementUnit']
           this.UnitRelationOptions = this.dictData['UnitRelation']
+          this.OperTypeOptions  = this.dictData['OperType']
           this.InOptions = this.dictData['InOptions']
           this.CompanyTypeOptions = this.dictData['CompanyType']
           this.getCityList(this.dictData['GaodeMapChinaAreas'])

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

@@ -918,6 +918,7 @@
       saveEntity() {
         let valid1 = false
         let valid2 = false
+
         this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
           valid1 = valid
         })
@@ -926,6 +927,26 @@
           valid2 = valid
         })
 
+        if (this.formData.OperType === '制造商') {
+            if (this.formData.MaunLicense === '' && this.formData.SafetyLicense === '') {
+              valid1 = false
+              this.$message({
+                type: 'warning',
+                message: '【生产制造许可证获证情况及编号】或【安全生产许可证】 为必填项'
+              })
+              return
+            }
+        } else if (this.formData.OperType === '代理商') {
+          if (this.formData.AgentManufacturer === '') {
+            valid1 = false
+            this.$message({
+              type: 'warning',
+              message: '【所代理制造商名称】不能为空'
+            })
+            return
+          }
+        }
+
         if (valid1 && valid2) {
           if (!this.formData.SetupTime) {
             this.formData.SetupTime = null