Commit 702f3b1b by 怪兽?别跑

质检问题修复

1 parent 371922f0
...@@ -6,21 +6,22 @@ ...@@ -6,21 +6,22 @@
<el-input v-model="form.name" maxlength="20" show-word-limit clearable></el-input> <el-input v-model="form.name" maxlength="20" show-word-limit clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="超时时间标准:" prop="timeOut"> <el-form-item label="超时时间标准:" prop="timeOut">
<el-input v-model="form.timeOut" style="width: 120px" placeholder="请输入"></el-input> <el-input v-model="form.timeOut" style="width: 120px;" placeholder="请输入"></el-input>
分钟 分钟
</el-form-item> </el-form-item>
<el-form-item label="质检时间范围:" required prop="qiRuleScope" style="width: 60%"> <el-form-item label="质检时间范围:" required prop="qiRuleScope" style="width: 60%;">
<div class="sub-des"> <div class="sub-des">
<span>可根据不同成员的上班时间灵活调整配置</span> <span>可根据不同成员的上班时间灵活调整配置</span>
</div> </div>
<template v-for="(item, index) in form.qiRuleScope" :key="item.id"> <template v-for="(item, index) in form.qiRuleScope" :key="item.id">
<el-card class="box-card roster-card"> <el-card class="box-card roster-card">
<div style="display: flex; justify-content: flex-end"> <div style="display: flex; justify-content: flex-end;">
<el-button <el-button
v-if="form.qiRuleScope.length !== 1" v-if="form.qiRuleScope.length !== 1"
text text
icon="el-icon-delete" icon="el-icon-delete"
@click="onRemoveRoster(index)"> @click="onRemoveRoster(index)"
>
删除 删除
</el-button> </el-button>
</div> </div>
...@@ -30,9 +31,10 @@ ...@@ -30,9 +31,10 @@
</el-tag> </el-tag>
<el-button <el-button
icon="el-icon-plus" icon="el-icon-plus"
style="margin-left: 10px" style="margin-left: 10px;"
type="primary" type="primary"
@click="onSelectSingleUser(index)"> @click="onSelectSingleUser(index)"
>
{{ item.weQiRuleUserList.length ? '修改' : '选择' }}员工 {{ item.weQiRuleUserList.length ? '修改' : '选择' }}员工
</el-button> </el-button>
</el-form-item> </el-form-item>
...@@ -49,28 +51,30 @@ ...@@ -49,28 +51,30 @@
</el-form-item> </el-form-item>
<el-form-item label-width="100px" label="在线时间:"> <el-form-item label-width="100px" label="在线时间:">
<el-time-select <el-time-select
style="width: 130px" style="width: 130px;"
v-model="item.beginTime" v-model="item.beginTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
end: '23:59', end: '23:59',
step: '00:30', step: '00:30',
maxTime: item.endTime, maxTime: item.endTime
}" }"
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
placeholder="任意时间点"></el-time-select> placeholder="任意时间点"
></el-time-select>
-- --
<el-time-select <el-time-select
style="width: 130px" style="width: 130px;"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
end: '23:59', end: '23:59',
step: '00:30', step: '00:30',
minTime: item.beginTime, minTime: item.beginTime
}" }"
@change="checkStartEnd($event, index)" @change="checkStartEnd($event, index)"
v-model="item.endTime" v-model="item.endTime"
placeholder="任意时间点"></el-time-select> placeholder="任意时间点"
></el-time-select>
</el-form-item> </el-form-item>
</el-card> </el-card>
</template> </template>
...@@ -106,19 +110,21 @@ ...@@ -106,19 +110,21 @@
v-model:visible="dialogVisible" v-model:visible="dialogVisible"
title="组织架构" title="组织架构"
:defaultValues="form.manageUserInfo" :defaultValues="form.manageUserInfo"
@success="getSelectUser"></SelectUser> @success="getSelectUser"
></SelectUser>
<SelectUser <SelectUser
key="2" key="2"
v-model:visible="singleSelectVisible" v-model:visible="singleSelectVisible"
title="组织架构" title="组织架构"
:defaultValues="singleSelect" :defaultValues="singleSelect"
@success="getSingleUser"></SelectUser> @success="getSingleUser"
></SelectUser>
</div> </div>
</template> </template>
<script> <script>
import { addQuality, editQuality, detailQuality } from './api.js' import { addQuality, editQuality, detailQuality } from './api.js'
export default { export default {
name: 'quality-add', name: 'quality-add',
data() { data() {
return { return {
...@@ -137,39 +143,39 @@ export default { ...@@ -137,39 +143,39 @@ export default {
beginTime: '', beginTime: '',
endTime: '', endTime: '',
weQiRuleUserList: [], weQiRuleUserList: [],
workCycle: [], workCycle: []
}, }
], ]
}, },
rules: { rules: {
name: [ name: [
{ {
required: true, required: true,
message: '请输入质检规则名称', message: '请输入质检规则名称',
trigger: 'blur', trigger: 'blur'
}, }
], ],
timeOut: [ timeOut: [
{ {
required: true, required: true,
message: '请输入超时时间标准', message: '请输入超时时间标准',
trigger: 'blur', trigger: 'blur'
}, },
{ {
pattern: /^[1-9][0-9]*$/, pattern: /^[1-9][0-9]*$/,
message: '超时时间标准必须为正整数', message: '超时时间标准必须为正整数',
trigger: 'blur', trigger: 'blur'
}, }
], ],
manageUserInfo: [ manageUserInfo: [
{ {
required: true, required: true,
message: '请选择质检督导', message: '请选择质检督导',
trigger: 'blur', trigger: 'blur'
}, }
], ]
}, },
timeConflict: false, timeConflict: false
} }
}, },
methods: { methods: {
...@@ -231,7 +237,7 @@ export default { ...@@ -231,7 +237,7 @@ export default {
name: this.form.name, name: this.form.name,
chatType: this.form.chatType, chatType: this.form.chatType,
timeOut: this.form.timeOut, timeOut: this.form.timeOut,
manageUser: this.form.manageUserInfo.map((dd) => dd.userId).join(','), manageUser: this.form.manageUserInfo.map((dd) => dd.userId).join(',')
} }
let arr = [] let arr = []
this.form.qiRuleScope.forEach((res) => { this.form.qiRuleScope.forEach((res) => {
...@@ -239,7 +245,7 @@ export default { ...@@ -239,7 +245,7 @@ export default {
beginTime: res.beginTime, beginTime: res.beginTime,
endTime: res.endTime, endTime: res.endTime,
workCycle: res.workCycle, workCycle: res.workCycle,
userIds: res.weQiRuleUserList.map((ff) => ff.userId), userIds: res.weQiRuleUserList.map((ff) => ff.userId)
} }
arr.push(dd) arr.push(dd)
}) })
...@@ -278,7 +284,7 @@ export default { ...@@ -278,7 +284,7 @@ export default {
index: key, index: key,
week: [], week: [],
goto1: true, goto1: true,
goto2: true, goto2: true
}) })
} }
}) })
...@@ -367,7 +373,7 @@ export default { ...@@ -367,7 +373,7 @@ export default {
}, },
onRemoveRoster(index) { onRemoveRoster(index) {
this.form.qiRuleScope.splice(index, 1) this.form.qiRuleScope.splice(index, 1)
}, }
}, },
created() { created() {
if (this.$route.query.id) { if (this.$route.query.id) {
...@@ -375,24 +381,30 @@ export default { ...@@ -375,24 +381,30 @@ export default {
this.form = res.data this.form = res.data
this.form.qiRuleScope.forEach((dd) => { this.form.qiRuleScope.forEach((dd) => {
dd.workCycle = dd.workCycle.split(',') dd.workCycle = dd.workCycle.split(',')
dd.weQiRuleUserList.forEach((ss) => {
ss.name = ss.userName
})
})
this.form.manageUserInfo.forEach((ff) => {
ff.name = ff.userName
}) })
}) })
} }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sub-des { .sub-des {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: var(--font-black-6); color: var(--font-black-6);
} }
.roster-btn-delete { .roster-btn-delete {
margin-top: -16%; margin-top: -16%;
margin-right: -8%; margin-right: -8%;
} }
.roster-card:not(:first-child) { .roster-card:not(:first-child) {
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!