| | |
| | | }); |
| | | }; |
| | | |
| | | const changeComplaints = (txt: String) => { |
| | | const changeComplaints = (index:any,txt: String) => { |
| | | if (txt == 'add') { |
| | | state.ruleForm.complaints.push({ |
| | | itemDescription: '', |
| | | }); |
| | | state.ruleForm.complaints.splice(index+1, 0, { itemDescription: '' }) |
| | | } else { |
| | | state.ruleForm.complaints.pop(); |
| | | console.log(state.ruleForm.complaints); |
| | | state.ruleForm.complaints.splice(index, 1) |
| | | } |
| | | }; |
| | | |
| | |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <template v-for="(item,index) in state.ruleForm.complaints" :key="index"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="16" :xl="12" class="mb20"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="24" :xl="12" class="mb20"> |
| | | <el-form-item :label="`投诉事项${index==0?'':index}`" prop="complaints"> |
| | | <el-input v-model="item.itemDescription" type="textarea" :placeholder="`请输入投诉事项${index==0?'':index}`" |
| | | maxlength="1000" show-word-limit clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class=""> |
| | | <el-form-item :label="`处理描述${index==0?'':index}`" prop="complaints"> |
| | | <el-input v-model="item.handlingResult" type="textarea" :placeholder="`请输入处理描述${index==0?'':index}`" |
| | | maxlength="1000" show-word-limit clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="1" :xl="12" class="mb20"> |
| | | <el-button type="primary" @click="changeComplaints(index,'add')">+</el-button> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="1" :xl="12" class="mb20" |
| | | v-if="state.ruleForm.complaints&&state.ruleForm.complaints.length>1"> |
| | | <el-button type="primary" @click="changeComplaints(index)">-</el-button> |
| | | </el-col> |
| | | <el-divider v-if="state.ruleForm.complaints&&state.ruleForm.complaints.length>1" /> |
| | | </template> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="1" :xl="12" class="mb20"> |
| | | <el-button type="primary" @click="changeComplaints('add')">+</el-button> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="1" :xl="12" class="mb20" |
| | | v-if="state.ruleForm.complaints&&state.ruleForm.complaints.length>1"> |
| | | <el-button type="primary" @click="changeComplaints">-</el-button> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |