TaskList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="客户编号">
  9. <j-input placeholder="请输入客户编号" v-model="queryParam.customerNo"></j-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="资料状态">
  14. <j-dict-select-tag placeholder="请选择资料状态" v-model="queryParam.checkState"
  15. dictCode="sms_check_check_state"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  20. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  21. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  22. <a-button style="margin-left: 8px" type="primary" icon="download" @click="handleExportXls('资料文件')">导出</a-button>
  23. <a-dropdown v-if="selectedRowKeys.length > 0">
  24. <a-menu slot="overlay">
  25. <a-menu-item key="1" @click="batchDel">
  26. <a-icon type="delete"/>
  27. 删除
  28. </a-menu-item>
  29. </a-menu>
  30. <a-button style="margin-left: 8px"> 批量操作
  31. <a-icon type="down"/>
  32. </a-button>
  33. </a-dropdown>
  34. </span>
  35. </a-col>
  36. </a-row>
  37. </a-form>
  38. </div>
  39. <!-- 查询区域-END -->
  40. <!-- 操作按钮区域 -->
  41. <div class="table-operator">
  42. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
  43. </div>
  44. <!-- table区域-begin -->
  45. <div>
  46. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  47. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  48. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. :scroll="{x:true}"
  55. bordered
  56. rowKey="id"
  57. :columns="columns"
  58. :dataSource="dataSource"
  59. :pagination="ipagination"
  60. :loading="loading"
  61. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  62. class="j-table-force-nowrap"
  63. @change="handleTableChange">
  64. <template slot="htmlSlot" slot-scope="text">
  65. <div v-html="text"></div>
  66. </template>
  67. <template slot="imgSlot" slot-scope="text,record">
  68. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  69. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
  70. style="max-width:80px;font-size: 12px;font-style: italic;"/>
  71. </template>
  72. <template slot="fileSlot" slot-scope="text">
  73. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  74. <a-button
  75. v-else
  76. :ghost="true"
  77. type="primary"
  78. icon="download"
  79. size="small"
  80. @click="downloadFile(text)">
  81. 下载
  82. </a-button>
  83. </template>
  84. <span slot="action" slot-scope="text, record">
  85. <a v-if="loadSubData(record)" @click="handSubmit(record)">提交稽核</a>
  86. <a-divider type="vertical"/>
  87. <a @click="handUpload(record)">资料上传</a>
  88. <a-divider type="vertical"/>
  89. <a @click="handleEdit(record)">信息编辑</a>
  90. <a-divider type="vertical"/>
  91. <a-dropdown>
  92. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  93. <a-menu slot="overlay">
  94. <a-menu-item>
  95. <a @click="handleDetail(record)">详情</a>
  96. </a-menu-item>
  97. <a-menu-item>
  98. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  99. <a>删除</a>
  100. </a-popconfirm>
  101. </a-menu-item>
  102. </a-menu>
  103. </a-dropdown>
  104. </span>
  105. <template v-slot:checkState="status">
  106. <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
  107. </template>
  108. </a-table>
  109. </div>
  110. <!-- 任务添加 -->
  111. <task-add ref="modalForm" @ok="modalFormOk"></task-add>
  112. </a-card>
  113. </template>
  114. <script>
  115. import '@/assets/less/TableExpand.less'
  116. import {mixinDevice} from '@/utils/mixin'
  117. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  118. import SmsCheckTaskModal from './SmsCheckTaskModal'
  119. import TaskAdd from './TaskAdd'
  120. import {httpAction} from "@api/manage";
  121. export default {
  122. name: 'TaskList',
  123. mixins: [JeecgListMixin, mixinDevice],
  124. components: {
  125. SmsCheckTaskModal,
  126. TaskAdd
  127. },
  128. data() {
  129. return {
  130. description: '稽核任务管理页面',
  131. // 表头
  132. columns: [
  133. {
  134. title: '#',
  135. dataIndex: '',
  136. key: 'rowIndex',
  137. width: 60,
  138. align: "center",
  139. customRender: function (t, r, index) {
  140. return parseInt(index) + 1;
  141. }
  142. },
  143. {
  144. title: '客户编号',
  145. align: "center",
  146. dataIndex: 'customerNo'
  147. },
  148. {
  149. title: '用户编号',
  150. align: "center",
  151. dataIndex: 'userNo'
  152. },
  153. {
  154. title: '客户名称',
  155. align: "center",
  156. dataIndex: 'customerName'
  157. },
  158. {
  159. title: '用户发展员工',
  160. align: "center",
  161. dataIndex: 'staffName'
  162. },
  163. {
  164. title: '入网时间',
  165. align: "center",
  166. dataIndex: 'networkAccessTime'
  167. },
  168. {
  169. title: '服务号码',
  170. align: "center",
  171. dataIndex: 'smsNumber'
  172. },
  173. {
  174. title: '资料状态',
  175. align: "center",
  176. sorter: true,
  177. dataIndex: 'checkState',
  178. scopedSlots: {customRender: 'checkState'}
  179. /* customRender: function (t, r, index) {
  180. let checkState = "无状态";
  181. switch (t) {
  182. case 0:
  183. checkState = "未处理";
  184. break;
  185. case 1:
  186. checkState = "未完善";
  187. break;
  188. case 2:
  189. checkState = "待稽核";
  190. break;
  191. case 3:
  192. checkState = "已整改";
  193. break;
  194. case 4:
  195. checkState = "待整改";
  196. break;
  197. case 5:
  198. checkState = "稽核通过";
  199. break;
  200. }
  201. return checkState;
  202. //return <span><Badge status=success ></span>;
  203. }*/
  204. },
  205. {
  206. title: '操作',
  207. dataIndex: 'action',
  208. align: "center",
  209. fixed: "right",
  210. width: 147,
  211. scopedSlots: {customRender: 'action'}
  212. }
  213. ],
  214. url: {
  215. editCheck: "/smsCheck/customerInfo/edit/check/state",
  216. list: "/smsCheck/customerInfo/staff/list",
  217. delete: "/smsCheck/customerInfo/delete",
  218. deleteBatch: "/smsCheck/customerInfo/deleteBatch",
  219. exportXlsUrl: "/smsCheck/customerInfo/exportXls",
  220. importExcelUrl: "/smsCheck/customerInfo/importExcel",
  221. },
  222. dictOptions: {},
  223. superFieldList: [],
  224. }
  225. },
  226. created() {
  227. this.getSuperFieldList();
  228. },
  229. filters: {
  230. statusTypeFilter(type) {
  231. const statusTypeMap = {
  232. '0': 'error',
  233. '1': 'error',
  234. '2': 'warning',
  235. '3': 'warning',
  236. '4': 'processing',
  237. '5': 'success'
  238. }
  239. return statusTypeMap[type]
  240. },
  241. statusFilter(status) {
  242. const statusMap = {
  243. '0': '未完善',
  244. '1': '未完善',
  245. '2': '待稽核',
  246. '3': '待稽核',
  247. '4': '待整改',
  248. '5': '通过'
  249. }
  250. return statusMap[status]
  251. }
  252. },
  253. computed: {
  254. importExcelUrl: function () {
  255. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  256. }
  257. ,
  258. }
  259. ,
  260. methods: {
  261. loadSubData(record) {
  262. let checkState = record.checkState;
  263. let state = true;
  264. switch (checkState) {
  265. case 0:
  266. state = true;
  267. break;
  268. case 1:
  269. state = true;
  270. break;
  271. case 2:
  272. state = true;
  273. break;
  274. case 3:
  275. state = false;
  276. break;
  277. case 4:
  278. state = true;
  279. break;
  280. case 5:
  281. state = false;
  282. break;
  283. }
  284. return state;
  285. }
  286. ,
  287. // 显示添加页面
  288. showAdd() {
  289. this.$emit('goAdd', true);
  290. }
  291. ,
  292. // 显示导入页面
  293. showImport() {
  294. this.$emit('goImport', true);
  295. }
  296. ,
  297. handUpload(record) {
  298. let infoId = record.id;
  299. if (infoId == undefined || infoId == null) {
  300. this.$message.warning('用户编号不能为空!');
  301. return;
  302. }
  303. //console.log(record)
  304. this.$emit('goImport', infoId);
  305. }
  306. ,
  307. handSubmit(record) {
  308. let nowIpagination = this.ipagination;
  309. let model = {
  310. "id": record.id,
  311. //value1:fileUrl
  312. }
  313. httpAction(this.url.editCheck, model, "post")
  314. .then((res) => {
  315. if (res.success) {
  316. this.$message.success(res.message)
  317. this.loadData(nowIpagination.current);
  318. } else {
  319. this.$message.warning(res.message)
  320. }
  321. }).finally(() => {
  322. })
  323. //this.ipagination.current = 2;
  324. }
  325. ,
  326. initDictConfig() {
  327. }
  328. ,
  329. getSuperFieldList() {
  330. let fieldList = [];
  331. fieldList.push({type: 'string', value: 'customerNo', text: '任务名称', dictCode: ''})
  332. fieldList.push({type: 'string', value: 'checkState', text: '任务状态', dictCode: 'sms_check_task_state'})
  333. fieldList.push({type: 'datetime', value: 'taskStartTime', text: '任务开始时间'})
  334. fieldList.push({type: 'datetime', value: 'taskEndTime', text: '任务结束时间'})
  335. this.superFieldList = fieldList
  336. }
  337. ,
  338. // handleAdd: function () {
  339. // this.$refs.modalForm.add();
  340. // this.$refs.modalForm.title = "新增";
  341. // this.$refs.modalForm.disableSubmit = false;
  342. // },
  343. // handleEdit: function (record) {
  344. // this.$refs.modalForm.edit(record);
  345. // this.$refs.modalForm.title = "编辑";
  346. // this.$refs.modalForm.disableSubmit = false;
  347. // },
  348. }
  349. }
  350. </script>
  351. <style scoped>
  352. </style>