{{ searchxianshitit }} @@ -72,6 +110,10 @@ + + + +
@@ -80,7 +122,8 @@ import Pagination from '@/components/pagination' import pageye from '@/components/pagination/pageye' import ButtonBar from '@/components/ButtonBar' import req from '@/api/purchase/procurement' -import { choiceSupplierInfo } from '@/api/Common/dictcommons' +import { typeValues } from '@/api/Common/dictcommons' +import { getStorage } from '@/utils/auth' import procurementAdd from './procurementAdd' import procurementInfo from './procurementInfo' @@ -95,6 +138,9 @@ export default { }, data() { return { + url: '', + dialogHeight: '80%', + centerDialogVisible: false, btndisabled: false, btnList: [ { @@ -104,13 +150,6 @@ export default { btnKey: 'toAdd', btnLabel: '新增' }, - { - type: 'primary', - size: 'small', - icon: 'edit', - btnKey: 'toEdit', - btnLabel: '编辑' - }, { type: 'danger', size: 'small', @@ -118,13 +157,6 @@ export default { btnKey: 'doDel', btnLabel: '删除' }, - { - type: 'success', - size: 'small', - icon: 'export', - btnKey: 'doExport', - btnLabel: '导出' - }, { type: 'info', size: 'small', @@ -140,19 +172,38 @@ export default { list: [], sids: [], // 用于导出的时候保存已选择的SIDs supplier_list: [], + state_list: [ + { + dictKey: '1', + dictValue: '是' + }, + { + dictKey: '0', + dictValue: '否' + } + ], FormLoading: false, listLoading: false, // 翻页 listQuery: { current: 1, - size: 10, + size: 5, total: 0, params: { - supplierSid: '', + createOrgName: '', + deptName: '', + createByName: '', + billNo: '', createStartTime: '', createEndTime: '', - createOrgSid: '', - otherQuery: '' + finishStartTime: '', + finishEndTime: '', + purchaseTypeValue: '', + purchaseReasonValue: '', + payTypeValue: '', + supplierName: '', + isInvoicing: '', + orgPath: '' } } } @@ -163,16 +214,46 @@ export default { this.getList() }, mounted() { + // 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage + window.addEventListener('message', this.handleMessage) this.$refs['btnbar'].setButtonList(this.btnList) }, methods: { init() { - choiceSupplierInfo({ createOrgSid : '' }).then((res) => { + typeValues({ type: '' }).then((res) => { if (res.success) { this.supplier_list = res.data } }) }, + async handleMessage(event) { + var code = '' + if (event.data.params !== null && event.data.params !== undefined) { + code = event.data.params.code + } + if (code === 1) { + this.centerDialogVisible = false + } else if (code === 2) { + this.dialogHeight = event.data.params.data + this.setIframeHeight(document.getElementById('iframe')) + } + }, + closeIt() { + this.url = '' + this.centerDialogVisible = false + }, + setIframeHeight(iframe) { + iframe.height = this.dialogHeight + }, + flowRecord(row) { + this.centerDialogVisible = true + var params = { + deployId: row.procDefId, + procInsId: row.procInstId, + token: getStorage() + } + this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params))) + }, // 搜索条件效果 clicksearchShow() { this.isSearchShow = !this.isSearchShow @@ -188,15 +269,9 @@ export default { case 'toAdd': this.toAdd() break - case 'toEdit': - this.toEdit() - break case 'doDel': this.doDel() break - case 'doExport': - this.doExport() - break case 'doClose': this.doClose() break @@ -221,6 +296,7 @@ export default { // 查询列表信息 getList() { this.listLoading = true + this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') req.listPage(this.listQuery).then((response) => { this.listLoading = false if (response.success) { @@ -241,14 +317,23 @@ export default { handleReset() { this.listQuery = { current: 1, - size: 10, + size: 5, total: 0, params: { - supplierSid: '', + createOrgName: '', + deptName: '', + createByName: '', + billNo: '', createStartTime: '', createEndTime: '', - createOrgSid: '', - otherQuery: '' + finishStartTime: '', + finishEndTime: '', + purchaseTypeValue: '', + purchaseReasonValue: '', + payTypeValue: '', + supplierName: '', + isInvoicing: '', + orgPath: '' } } this.init() @@ -258,12 +343,8 @@ export default { this.$refs['divAdd'].showAdd(this.listQuery.params.createOrgSid) }, toEdit(row) { - if (this.sids.length === 1) { - this.viewState = 3 - this.$refs['divAdd'].showEdit(this.sids[0]) - } else { - this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑操作' }) - } + this.viewState = 3 + this.$refs['divAdd'].showEdit(row) }, toInfo(row) { this.viewState = 4 @@ -298,31 +379,6 @@ export default { }).catch(() => { }) }, - doExport() { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.exportExcel(this.listQuery.params).then((resp) => { - loading.close() - const blob = new Blob([resp], { - type: 'application/vnd.ms-excel' - }) - const fileName = '销售单查询' + '.xls' - const elink = document.createElement('a') - elink.download = fileName - elink.style.display = 'nonde' - elink.href = URL.createObjectURL(blob) - document.body.appendChild(elink) - elink.click() - URL.revokeObjectURL(elink.href) - document.body.removeChild(elink) - }).catch(() => { - loading.close() - }) - }, // 修改、编辑、详情返回列表页面 resetState() { this.viewState = 1 diff --git a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue index df0c1656c2..ff724429d5 100644 --- a/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue +++ b/yxt-as-ui/src/views/purchase/procurement/procurementAdd.vue @@ -5,380 +5,400 @@
{{ viewTitle }}
保存 - 结算 + 提交 关闭