Jelajahi Sumber

配件资料修改

pengyh 1 tahun lalu
induk
melakukan
1a1ef29b0c

+ 9 - 0
src/api/auxiliaryFittings/attachmentProfile.js

@@ -52,4 +52,13 @@ export function updateStatus(data) {
     method: 'post',
     data
   })
+}
+
+// 字典数据
+export function getTypeList(data) {
+  return request({
+    url: `/dictCompany/page`,
+    method: 'post',
+    data
+  })
 }

+ 25 - 48
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -23,7 +23,7 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, updateStatus, listImport } from "@/api/auxiliaryFittings/attachmentProfile";
+import { listPageV2,pageExport, getDetail, add, edit, updateStatus, listImport, getTypeList } from "@/api/auxiliaryFittings/attachmentProfile";
 export default {
   components: { TemplatePage, ImageUpload },
   mixins: [import_mixin],
@@ -95,7 +95,10 @@ export default {
 		brandList: [],
 		categoryList: [],
 		partsUnitName: ''
-      }
+      },
+	  partsUnitList: [],
+	  brandList: [],
+	  categoryList: []
     }
   },
   computed: {
@@ -147,25 +150,9 @@ export default {
         md: 12,
         isShow: true,
         name: 'el-select-add',
-		options: [{
-			label: `通用`,
-			value: "通用"
-		},
-		{
-			label: `格力`,
-			value: "格力"
-		},{
-			label: `美的`,
-			value: "美的"
-		},
-		{
-			label: `海尔`,
-			value: "海尔"
-		},
-		{
-			label: `华凌`,
-			value: "华凌"
-		}],
+		// labelKey: 'dictTypeName',
+		// valueKey: 'dictTypeName',
+		options: this.partsUnitList,
         attributes: { placeholder: '请选择单位',filterable: true },
         formItemAttributes: {
           label: '单位',
@@ -210,26 +197,10 @@ export default {
         md: 24,
         isShow: true,
         name: 'el-checkbox-add',
+		// labelKey: 'dictTypeName',
+		// valueKey: 'dictTypeName',
         attributes: {},
-		options: [{
-			label: `通用`,
-			value: "通用"
-		},
-		{
-			label: `格力`,
-			value: "格力"
-		},{
-			label: `美的`,
-			value: "美的"
-		},
-		{
-			label: `海尔`,
-			value: "海尔"
-		},
-		{
-			label: `华凌`,
-			value: "华凌"
-		}],
+		options: this.brandList,
         formItemAttributes: {
           label: '适用品牌',
           prop: 'brandList',
@@ -239,15 +210,10 @@ export default {
         md: 24,
         isShow: true,
         name: 'el-checkbox-add',
+		// labelKey: 'dictTypeName',
+		// valueKey: 'dictTypeName',
         attributes: {},
-		options: [{
-			label: `通用`,
-			value: "通用"
-		},
-		{
-			label: `家用空调`,
-			value: "家用空调"
-		}],
+		options: this.categoryList,
         formItemAttributes: {
           label: '适用产品大类',
           prop: 'categoryList',
@@ -326,6 +292,11 @@ export default {
       }]
     }
   },
+  created() {
+  	this.getTypeList('PARTS_UNIT','partsUnitList')
+	this.getTypeList('PARTS_UNIT','brandList')
+	this.getTypeList('PARTS_UNIT','categoryList')
+  },
   methods: {
     // 列表请求函数
 	getList(p) {
@@ -339,6 +310,11 @@ export default {
 	    console.log(error)
 	  }
 	},
+	getTypeList(value,type){
+		getTypeList({"pageNum":1,"pageSize":-1,"params":[{"param":"a.dict_type","compare":"=","value":`${value}`},{"param":"a.status","compare":"=","value": "ON"}]}).then(res => {
+		   this[type] = res.data.records
+		})
+	},
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
@@ -378,6 +354,7 @@ export default {
     addData() {
       this.formDialogType = 0
       this.openForm()
+	  console.log(this.partsUnitList,this.brandList,this.categoryList)
     },
     openForm() {
       this.formDialog = true;