master
zengchenxi 3 months ago
parent b7948ea5fd
commit 53a3420d9e

@ -48,10 +48,11 @@
<JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)" <JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode" :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode"
placeholder="请选择设备编码" propsValue="device_code" popupWidth="800px" popupTitle="选择数据" placeholder="请选择设备编码" propsValue="device_code" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='device_name' field='deviceCode' popupType="dialog" relationField='device_code' field='deviceCode'
interfaceId="590497496266971845" :pageSize="20" interfaceId="590497496266971845" :pageSize="20"
:columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'> :columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -319,6 +320,14 @@ export default {
this.$emit('refreshDataList', true) this.$emit('refreshDataList', true)
}, },
changeData(model, index) { changeData(model, index) {
if (model == 'deviceCode' && this.dataForm.deviceCode != undefined) {
request({
url: '/api/example/YysDevice/queryNameByCode/' + this.dataForm.deviceCode,
method: 'get'
}).then(res => {
this.dataForm.deviceName = res.msg;
});
}
this.isEdit = false this.isEdit = false
this.childIndex = index this.childIndex = index
let modelAll = model.split("-"); let modelAll = model.split("-");

@ -1,50 +1,42 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="生产日期"> <el-form-item label="生产日期">
<JnpfDateRangePicker v-model="query.manufactureTime" <JnpfDateRangePicker v-model="query.manufactureTime" format="yyyy-MM-dd"
format="yyyy-MM-dd" startPlaceholder="开始日期" startPlaceholder="开始日期" endPlaceholder="结束日期">
endPlaceholder="结束日期" > </JnpfDateRangePicker>
</JnpfDateRangePicker> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="6">
<el-col :span="6"> <el-form-item label="产品编码">
<el-form-item label="产品编码"> <el-input v-model="query.productCode" placeholder="请输入" clearable> </el-input>
<el-input v-model="query.productCode" placeholder="请输入" clearable> </el-input> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="6">
<el-col :span="6"> <el-form-item label="产品名称">
<el-form-item label="产品名称"> <el-input v-model="query.productName" placeholder="请输入" clearable> </el-input>
<el-input v-model="query.productName" placeholder="请输入" clearable> </el-input> </el-form-item>
</el-form-item> </el-col>
</el-col> <template v-if="showAll">
<template v-if="showAll"> <el-col :span="6">
<el-col :span="6"> <el-form-item label="设备名称">
<el-form-item label="设备名称"> <el-input v-model="query.deviceName" placeholder="请输入" clearable> </el-input>
<el-input v-model="query.deviceName" placeholder="请输入" clearable> </el-input> </el-form-item>
</el-form-item> </el-col>
</el-col> </template>
</template>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button> <el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll"> <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">
展开 展开
</el-button> </el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else> <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
收起 收起
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -52,483 +44,446 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()"> <!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button> --> </el-button> -->
<el-button type="success" icon="icon-ym icon-ym-btn-download" @click="exportData()" > <el-button type="success" icon="icon-ym icon-ym-btn-download" @click="exportData()">
</el-button> </el-button>
<el-button type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()" > <el-button type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()">
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true"> <el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" /> @click="openSuperQuery()" />
</el-tooltip> </el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" /> @click="initData()" />
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod" :span-method="arraySpanMethod"border>
<el-table-column prop="manufactureTime" label="生产日期" align="center">
> </el-table-column>
<el-table-column <el-table-column prop="deviceCode" label="设备编码" align="center">
prop="manufactureTime" </el-table-column>
label="生产日期" align="left" <el-table-column prop="deviceName" label="设备名称" align="center">
> </el-table-column>
</el-table-column> <el-table-column prop="sort" label="顺序号" align="center">
<el-table-column <template slot-scope="scope" v-if="scope.row.sort">
prop="deviceCode" <JnpfNumber v-model="scope.row.sort" :thousands="false" />
label="设备编码" align="left" </template>
> </el-table-column>
</el-table-column> <el-table-column label="班次" prop="post" algin="center">
<el-table-column <template slot-scope="scope">
prop="deviceName" {{ scope.row.post }}
label="设备名称" align="left" </template>
> </el-table-column>
</el-table-column> <el-table-column prop="startTime" label="开始时间" align="center">
<el-table-column </el-table-column>
prop="sort" <el-table-column prop="endTime" label="结束时间" align="center">
label="顺序号" align="left" </el-table-column>
> <el-table-column prop="productCode" label="产品编码" align="center">
<template slot-scope="scope" v-if="scope.row.sort" > </el-table-column>
<JnpfNumber v-model="scope.row.sort" :thousands="false"/> <el-table-column prop="productName" label="产品名称" align="center">
</template> </el-table-column>
</el-table-column> <el-table-column prop="model" label="规格型号" align="center">
<el-table-column label="班次" prop="post" algin="left" </el-table-column>
> <el-table-column prop="duty" label="当班领用" align="center">
<template slot-scope="scope"> </el-table-column>
{{ scope.row.post}} <el-table-column prop="classBalance" label="本班结存" align="center">
</template> </el-table-column>
</el-table-column> <el-table-column label="操作" fixed="right" width="150">
<el-table-column <template slot-scope="scope">
prop="startTime" <el-button type="text" @click="addOrUpdateHandle(scope.row)">
label="开始时间" align="left" </el-button>
> <!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-table-column>
<el-table-column
prop="endTime"
label="结束时间" align="left"
>
</el-table-column>
<el-table-column
prop="productCode"
label="产品编码" align="left"
>
</el-table-column>
<el-table-column
prop="productName"
label="产品名称" align="left"
>
</el-table-column>
<el-table-column
prop="model"
label="规格型号" align="left"
>
</el-table-column>
<el-table-column
prop="duty"
label="当班领用" align="left"
>
</el-table-column>
<el-table-column
prop="classBalance"
label="本班结存" align="left"
>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" >编辑
</el-button>
<!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
<el-button type="text" <el-button type="text"
@click="goDetail(scope.row.id)">详情 @click="goDetail(scope.row.id)">详情
</el-button> --> </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/> <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
</div> @pagination="initData" />
</div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" /> <ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" /> <ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" <SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" /> @superQuery="superQuery" />
</div> </div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './form' import JNPFForm from './form'
import Detail from './Detail' import Detail from './Detail'
import ExportBox from '@/components/ExportBox' import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail' import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev' import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user' import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList' import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery' import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson' import superQueryJson from './superQueryJson'
export default { export default {
components: { components: {
JNPFForm, JNPFForm,
Detail, Detail,
ExportBox,ToFormDetail , SuperQuery ExportBox, ToFormDetail, SuperQuery
}, },
data() { data() {
return { return {
keyword:'', keyword: '',
expandsTree: true, expandsTree: true,
refreshTree: true, refreshTree: true,
toFormDetailVisible:false, toFormDetailVisible: false,
expandObj:{}, expandObj: {},
columnOptions: [], columnOptions: [],
mergeList: [], mergeList: [],
exportList:[], exportList: [],
columnList, columnList,
showAll: false, showAll: false,
superQueryVisible: false, superQueryVisible: false,
superQueryJson, superQueryJson,
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
manufactureTime:undefined, manufactureTime: undefined,
productCode:undefined, productCode: undefined,
productName:undefined, productName: undefined,
deviceName:undefined, deviceName: undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
label: 'fullName', label: 'fullName',
value: 'id', value: 'id',
isLeaf: 'isLeaf' isLeaf: 'isLeaf'
}, },
list: [], list: [],
listLoading: true, listLoading: true,
total: 0, total: 0,
queryData: {}, queryData: {},
listQuery: { listQuery: {
superQueryJson: '', superQueryJson: '',
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "post", sidx: "post",
}, },
formVisible: false, formVisible: false,
flowVisible: false, flowVisible: false,
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
postOptions:[{"fullName":"旺季白班","id":"1"},{"fullName":"旺季晚班","id":"2"}], postOptions: [{ "fullName": "旺季白班", "id": "1" }, { "fullName": "旺季晚班", "id": "2" }],
postProps:{"label":"fullName","value":"id" }, postProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
deviceCode:[] , deviceCode: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
}, },
toggleTreeExpand(expands) { }
this.refreshTree = false },
this.expandsTree = expands computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.refreshTree = true this.$refs.toFormDetail.init(formData, modelId, defaultValue)
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
}) })
}, })
filterNode(value, data) { },
if (!value) return true; toggleTreeExpand(expands) {
return data[this.treeProps.label].indexOf(value) !== -1; this.refreshTree = false
}, this.expandsTree = expands
loadNode(node, resolve) { this.$nextTick(() => {
const nodeData = node.data this.refreshTree = true
const config ={ this.$nextTick(() => {
treeInterfaceId:"", this.$refs.treeBox.setCurrentKey(null)
treeTemplateJson:[] })
} })
if (config.treeInterfaceId) { },
// filterNode(value, data) {
if (config.treeTemplateJson && config.treeTemplateJson.length) { if (!value) return true;
for (let i = 0; i < config.treeTemplateJson.length; i++) { return data[this.treeProps.label].indexOf(value) !== -1;
const element = config.treeTemplateJson[i]; },
element.defaultValue = nodeData[element.relationField] || '' loadNode(node, resolve) {
} const nodeData = node.data
} const config = {
// treeInterfaceId: "",
let query = { treeTemplateJson: []
paramList: config.treeTemplateJson || [], }
} if (config.treeInterfaceId) {
// //
getDataInterfaceRes(config.treeInterfaceId, query).then(res => { if (config.treeTemplateJson && config.treeTemplateJson.length) {
let data = res.data for (let i = 0; i < config.treeTemplateJson.length; i++) {
if (Array.isArray(data)) { const element = config.treeTemplateJson[i];
resolve(data); element.defaultValue = nodeData[element.relationField] || ''
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
} }
} }
this.getMergeList(list) //
this.getExportList(list) let query = {
return list paramList: config.treeTemplateJson || [],
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
} }
}, //
getMergeList(list) { getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let newList = JSON.parse(JSON.stringify(list)) let data = res.data
newList.forEach(item => { if (Array.isArray(data)) {
if (item.children && item.children.length) { resolve(data);
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length ) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else { } else {
this.mergeList.push({ resolve([]);
prop: item.prop,
rowspan: 1,
colspan: 1
})
} }
}) })
}, }
getExportList(list) { },
let exportList = [] getColumnList() {
for (let i = 0; i < list.length; i++) { //
if (list[i].jnpfKey === 'table') { this.columnOptions = this.transformColumnList(this.columnList)
for (let j = 0; j < list[i].children.length; j++) { },
exportList.push(list[i].children[j]) transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
} }
} else {
exportList.push(list[i])
} }
} }
this.exportList = exportList }
}, this.getMergeList(list)
goDetail(id){ this.getExportList(list)
this.detailVisible = true return list
this.$nextTick(() => { },
this.$refs.Detail.init(id) arraySpanMethod({ column }) {
}) for (let i = 0; i < this.mergeList.length; i++) {
}, if (column.property == this.mergeList[i].prop) {
sortChange({column, prop, order}) { return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' }
this.listQuery.sidx = !order ? '' : prop }
this.initData() },
}, getMergeList(list) {
async initSearchDataAndListData() { let newList = JSON.parse(JSON.stringify(list))
await this.initSearchData() newList.forEach(item => {
this.initData() if (item.children && item.children.length) {
}, let child = {
// prop: item.prop + '-child-first'
async initSearchData() { }
}, item.children.unshift(child)
initData() { }
this.listLoading = true; })
let _query = { newList.forEach(item => {
...this.listQuery, if (item.children && item.children.length) {
...this.query, item.children.forEach((child, index) => {
keyword: this.keyword, if (index == 0) {
dataType: 0, this.mergeList.push({
menuId:this.menuId, prop: child.prop,
moduleId:'590864498890378181', rowspan: 1,
type:1, colspan: item.children.length
}; })
request({ } else {
url: `/api/example/YysRequisitionReport/getList`, this.mergeList.push({
method: 'post', prop: child.prop,
data: _query rowspan: 0,
}).then(res => { colspan: 0
var _list =res.data.list; })
this.list = _list.map(o => ({ }
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/YysRequisitionReport/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
}) })
}).catch(() => { } else {
}); this.mergeList.push({
}, prop: item.prop,
handelUpload(){ rowspan: 1,
this.uploadBoxVisible = true colspan: 1
this.$nextTick(() => {
this.$refs.UploadBox.init("","example/YysRequisitionReport")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
}) })
}, }
superQuery(queryJson) { })
this.listQuery.superQueryJson = queryJson },
this.listQuery.currentPage = 1 getExportList(list) {
this.initData() let exportList = []
}, for (let i = 0; i < list.length; i++) {
addOrUpdateHandle(row, isDetail) { if (list[i].jnpfKey === 'table') {
let id = row?row.id:"" for (let j = 0; j < list[i].children.length; j++) {
this.formVisible = true exportList.push(list[i].children[j])
this.$nextTick(() => { }
this.$refs.JNPFForm.init(id, isDetail,this.list) } else {
}) exportList.push(list[i])
}, }
exportData() { }
this.exportBoxVisible = true this.exportList = exportList
this.$nextTick(() => { },
this.$refs.ExportBox.init(this.exportList) goDetail(id) {
}) this.detailVisible = true
}, this.$nextTick(() => {
download(data) { this.$refs.Detail.init(id)
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId} })
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '590864498890378181',
type: 1,
};
request({
url: `/api/example/YysRequisitionReport/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({ request({
url: `/api/example/YysRequisitionReport/Actions/Export`, url: `/api/example/YysRequisitionReport/${id}`,
method: 'post', method: 'DELETE'
data: query
}).then(res => { }).then(res => {
if (!res.data.url) return this.$message({
this.jnpf.downloadFile(res.data.url) type: 'success',
this.$refs.ExportBox.visible = false message: res.msg,
this.exportBoxVisible = false onClose: () => {
this.initData()
}
});
}) })
}, }).catch(() => {
search() { });
this.listQuery.currentPage=1 },
this.listQuery.pageSize=20 handelUpload() {
this.listQuery.sort="desc" this.uploadBoxVisible = true
this.listQuery.sidx="post" this.$nextTick(() => {
this.initData() this.$refs.UploadBox.init("", "example/YysRequisitionReport")
}, })
refresh(isrRefresh) { },
this.formVisible = false openSuperQuery() {
if (isrRefresh) this.reset() this.superQueryVisible = true
}, this.$nextTick(() => {
reset() { this.$refs.SuperQuery.init()
this.query = JSON.parse(JSON.stringify(this.queryData)) })
this.search() },
}, superQuery(queryJson) {
colseFlow(isrRefresh) { this.listQuery.superQueryJson = queryJson
this.flowVisible = false this.listQuery.currentPage = 1
if (isrRefresh) this.reset() this.initData()
}, },
} addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/example/YysRequisitionReport/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = "post"
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
} }
}
</script> </script>

Loading…
Cancel
Save