Commit 4dd66e52 authored by zhengke's avatar zhengke

修改

parent 6efacec4
...@@ -54,22 +54,24 @@ ...@@ -54,22 +54,24 @@
:rules="[val => !!val || '请选择分类']" class="col-6 q-pr-lg q-pb-lg" /> :rules="[val => !!val || '请选择分类']" class="col-6 q-pr-lg q-pb-lg" />
</div> </div>
<div class="col-6"> <div class="col-6">
<q-select stack-label v-model="msg.DutyType" :options="dutyTypeList" color="primary" filled label="类型" <q-select stack-label v-model="msg.DutyType" :options="msg.DutyCategory==1?dutyTypeList:dutyTypeList2" color="primary" filled label="类型"
option-label="Name" option-value="Id" ref="DutyType" emit-value option-label="Name" option-value="Id" ref="DutyType" emit-value
map-options :rules="[val => !!val || '请选择类型']" /> map-options :rules="[val => !!val || '请选择类型']" />
</div> </div>
</div> </div>
<div class="row wrap"> <div class="row wrap" v-if="msg.DutyType==2">
<div class="col-6"> <div class="col-6 q-pr-lg">
<q-input filled stack-label max-length="20" :dense="false" v-model="msg.ItemName" ref="ItemName"
class="col-6 q-pr-lg q-pb-lg" label="事项名称" :rules="[val => !!val || '请填写事项名称']" />
</div>
<div class="col-6">
<q-select stack-label color="primary" filled clearable label="选择事项类型" option-value="Id" option-label="Name" <q-select stack-label color="primary" filled clearable label="选择事项类型" option-value="Id" option-label="Name"
:options="itemTypeOptions" v-model="msg.ItemType" ref="ItemType" emit-value map-options :options="itemTypeOptions" v-model="msg.ItemType" ref="ItemType" emit-value map-options
:rules="[val => !!val || '请选择事项类型']" /> :rules="[val => !!val || '请选择事项类型']" />
</div> </div>
</div> </div>
<div class="row wrap">
<div class="col-12">
<q-input filled type="textarea" :rows="2" stack-label :dense="false" v-model="msg.ItemName" ref="ItemName"
class="col-12 q-pb-lg" label="事项名称" :rules="[val => !!val || '请填写事项名称']" />
</div>
</div>
<div class="row wrap addDutyUpload"> <div class="row wrap addDutyUpload">
<div class="col-12"> <div class="col-12">
<div style="display:flex;flex-wrap: wrap;"> <div style="display:flex;flex-wrap: wrap;">
...@@ -131,8 +133,8 @@ ...@@ -131,8 +133,8 @@
ItemType: 0, ItemType: 0,
Shifts: "", Shifts: "",
ItemImgList: [], ItemImgList: [],
DutyCategory: 0, //值班事项分类(1-工作清单,2-突发事项,3-交接说明) DutyCategory: '', //值班事项分类(1-工作清单,2-突发事项,3-交接说明)
DutyType: 0, //值班类型(1-规则事项,2-值班事项) DutyType: '', //值班类型(1-规则事项,2-值班事项)
}, },
BasicImg: "", BasicImg: "",
dutyCategoryList: [{ dutyCategoryList: [{
...@@ -141,7 +143,7 @@ ...@@ -141,7 +143,7 @@
}, },
{ {
Id: 2, Id: 2,
Name: "工作清单" Name: "突发事件"
}, },
{ {
Id: 3, Id: 3,
...@@ -157,6 +159,10 @@ ...@@ -157,6 +159,10 @@
Name: "值班事项" Name: "值班事项"
}, },
], ],
dutyTypeList2:[{
Id: 1,
Name: "规则事项"
}],
persistent: true, persistent: true,
schoolOptions: [], schoolOptions: [],
frequencyOptions: [], frequencyOptions: [],
...@@ -225,18 +231,28 @@ ...@@ -225,18 +231,28 @@
this.msg.ItemType = ""; this.msg.ItemType = "";
this.msg.Shifts = ""; this.msg.Shifts = "";
this.msg.ItemImgList = []; this.msg.ItemImgList = [];
this.msg.DutyCategory = "";
this.msg.DutyType = "";
this.BgImg = ""; this.BgImg = "";
}, },
//保存信息 //保存信息
saveRule() { saveRule() {
this.$refs.ItemName.validate(); this.$refs.ItemName.validate();
this.$refs.ItemType.validate();
this.$refs.Shifts.validate(); this.$refs.Shifts.validate();
this.$refs.ItemSchools.validate(); this.$refs.ItemSchools.validate();
this.$refs.DutyCategory.validate();
this.$refs.DutyType.validate();
if(this.msg.DutyType==2){
this.$refs.ItemType.validate();
if(this.$refs.ItemType.hasError){
return
}
}
if (!this.$refs.ItemName.hasError && if (!this.$refs.ItemName.hasError &&
!this.$refs.ItemType.hasError &&
!this.$refs.Shifts.hasError && !this.$refs.Shifts.hasError &&
!this.$refs.ItemSchools.hasError) { !this.$refs.ItemSchools.hasError &&
!this.$refs.DutyCategory.hasError &&
!this.$refs.DutyType.hasError) {
this.msg.ItemSchools = this.schoolArr.toString(); this.msg.ItemSchools = this.schoolArr.toString();
this.msg.Shifts = this.FrequencyArr.toString(); this.msg.Shifts = this.FrequencyArr.toString();
saveDutyItem(this.msg).then(res => { saveDutyItem(this.msg).then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment