This commit is contained in:
zds
2022-12-06 20:32:46 +08:00
parent 531c2ba8cd
commit 5199a6ecc2
5 changed files with 229 additions and 97 deletions

View File

@@ -12,7 +12,16 @@
label-suffix=":"
>
<el-form-item label="统计日期">
<date-range-picker v-model="query.createTime" class="date-item" />
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@input="onInput()"
@change="mytoQuery"
/>
</el-form-item>
<el-form-item label="所属组织">
<el-select
@@ -20,8 +29,10 @@
clearable
size="mini"
placeholder="所属组织"
multiple
style="width: 400px"
class="filter-item"
@change="crud.toQuery"
@change="handTaskStatus"
>
<el-option
v-for="item in Depts"
@@ -99,17 +110,15 @@ import crudOperation from '@crud/CRUD.operation'
import StructIvt4 from '@/views/wms/statistics/materPlan/StructIvt4'
import StructIvt3 from '@/views/wms/statistics/materPlan/StructIvt3'
import StructIvt2 from '@/views/wms/statistics/materPlan/StructIvt2'
import DateRangePicker from '@/components/DateRangePicker'
import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import Date from '@/utils/datetime'
import workorder from '@/api/wms/pdm/workorder'
const start = new Date()
export default {
name: 'MaterPlanQuery',
components: { crudOperation, rrOperation, DateRangePicker, StructIvt4, StructIvt2, StructIvt3 },
components: { crudOperation, rrOperation, StructIvt4, StructIvt2, StructIvt3 },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
@@ -118,7 +127,7 @@ export default {
idField: '1',
sort: '1,desc',
query: {
createTime: [new Date(), start.daysLater(30)]
task_status: ''
},
optShow: {
add: false,
@@ -139,6 +148,7 @@ export default {
structshow2: false,
structshow3: false,
Depts: [],
query_flag: true,
statusList: [],
permission: {},
rules: {}
@@ -150,6 +160,7 @@ export default {
workorder.getDepts().then(res => {
this.Depts = res
})
this.crud.query.createTime = [new Date(), new Date().daysLater(30)]
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
@@ -160,9 +171,10 @@ export default {
report.getHeader2().then(res => {
this.cols2 = res
})
if (this.crud.query.createTime) {
this.crud.query.begin_time = this.crud.query.createTime[0]
this.crud.query.end_time = this.crud.query.createTime[1]
if (this.query_flag) {
this.crud.query.begin_time = (new Date()).strftime('%F', 'zh')
this.crud.query.end_time = (new Date().daysLater(30)).strftime('%F', 'zh')
this.query_flag = false
}
const data = this.crud.query
report.materPlanDtlQuery(data).then(res => {
@@ -173,6 +185,21 @@ export default {
})
return true
},
handTaskStatus(value) {
var str1 = ''
if (value) {
for (const item of value) {
if (str1 === '') {
str1 = item
} else {
str1 = str1 + ',' + item
}
}
this.query.task_status = str1
} else {
this.query.task_status = ''
}
},
open2(index, row) {
if (row.first === '库存现存量') {
this.structshow = true
@@ -198,6 +225,19 @@ export default {
hand(value) {
this.crud.toQuery()
},
onInput() {
this.$forceUpdate()
},
mytoQuery(array1) {
if (array1 === null) {
this.crud.query.begin_time = ''
this.crud.query.end_time = ''
} else {
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
}
this.crud.toQuery()
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true