|
@@ -182,32 +182,32 @@ export default {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- watch: {
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
data () {
|
|
data () {
|
|
|
|
|
+ // 默认表单数据
|
|
|
|
|
+ const defaultForm = {
|
|
|
|
|
+ code:'',
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ ruleType: '1',
|
|
|
|
|
+ status: 1,
|
|
|
|
|
+ cycleValue: undefined,
|
|
|
|
|
+ cycleType: 1,
|
|
|
|
|
+ contentImage: {},
|
|
|
|
|
+ ruleCycleList: [], // 规则周期日期值
|
|
|
|
|
+ ruleItems: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '', // 巡点检事项
|
|
|
|
|
+ content: '', // 巡点检内容
|
|
|
|
|
+ norm: '', // 巡点检标准
|
|
|
|
|
+ // readonly: false
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ };
|
|
|
return {
|
|
return {
|
|
|
addMatterDialog: false,
|
|
addMatterDialog: false,
|
|
|
cycleValue: '',
|
|
cycleValue: '',
|
|
|
uploadList: [],
|
|
uploadList: [],
|
|
|
- formData: {
|
|
|
|
|
- name: '',
|
|
|
|
|
- ruleType: '1',
|
|
|
|
|
- status: 1,
|
|
|
|
|
- cycleValue: undefined,
|
|
|
|
|
- cycleType: 1,
|
|
|
|
|
- contentImage: {},
|
|
|
|
|
- ruleCycleList: [], // 规则周期日期值
|
|
|
|
|
- ruleItems: [
|
|
|
|
|
- {
|
|
|
|
|
- name: '', // 巡点检事项
|
|
|
|
|
- content: '', // 巡点检内容
|
|
|
|
|
- norm: '', // 巡点检标准
|
|
|
|
|
- // readonly: false
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ formData: { },
|
|
|
contentConfigFormRules: {
|
|
contentConfigFormRules: {
|
|
|
name: [{ required: true, message: '请输入规则名称', trigger: 'blur' }],
|
|
name: [{ required: true, message: '请输入规则名称', trigger: 'blur' }],
|
|
|
ruleType: [
|
|
ruleType: [
|
|
@@ -228,29 +228,27 @@ export default {
|
|
|
],
|
|
],
|
|
|
norm: [{ required: true, message: '请输入巡点检标准', trigger: 'blur' }]
|
|
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
|
|
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){
|
|
async getRuleInfo(id,type){
|
|
|
const data = await getDetail(id)
|
|
const data = await getDetail(id)
|