Przeglądaj źródła

事项规则接口对接提交

LAPTOP-16IUEB3P\Lenovo 3 lat temu
rodzic
commit
f71301de5e

Plik diff jest za duży
+ 29 - 952
package-lock.json


+ 1 - 1
package.json

@@ -62,4 +62,4 @@
     "vue-template-compiler": "^2.7.10",
     "webpack": "^5.74.0"
   }
-}
+}

+ 1 - 1
src/views/login/index.vue

@@ -123,7 +123,7 @@
         loading: false,
         // 表单数据
         form: {
-          loginName: 'ema',
+          loginName: 'aaa',
           loginPwd: '123456',
           remember: true
         },

+ 37 - 39
src/views/rulesManagement/matterRules/components/matter-add.vue

@@ -182,32 +182,32 @@ export default {
         return false
       }
     }
-  },
-  watch: {
-
   },
   data () {
+		// 默认表单数据
+		const defaultForm = {
+		  code:'',
+		  name: '',
+		  ruleType: '1',
+		  status: 1,
+		  cycleValue: undefined,
+		  cycleType: 1,
+		  contentImage: {},
+		  ruleCycleList: [], // 规则周期日期值
+		  ruleItems: [
+		    {
+		      name: '', // 巡点检事项
+		      content: '', // 巡点检内容
+		      norm: '', // 巡点检标准
+		      // readonly: false
+		    }
+		  ]
+		};
     return {
       addMatterDialog: false,
       cycleValue: '',
       uploadList: [],
-      formData: {
-        name: '',
-        ruleType: '1',
-        status: 1,
-        cycleValue: undefined,
-        cycleType: 1,
-        contentImage: {},
-        ruleCycleList: [], // 规则周期日期值
-        ruleItems: [
-          {
-            name: '', // 巡点检事项
-            content: '', // 巡点检内容
-            norm: '', // 巡点检标准
-            // readonly: false
-          }
-        ]
-      },
+      formData: { },
       contentConfigFormRules: {
         name: [{ required: true, message: '请输入规则名称', trigger: 'blur' }],
         ruleType: [
@@ -228,29 +228,27 @@ export default {
         ],
         norm: [{ required: true, message: '请输入巡点检标准', trigger: 'blur' }]
       },
-      // ruleTypeObj: {
-      //   1: 'PATROL',
-      //   2: 'MAINTAIN',
-      //   4: 'INVENTORY'
-      // },
-      // ruleTypeList: [
-      //   { code: 'PATROL', label: '巡点检规则' },
-      //   { code: 'MAINTAIN', label: '保养规则' },
-      //   { code: 'INVENTORY', label: '盘点规则' }
-      // ],
       isBindPlan:false
     }
   },
-  methods: {
-	openDialog(row,type){
-		this.addMatterDialog = true
-		if(type !='add'){
-			this.getRuleInfo(row.id,type)
-		}
-		if(type!='edit'){
-			this.getOrderCode()
-		}
+	watch: {
+	
 	},
+  methods: {
+		openDialog(row,type){
+			this.addMatterDialog = true
+			if(type !='add'){
+				this.getRuleInfo(row.id,type)
+			}else{
+				this.formData = {...this.defaultForm}
+				this.$set(this.formData,'status',1)
+				this.$set(this.formData,'ruleType','1')
+				this.$refs.contentConfigForm && this.$refs.contentConfigForm.resetFields()
+			}
+			if(type!='edit'){
+				this.getOrderCode()
+			}
+		},
 	
 	async getRuleInfo(id,type){
 		const data = await getDetail(id)

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików