|
|
|
@ -28,6 +28,7 @@ |
|
|
|
<el-button type="danger" @click="handleDeletes">删 除</el-button> |
|
|
|
<el-button type="danger" @click="handleDeletes">删 除</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-button type="success" @click="handleUser">人员设置</el-button> |
|
|
|
<el-button type="success" @click="handleUser">人员设置</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="handleCycle">批量设置周期</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #menu-right> |
|
|
|
<template #menu-right> |
|
|
|
<el-button type="primary" @click="handleImport">导入</el-button> |
|
|
|
<el-button type="primary" @click="handleImport">导入</el-button> |
|
|
|
@ -74,6 +75,104 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 批量设置周期 --> |
|
|
|
|
|
|
|
<el-dialog append-to-body title="批量设置周期" v-model="cycleDialog" width="550px"> |
|
|
|
|
|
|
|
<el-form ref="cycleForm" :model="cycleForm" label-width="80px" :rules="cycleRules"> |
|
|
|
|
|
|
|
<el-form-item label="试验周期" prop="jobType"> |
|
|
|
|
|
|
|
<el-select |
|
|
|
|
|
|
|
placeholder="请选择试验周期" |
|
|
|
|
|
|
|
v-model="cycleForm.jobType" |
|
|
|
|
|
|
|
style="width: 268px" |
|
|
|
|
|
|
|
@change="changeCycle1" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-option label="每周" :value="1"></el-option> |
|
|
|
|
|
|
|
<el-option label="每月" :value="2"></el-option> |
|
|
|
|
|
|
|
<el-option label="每年" :value="3"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<div style="margin-left: 80px" v-show="cycleForm.jobType == 1"> |
|
|
|
|
|
|
|
<el-checkbox-group v-model="cycleForm.weekList"> |
|
|
|
|
|
|
|
<el-checkbox label="周一" value="1" /> |
|
|
|
|
|
|
|
<el-checkbox label="周二" value="2"></el-checkbox> |
|
|
|
|
|
|
|
<el-checkbox label="周三" value="3"></el-checkbox> |
|
|
|
|
|
|
|
<el-checkbox label="周四" value="4"></el-checkbox> |
|
|
|
|
|
|
|
<el-checkbox label="周五" value="5"></el-checkbox> |
|
|
|
|
|
|
|
<el-checkbox label="周六" value="6"></el-checkbox> |
|
|
|
|
|
|
|
<el-checkbox label="周日" value="7"></el-checkbox> |
|
|
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="margin-left: 80px" v-show="cycleForm.jobType == 2"> |
|
|
|
|
|
|
|
<div style="display: flex; align-items: center"> |
|
|
|
|
|
|
|
<span>时间:每月</span> |
|
|
|
|
|
|
|
<el-select v-model="cycleForm.monthValue" style="width: 120px; margin: 0 5px"> |
|
|
|
|
|
|
|
<el-option v-for="item in 31" :key="item" :label="item" :value="item"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
<span>日</span> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" type="primary" circle @click="addMonth" |
|
|
|
|
|
|
|
><el-icon> <Plus /> </el-icon |
|
|
|
|
|
|
|
></el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="display: flex; flex-wrap: wrap; margin-top: 10px"> |
|
|
|
|
|
|
|
<el-tag |
|
|
|
|
|
|
|
v-for="tag in cycleMonthTags" |
|
|
|
|
|
|
|
:key="tag" |
|
|
|
|
|
|
|
closable |
|
|
|
|
|
|
|
type="info" |
|
|
|
|
|
|
|
style="width: 62px; margin-right: 5px; margin-top: 10px" |
|
|
|
|
|
|
|
@close="closeMonthTag(tag, index)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ tag }} |
|
|
|
|
|
|
|
</el-tag> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-checkbox |
|
|
|
|
|
|
|
v-model="cycleForm.isPutOff" |
|
|
|
|
|
|
|
label="任务若遇周末或当月无该日期,顺延至下周一" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="margin-left: 100px" v-show="cycleForm.jobType == 3"> |
|
|
|
|
|
|
|
<div style="display: flex; align-items: center"> |
|
|
|
|
|
|
|
<span>时间</span> |
|
|
|
|
|
|
|
<el-select v-model="cycleForm.yearMonth" style="width: 120px; margin: 0 5px"> |
|
|
|
|
|
|
|
<el-option v-for="item in 12" :key="item" :label="item" :value="item"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
<span>月</span> |
|
|
|
|
|
|
|
<el-select v-model="cycleForm.yearDays" style="width: 120px; margin: 0 5px"> |
|
|
|
|
|
|
|
<el-option v-for="item in 31" :key="item" :label="item" :value="item"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
<span>日</span> |
|
|
|
|
|
|
|
<el-button style="margin-left: 10px" type="primary" circle @click="addYears" |
|
|
|
|
|
|
|
><el-icon> <Plus /> </el-icon |
|
|
|
|
|
|
|
></el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="display: flex; flex-wrap: wrap; margin-top: 10px"> |
|
|
|
|
|
|
|
<el-tag |
|
|
|
|
|
|
|
v-for="(tag, index) in cycleYearTags" |
|
|
|
|
|
|
|
:key="tag" |
|
|
|
|
|
|
|
closable |
|
|
|
|
|
|
|
type="info" |
|
|
|
|
|
|
|
style="width: 86px; margin-right: 5px; margin-top: 10px" |
|
|
|
|
|
|
|
@close="closeYearsTag(tag, index)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ tag }} |
|
|
|
|
|
|
|
</el-tag> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-checkbox |
|
|
|
|
|
|
|
v-model="cycleForm.isPutOff" |
|
|
|
|
|
|
|
label="任务若遇周末或当月无该日期,顺延至下周一" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button @click="cycleDialog = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="submitCycle">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
<!-- 导入 --> |
|
|
|
<!-- 导入 --> |
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
templateUrl="/blade-desk/QA/CycleTest/download-excel-template" |
|
|
|
templateUrl="/blade-desk/QA/CycleTest/download-excel-template" |
|
|
|
@ -84,7 +183,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { getList, remove,issueTask,getUserList,setUser } from '@/api/qualityManagement/periodicTesting/projectCycle.js'; |
|
|
|
import { getList, remove,issueTask,getUserList,setUser,setCycleBat } from '@/api/qualityManagement/periodicTesting/projectCycle.js'; |
|
|
|
import addProjectCycleDialog from './components/addProjectCycleDialog.vue' |
|
|
|
import addProjectCycleDialog from './components/addProjectCycleDialog.vue' |
|
|
|
import {dateFormat} from '@/utils/date' |
|
|
|
import {dateFormat} from '@/utils/date' |
|
|
|
import basicImport from '@/components/basic-import/main.vue' |
|
|
|
import basicImport from '@/components/basic-import/main.vue' |
|
|
|
@ -114,6 +213,11 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
issueDialog: false, |
|
|
|
issueDialog: false, |
|
|
|
|
|
|
|
cycleDialog:false, |
|
|
|
|
|
|
|
cycleForm:{}, |
|
|
|
|
|
|
|
cycleRules:{ |
|
|
|
|
|
|
|
jobType: [{ required: true, message: '请选择试验周期', trigger: 'blur' }], |
|
|
|
|
|
|
|
}, |
|
|
|
issueForm: {}, |
|
|
|
issueForm: {}, |
|
|
|
formRules: { |
|
|
|
formRules: { |
|
|
|
processUserId: [{ required: true, message: '请选择工艺员', trigger: 'blur' }], |
|
|
|
processUserId: [{ required: true, message: '请选择工艺员', trigger: 'blur' }], |
|
|
|
@ -125,6 +229,8 @@ export default { |
|
|
|
showDialog: false, |
|
|
|
showDialog: false, |
|
|
|
monthTags: [], |
|
|
|
monthTags: [], |
|
|
|
yearTags: [], |
|
|
|
yearTags: [], |
|
|
|
|
|
|
|
cycleMonthTags:[], |
|
|
|
|
|
|
|
cycleYearTags:[], |
|
|
|
option: { |
|
|
|
option: { |
|
|
|
tip: false, |
|
|
|
tip: false, |
|
|
|
height: 'auto', |
|
|
|
height: 'auto', |
|
|
|
@ -364,6 +470,14 @@ export default { |
|
|
|
this.issueForm = {} |
|
|
|
this.issueForm = {} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量设置周期 |
|
|
|
|
|
|
|
handleCycle(){ |
|
|
|
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
|
|
|
this.$message.error('请至少选择一条数据!'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.cycleDialog = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 点击删除按钮 |
|
|
|
// 点击删除按钮 |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete(row) { |
|
|
|
this.$confirm('确定删除此条数据?', { |
|
|
|
this.$confirm('确定删除此条数据?', { |
|
|
|
@ -397,26 +511,36 @@ export default { |
|
|
|
this.projectForm.yearDays = ''; |
|
|
|
this.projectForm.yearDays = ''; |
|
|
|
this.yearTags = []; |
|
|
|
this.yearTags = []; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 切换周期 |
|
|
|
|
|
|
|
changeCycle1() { |
|
|
|
|
|
|
|
this.cycleForm.monthValue = ''; |
|
|
|
|
|
|
|
this.cycleForm.weekList = []; |
|
|
|
|
|
|
|
this.cycleMonthTags = []; |
|
|
|
|
|
|
|
this.cycleForm.yearMonth = ''; |
|
|
|
|
|
|
|
this.cycleForm.yearDays = ''; |
|
|
|
|
|
|
|
this.cycleYearTags = []; |
|
|
|
|
|
|
|
}, |
|
|
|
// 添加月份日期 |
|
|
|
// 添加月份日期 |
|
|
|
addMonth() { |
|
|
|
addMonth() { |
|
|
|
let value = this.projectForm.monthValue + '日'; |
|
|
|
let value = this.cycleForm.monthValue + '日'; |
|
|
|
if (this.monthTags.find(item => item == value)) return; |
|
|
|
if (this.cycleMonthTags.find(item => item == value)) return; |
|
|
|
this.monthTags.push(this.projectForm.monthValue + '日'); |
|
|
|
this.cycleMonthTags.push(this.cycleForm.monthValue + '日'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 添加年份日期 |
|
|
|
// 添加年份日期 |
|
|
|
addYears() { |
|
|
|
addYears() { |
|
|
|
let value = this.projectForm.yearMonth + '月' + this.projectForm.yearDays + '日'; |
|
|
|
let value = this.cycleForm.yearMonth + '月' + this.cycleForm.yearDays + '日'; |
|
|
|
if (this.yearTags.find(item => item == value)) return; |
|
|
|
console.log('value--------------',value) |
|
|
|
if (this.projectForm.yearMonth == '' || this.projectForm.yearDays == '') return; |
|
|
|
if (this.cycleYearTags.find(item => item == value)) return; |
|
|
|
this.yearTags.push(this.projectForm.yearMonth + '月' + this.projectForm.yearDays + '日'); |
|
|
|
if (this.cycleForm.yearMonth == '' || this.cycleForm.yearDays == '') return; |
|
|
|
|
|
|
|
this.cycleYearTags.push(this.cycleForm.yearMonth + '月' + this.cycleForm.yearDays + '日'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除月份日期 |
|
|
|
// 删除月份日期 |
|
|
|
closeMonthTag(item, index) { |
|
|
|
closeMonthTag(item, index) { |
|
|
|
this.monthTags = this.monthTags.filter(tags => tags != item); |
|
|
|
this.cycleMonthTags = this.cycleMonthTags.filter(tags => tags != item); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除年份日期 |
|
|
|
// 删除年份日期 |
|
|
|
closeYearsTag(item, index) { |
|
|
|
closeYearsTag(item, index) { |
|
|
|
this.yearTags = this.yearTags.filter(tags => tags != item); |
|
|
|
this.cycleYearTags = this.cycleYearTags.filter(tags => tags != item); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增确定按钮 |
|
|
|
// 新增确定按钮 |
|
|
|
submitForm() { |
|
|
|
submitForm() { |
|
|
|
@ -452,6 +576,58 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量设置周期 |
|
|
|
|
|
|
|
submitCycle(){ |
|
|
|
|
|
|
|
this.$refs.cycleForm.validate(valid =>{ |
|
|
|
|
|
|
|
if(valid){ |
|
|
|
|
|
|
|
let monthArr = [] |
|
|
|
|
|
|
|
let yearArr = [] |
|
|
|
|
|
|
|
if(this.cycleForm.jobType == 2){ |
|
|
|
|
|
|
|
if(this.cycleMonthTags.length == 0){ |
|
|
|
|
|
|
|
this.$message.error('请选择日期') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
monthArr = this.cycleMonthTags.map(str => { |
|
|
|
|
|
|
|
// 提取数字部分(匹配连续的数字) |
|
|
|
|
|
|
|
const num = str.match(/\d+/)?.[0] || '0'; |
|
|
|
|
|
|
|
// 补零到两位 |
|
|
|
|
|
|
|
return num.padStart(2, '0'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.cycleForm.jobType == 1){ |
|
|
|
|
|
|
|
if(this.cycleForm.weekList.length == 0){ |
|
|
|
|
|
|
|
this.$message.error('请选择日期') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.cycleForm.jobType == 3){ |
|
|
|
|
|
|
|
if(this.cycleYearTags.length == 0){ |
|
|
|
|
|
|
|
this.$message.error('请选择日期') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
yearArr = this.cycleYearTags.map(str => { |
|
|
|
|
|
|
|
// 使用正则匹配“数字 + 月 + 数字 + 日”结构 |
|
|
|
|
|
|
|
const match = str.match(/(\d+)月(\d+)日/); |
|
|
|
|
|
|
|
if (!match) return '0000'; // 防御性处理:格式不符时返回默认值 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const month = match[1].padStart(2, '0'); |
|
|
|
|
|
|
|
const day = match[2].padStart(2, '0'); |
|
|
|
|
|
|
|
return month + day; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
ids:this.selectionList.map(item => item.id).join(','), |
|
|
|
|
|
|
|
jobType:this.cycleForm.jobType, |
|
|
|
|
|
|
|
jobTypeWeekValue:this.cycleForm.jobType == 1 ? this.cycleForm.weekList.join(',') : '', |
|
|
|
|
|
|
|
jobTypeMonthValue:this.cycleForm.jobType == 2 ? monthArr.join(',') : '', |
|
|
|
|
|
|
|
jobTypeYearValue:this.cycleForm.jobType == 3 ? yearArr.join(',') : '', |
|
|
|
|
|
|
|
isPutOff:this.cycleForm.isPutOff ? 1 : 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log('params===============',params) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 多选 |
|
|
|
// 多选 |
|
|
|
selectionChange(list) { |
|
|
|
selectionChange(list) { |
|
|
|
this.selectionList = list; |
|
|
|
this.selectionList = list; |
|
|
|
|