|
|
@@ -1,14 +1,28 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-row type="flex">
|
|
|
- <el-col :span="4">
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="查询日期">
|
|
|
+ <el-date-picker
|
|
|
+ :disabled="isdisabled"
|
|
|
+ v-model="formSearch.chaxunrqi"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="searchClick"
|
|
|
+ :clearable="false"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
<el-form-item label="专业组">
|
|
|
<el-select
|
|
|
v-model="formSearch.group"
|
|
|
placeholder="请选择"
|
|
|
value-key="GROUPCODE"
|
|
|
:disabled="isdisabled"
|
|
|
- clearable
|
|
|
+ @change="searchClick"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in configList"
|
|
|
@@ -45,20 +59,8 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item label="查询日期">
|
|
|
- <el-date-picker
|
|
|
- :disabled="isdisabled"
|
|
|
- v-model="formSearch.chaxunrqi"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- format="yyyy-MM-dd"
|
|
|
- placeholder="请选择"
|
|
|
- :clearable="true"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="3"> </el-col>
|
|
|
+
|
|
|
+ <el-col :span="1"> </el-col>
|
|
|
<el-col :span="1">
|
|
|
<el-button type="primary" size="mini" plain @click="searchClick">
|
|
|
查询
|
|
|
@@ -69,6 +71,7 @@
|
|
|
<el-row type="flex">
|
|
|
<el-col>
|
|
|
<el-table
|
|
|
+ v-loading="loading"
|
|
|
row-key="INSPECTION_ID"
|
|
|
ref="listable"
|
|
|
:data="lisDataFilter"
|
|
|
@@ -188,7 +191,9 @@ export default {
|
|
|
formSearchOld: {
|
|
|
group: {},
|
|
|
chaxunrqi: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ allList: [],
|
|
|
+ loading: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -197,7 +202,6 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
lisDataFilter() {
|
|
|
- console.log(this.lisData)
|
|
|
return this.lisData.slice(
|
|
|
(this.requestPage.pageNo - 1) * this.requestPage.limit,
|
|
|
(this.requestPage.pageNo - 1) * this.requestPage.limit +
|
|
|
@@ -233,6 +237,42 @@ export default {
|
|
|
this.getConfigList()
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'formSearch.tiaomahao': {
|
|
|
+ handler(value, old) {
|
|
|
+ if (value && !this.formSearch.group.GROUPCODE) {
|
|
|
+ this.formSearch.tiaomahao = ''
|
|
|
+ this.$message({
|
|
|
+ message: '请先选择专业组',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ 'formSearch.xingming': {
|
|
|
+ handler(value, old) {
|
|
|
+ if (value && !this.formSearch.group.GROUPCODE) {
|
|
|
+ this.formSearch.xingming = ''
|
|
|
+ this.$message({
|
|
|
+ message: '请先选择专业组',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ 'formSearch.yizhu': {
|
|
|
+ handler(value, old) {
|
|
|
+ if (value && !this.formSearch.group.GROUPCODE) {
|
|
|
+ this.formSearch.yizhu = ''
|
|
|
+ this.$message({
|
|
|
+ message: '请先选择专业组',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
mounted() {},
|
|
|
@@ -247,18 +287,19 @@ export default {
|
|
|
return (item.GROUPCODE = this.sumData[0].zhuanYeZuCode)
|
|
|
})
|
|
|
this.formSearch.chaxunrqi = this.sumData[0].baoCunShiJian
|
|
|
+
|
|
|
this.searchClick()
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- reject(error)
|
|
|
+ // reject(error)
|
|
|
})
|
|
|
},
|
|
|
//获取lis信息
|
|
|
async searchClick() {
|
|
|
if (!this.formSearch.group?.GROUPCODE) {
|
|
|
this.$message({
|
|
|
- message: '请选择专业组',
|
|
|
+ message: '请先选择专业组',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return
|
|
|
@@ -272,7 +313,7 @@ export default {
|
|
|
}
|
|
|
this.requestPage.limit = 10
|
|
|
this.requestPage.pageNo = 1
|
|
|
-
|
|
|
+ this.loading = true
|
|
|
await getSampleList([
|
|
|
{
|
|
|
STATE: this.isdisabled ? '1,2' : '1', //编辑 1,2 添加 1
|
|
|
@@ -285,19 +326,26 @@ export default {
|
|
|
}
|
|
|
])
|
|
|
.then((res) => {
|
|
|
+ this.loading = false
|
|
|
this.lisData = res.data
|
|
|
if (
|
|
|
this.formSearchOld.group != this.formSearch.group ||
|
|
|
this.formSearchOld.chaxunrqi != this.formSearch.chaxunrqi
|
|
|
) {
|
|
|
+ this.lisData = res.data || []
|
|
|
+ this.allList = this.lisData.map((item, index) => {
|
|
|
+ return item.INSPECTION_ID
|
|
|
+ })
|
|
|
this.$refs.listable.clearSelection()
|
|
|
this.multipleSelection = []
|
|
|
+ this.sumData[0].tiaoMaHao = ''
|
|
|
}
|
|
|
this.formSearchOld.group = this.formSearch.group
|
|
|
this.formSearchOld.chaxunrqi = this.formSearch.chaxunrqi
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- reject(error)
|
|
|
+ this.loading = false
|
|
|
+ // reject(error)
|
|
|
})
|
|
|
|
|
|
this.sumData[0].heJi = this.multipleSelection.length
|
|
|
@@ -309,27 +357,32 @@ export default {
|
|
|
this.formSearch.chaxunrqi,
|
|
|
Number(this.formSearch.group.SAVEDAY || 0)
|
|
|
)
|
|
|
- this.sumData[0].tiaoMaHao = this.multipleSelection
|
|
|
- .map((obj, index) => {
|
|
|
- return obj.INSPECTION_ID
|
|
|
- })
|
|
|
- .join(',')
|
|
|
+ // this.sumData[0].tiaoMaHao = this.multipleSelection
|
|
|
+ // .map((obj, index) => {
|
|
|
+ // return obj.INSPECTION_ID
|
|
|
+ // })
|
|
|
+ // .join(',')
|
|
|
},
|
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val
|
|
|
// console.log(this.multipleSelection)
|
|
|
this.sumData[0].heJi = this.multipleSelection.length
|
|
|
- this.sumData[0].tiaoMaHao = this.multipleSelection
|
|
|
- .map((obj, index) => {
|
|
|
+ // this.sumData[0].tiaoMaHao = this.multipleSelection
|
|
|
+ // .map((obj, index) => {
|
|
|
+ // return obj.INSPECTION_ID
|
|
|
+ // })
|
|
|
+ // .join(',')
|
|
|
+
|
|
|
+ this.sumData[0].tiaoMaHao = this.arrayDifferenceWithSet(
|
|
|
+ this.allList,
|
|
|
+ this.multipleSelection.map((obj, index) => {
|
|
|
return obj.INSPECTION_ID
|
|
|
})
|
|
|
- .join(',')
|
|
|
+ ).join(',')
|
|
|
},
|
|
|
//全选事件
|
|
|
handleSelectAll(selection) {
|
|
|
- console.log(this.multipleSelection.length)
|
|
|
-
|
|
|
if (this.multipleSelection.length > 0) {
|
|
|
this.lisData.forEach((row) => {
|
|
|
const select = this.$refs.listable.selection.find((select) => {
|
|
|
@@ -368,6 +421,11 @@ export default {
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
|
const day = String(date.getDate()).padStart(2, '0')
|
|
|
return `${year}-${month}-${day}`
|
|
|
+ },
|
|
|
+
|
|
|
+ arrayDifferenceWithSet(mainArray, excludeArray) {
|
|
|
+ const excludeSet = new Set(excludeArray) // 将排除数组转为Set对象(查找更快)
|
|
|
+ return mainArray.filter((item) => !excludeSet.has(item)) // 使用Set的has方法判断是否存在
|
|
|
}
|
|
|
}
|
|
|
}
|