浏览代码

物资类选择国家

yuedefeng 6 年之前
父节点
当前提交
5b5a243365

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

@@ -1006,6 +1006,7 @@ func (this *OilSupplierController) GetDictList() {
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 	dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
+	dictList["CountryList"] = areaJsonSvc.GetCountryList()
 	//获取我创建的所有公司
 	var list []supplier.OilSupplier
 	if this.User.IsCompanyUser == 1 {
@@ -1058,6 +1059,7 @@ func (this *OilSupplierController) GetDictListByStatus() {
 	userSvc.GetEntityById(this.User.Id, &userEntity)
 	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
 	dictList["GaodeMapChinaAreas"] = areaJsonSvc.GetGaodeMapChinaAreas()
+	dictList["CountryList"] = areaJsonSvc.GetCountryList()
 	//获取我创建的所有公司
 	var list []supplier.OilSupplier
 	if this.User.IsCompanyUser == 1 {

+ 3 - 3
src/dashoo.cn/frontend_web/src/components/oilsupplier/basisinfo.vue

@@ -30,7 +30,7 @@
 
         <el-col :span="8">
           <el-form-item label="单位关系">
-            <el-select ref="SpecType" multiple v-model="formData.SpecTypeCode" :disabled="!canUpdateSupplier"
+            <el-select ref="SpecType" v-model="formData.SpecTypeCode" :disabled="!canUpdateSupplier"
                placeholder="请选择" style="width: 100%">
               <el-option v-for="item in UnitRelationOptions" :key="item.Id" :label="item.Key" :value="item.Value">
               </el-option>
@@ -404,10 +404,10 @@
         CityAry: [],
         LinkCityAry: [],
         HSEOptions: [{
-          value: '1',
+          value: 1,
           label: '是'
         }, {
-          value: '0',
+          value: 0,
           label: '否'
         }],
 

+ 32 - 9
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -39,8 +39,18 @@
 
         <el-col :span="12">
           <el-form-item label="国家" prop="Country" >
-            <el-input v-model="formData.Country" maxlength="255" :readonly="!canUpdateSupplier" placeholder="请输入" style="width: 100%">
-            </el-input>
+            <!--<el-input v-model="formData.Country" maxlength="255" :readonly="!canUpdateSupplier" placeholder="请输入" style="width: 100%">
+            </el-input>-->
+            <el-select v-model="formData.Country" filterable placeholder="请选择" :disabled="!canUpdateSupplier" style="width: 100%">
+              <el-option
+                v-for="item in countryListOptions"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value">
+                <span style="float: left">{{ item.value }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.label }}</span>
+              </el-option>
+            </el-select>
           </el-form-item>
         </el-col>
 
@@ -412,6 +422,7 @@
         CompanyTypeOptions: [],
         UnitRelationAry: [],
         countryoptions: [],
+        countryListOptions: [],
         countryprops: {
           value: 'adcode',
           label: 'name',
@@ -420,10 +431,10 @@
         CityAry: [],
         LinkCityAry: [],
         HSEOptions: [{
-          value: '1',
+          value: 1,
           label: '是'
         }, {
-          value: '0',
+          value: 0,
           label: '否'
         }],
 
@@ -486,10 +497,10 @@
             message: '请输入邮箱地址',
             trigger: 'change'
           },
-            {
-              validator: this.checkemail,
-              trigger: 'change'
-            }],
+          {
+            validator: this.checkemail,
+            trigger: 'change'
+          }],
           OrganCode: [{
             required: true,
             message: '请输入组织机构代码',
@@ -579,8 +590,9 @@
       getDictOptions () {
         if (this.dictData) {
           this.UnitRelationOptions = this.dictData['UnitRelation']
-          this.getCityList(this.dictData['GaodeMapChinaAreas'])
           this.CompanyTypeOptions = this.dictData['CompanyType']
+          this.getCityList(this.dictData['GaodeMapChinaAreas'])
+          this.getCountryList(this.dictData['CountryList'])
           let suppliers = this.dictData['CompanyNames']
           for (let idx in suppliers) {
             suppliers[idx]['value'] = suppliers[idx].SupplierName
@@ -600,6 +612,17 @@
         countstr = countstr.replace(/\,\"districts\"\:\[\]/g, '')
         this.countryoptions = JSON.parse(countstr)
       },
+      getCountryList (val) {
+        let tmpJson = JSON.parse(val)
+        this.countryListOptions = []
+        for (let idx in tmpJson) {
+          this.countryListOptions.push({
+            label: tmpJson[idx].split('-')[0],
+            value: tmpJson[idx].split('-')[1],
+            code: tmpJson[idx].split('-')[2]
+          })
+        }
+      },
       unitRelationChange(value) {
         this.formData.SpecTypeCode = value.join(',')
       },

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

@@ -356,7 +356,7 @@
           QQ: '',
           CompanyUrl: '',
           SpecSupplier: '',
-          SpecTypeCode: '',
+          SpecTypeCode: '1',
           SpecTypeName: '',
           WorkerTotal: 0,
           ContractNum: 0,

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

@@ -318,7 +318,7 @@
           Grade: '',
           MgrUnit: '',
           OperType: '',
-          Country: '',
+          Country: '中国',
           MaunAgent: '',
           ConstructTeam: '',
           CommercialNo: '',
@@ -366,7 +366,7 @@
           QQ: '',
           CompanyUrl: '',
           SpecSupplier: '',
-          SpecTypeCode: '',
+          SpecTypeCode: '1',
           SpecTypeName: '',
           WorkerTotal: 0,
           ContractNum: 0,

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

@@ -356,7 +356,7 @@
           QQ: '',
           CompanyUrl: '',
           SpecSupplier: '',
-          SpecTypeCode: '',
+          SpecTypeCode: '1',
           SpecTypeName: '',
           WorkerTotal: 0,
           ContractNum: 0,