ProjectChargeHeaderList.vue
9.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<template>
<a-card class="j-inner-table-wrapper" :bordered="false">
<!-- 查询区域 begin -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="项目名称">
<j-input :trim="true" v-model="queryParam.projectName" placeholder="请输入项目名称"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="项目编号">
<j-input v-model="queryParam.projectNo" placeholder="请输入项目编号"/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="合同编号">
<j-input v-model="queryParam.contractNo" placeholder="请输入合同编号"/>
</a-form-item>
</a-col>
</template>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons table-operator">
<a-button type="primary" icon="search" @click="searchQuery">查询</a-button>
<a-button type="primary" icon="reload" @click="searchReset">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
<span>{{ toggleSearchStatus ? '收起' : '展开' }}</span>
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域 end -->
<!-- 操作按钮区域 begin -->
<div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('项目管控头表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-button type="primary" icon="delete" @click="batchDel">删除</a-button>
</a-dropdown>
<a-button type="primary" icon="download" @click="refresh()">同步C表</a-button>
<a-button type="primary" icon="file-done" @click="openAllTab()">项目计划预览汇总</a-button>
</div>
<!-- 操作按钮区域 end -->
<!-- table区域 begin -->
<div>
<a-alert type="info" showIcon style="margin-bottom: 16px;">
<template slot="message">
<span>已选择</span>
<a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
<span>项</span>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</template>
</a-alert>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:loading="loading"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:expandedRowKeys="expandedRowKeys"
:rowSelection="{selectedRowKeys, onChange: onSelectChange}"
@expand="handleExpand"
@change="handleTableChange"
>
<!-- 内嵌table区域 begin -->
<template slot="expandedRowRender" slot-scope="record">
<a-tabs tabPosition="top">
<a-tab-pane tab="项目管控表" key="projectCharge" forceRender>
<project-charge-sub-table :record="record"/>
</a-tab-pane>
</a-tabs>
</template>
<!-- 内嵌table区域 end -->
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<div style="font-size: 12px;font-style: italic;">
<span v-if="!text">无图片</span>
<img v-else :src="getImgView(text)" alt="" style="max-width:80px;height:25px;"/>
</div>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
ghost
type="primary"
icon="download"
size="small"
@click="downloadFile(text)"
>
<span>下载</span>
</a-button>
</template>
<template slot="action" slot-scope="text, record">
<a @click="handleEdit(record)" v-has="'charge:update'">编辑</a>
</template>
</a-table>
</div>
<!-- table区域 end -->
<!-- 表单区域 -->
<project-charge-header-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ProjectChargeHeaderModal from './modules/ProjectChargeHeaderModal'
import ProjectChargeSubTable from './subTables/ProjectChargeSubTable'
import '@/assets/less/TableExpand.less'
import JInput from "../../components/jeecg/JInput";
import {refresh} from "../../api/api";
export default {
name: 'ProjectChargeHeaderList',
mixins: [JeecgListMixin],
components: {
ProjectChargeHeaderModal,
ProjectChargeSubTable,
JInput
},
data() {
return {
description: '项目管控头表列表管理页面',
// 表头
columns: [
{
title: '#',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: (t, r, index) => parseInt(index) + 1
},
{
title: '项目名称',
align: 'center',
dataIndex: 'projectName',
},
{
title: '销售',
align: 'center',
dataIndex: 'sales',
},
{
title: '下单日期',
align: 'center',
dataIndex: 'placeDate',
},
{
title: '交期要求',
align: 'center',
dataIndex: 'deliveryDate',
},
{
title: '项目编号',
align: 'center',
dataIndex: 'projectNo',
},
{
title: '代理商',
align: 'center',
dataIndex: 'agent',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
},
{
title: '项目问题',
align: 'center',
dataIndex: 'projectProblem',
},
{
title: '措施',
align: 'center',
dataIndex: 'measure',
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
width: 147,
scopedSlots: {customRender: 'action'},
},
],
// 字典选项
dictOptions: {},
// 展开的行test
expandedRowKeys: [],
url: {
list: '/project_charge_header/projectChargeHeader/list',
delete: '/project_charge_header/projectChargeHeader/delete',
deleteBatch: '/project_charge_header/projectChargeHeader/deleteBatch',
exportXlsUrl: '/project_charge_header/projectChargeHeader/exportXls',
importExcelUrl: '/project_charge_header/projectChargeHeader/importExcel',
},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl() {
return window._CONFIG['domianURL'] + this.url.importExcelUrl
}
},
methods: {
initDictConfig() {
},
openAllTab() {
var url = 'http://mts.huahengweld.com/jeecg-boot/jmreport/view/772606837067870208?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzMzMzYwOTEsInVzZXJuYW1lIjoiY2hlbmFvIn0.40YLczZIMfDT-F8cRrdvY9SvW5Z5K4s4hfPOvol8EQw';
window.open(url, '_blank');
},
refresh() {
let params = {
'id': ''
}
this.$message.info("开始同步C表信息!!");
refresh(params).then((res) => {
if (res.success) {
this.$message.success(res.message);
//this.query();
} else {
this.$message.error("C表信息同步失败!!");
}
})
},
handleExpand(expanded, record) {
this.expandedRowKeys = []
if (expanded === true) {
this.expandedRowKeys.push(record.id)
}
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'projectName', text: '项目名称', dictCode: ''})
fieldList.push({type: 'string', value: 'sales', text: '销售', dictCode: ''})
fieldList.push({type: 'string', value: 'placeDate', text: '下单日期', dictCode: ''})
fieldList.push({type: 'string', value: 'deliveryDate', text: '交期要求', dictCode: ''})
fieldList.push({type: 'string', value: 'projectProblem', text: '项目问题', dictCode: ''})
fieldList.push({type: 'string', value: 'measure', text: '措施', dictCode: ''})
fieldList.push({type: 'string', value: 'projectNo', text: '项目编号', dictCode: ''})
fieldList.push({type: 'string', value: 'agent', text: '代理商', dictCode: ''})
fieldList.push({type: 'string', value: 'contractNo', text: '合同编号', dictCode: ''})
this.superFieldList = fieldList
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>