IncidentTicketList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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.accidentNumber"></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-input placeholder="请输入责任单位" v-model="queryParam.responsibilityCompany"></j-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <a-form-item label="填报人">
  19. <j-search-select-tag v-model="queryParam.informant" placeholder=""
  20. dict="sys_user,realname,realname" @search="searchName"/>
  21. <!-- <j-dict-select-tag placeholder="请选择填报人" v-model="queryParam.informant" dictCode="sys_user ,realname,username"/> -->
  22. </a-form-item>
  23. </a-col>
  24. <template v-if="toggleSearchStatus">
  25. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  26. <a-form-item label="计划单号">
  27. <!-- <j-dict-select-tag placeholder="请选择业务员" v-model="queryParam.businessPeople" dictCode="sys_user,realname,username"/> -->
  28. <j-input placeholder="请输入计划单号" v-model="queryParam.planNumber"></j-input>
  29. </a-form-item>
  30. </a-col>
  31. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  32. <a-form-item label="质量事故单主题">
  33. <j-input placeholder="请输入质量事故单主题" v-model="queryParam.accidentTheme"></j-input>
  34. </a-form-item>
  35. </a-col>
  36. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  37. <a-form-item label="单据状态">
  38. <a-select placeholder="" v-model="queryParam.state">
  39. <a-select-option value="">请选择</a-select-option>
  40. <a-select-option value="1">未处理</a-select-option>
  41. <a-select-option value="2">已通知</a-select-option>
  42. <a-select-option value="3">已反馈通知</a-select-option>
  43. <a-select-option value="4">已推送</a-select-option>
  44. <a-select-option value="5">已完结</a-select-option>
  45. </a-select>
  46. </a-form-item>
  47. </a-col>
  48. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  49. <a-form-item label="处理人">
  50. <j-search-select-tag v-model="queryParam.processor" placeholder=""
  51. dict="sys_user,realname,username" @search="searchName"/>
  52. <!-- <j-dict-select-tag placeholder="请选择填报人" v-model="queryParam.informant" dictCode="sys_user ,realname,username"/> -->
  53. </a-form-item>
  54. </a-col>
  55. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  56. <a-form-item label="是否处理">
  57. <a-select placeholder="" v-model="queryParam.handle">
  58. <a-select-option value="">请选择</a-select-option>
  59. <a-select-option value="是">是</a-select-option>
  60. <a-select-option value="否">否</a-select-option>
  61. </a-select>
  62. </a-form-item>
  63. </a-col>
  64. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  65. <a-form-item label="财务备注">
  66. <j-input placeholder="请输入财务备注" v-model="queryParam.financeRemark"></j-input>
  67. </a-form-item>
  68. </a-col>
  69. </template>
  70. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  71. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  72. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  73. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  74. <a @click="handleToggleSearch" style="margin-left: 8px">
  75. {{ toggleSearchStatus ? '收起' : '展开' }}
  76. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  77. </a>
  78. </span>
  79. </a-col>
  80. </a-row>
  81. </a-form>
  82. </div>
  83. <!-- 查询区域-END -->
  84. <!-- 操作按钮区域 -->
  85. <div class="table-operator">
  86. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  87. <a-button type="primary" icon="download" @click="handleExportXls('森_工厂质量事故单-主表')">导出</a-button>
  88. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  89. <a-button type="primary" icon="import">导入</a-button>
  90. </a-upload>
  91. <a-dropdown v-if="selectedRowKeys.length > 0">
  92. <a-menu slot="overlay">
  93. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  94. </a-menu>
  95. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  96. </a-dropdown> -->
  97. </div>
  98. <!-- table区域-begin -->
  99. <div>
  100. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  101. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  102. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  103. </div> -->
  104. <a-table
  105. ref="table"
  106. size="middle"
  107. bordered
  108. rowKey="id"
  109. :columns="columns"
  110. :dataSource="dataSource"
  111. :pagination="ipagination"
  112. :loading="loading"
  113. :scroll="{x: 1500,y:400}"
  114. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  115. @change="handleTableChange">
  116. <template slot="htmlSlot" slot-scope="text">
  117. <div v-html="text"></div>
  118. </template>
  119. <template slot="imgSlot" slot-scope="text">
  120. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  121. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  122. </template>
  123. <template slot="fileSlot" slot-scope="text">
  124. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  125. <a-button
  126. v-else
  127. :ghost="true"
  128. type="primary"
  129. icon="download"
  130. size="small"
  131. @click="uploadFile(text)">
  132. 下载
  133. </a-button>
  134. </template>
  135. <span slot="state" slot-scope="text, record">
  136. <span v-if="record.state =='5'">已完结</span>
  137. <span v-if="record.state =='4'">已推送</span>
  138. <span v-if="record.state =='3'">已反馈通知</span>
  139. <span v-if="record.state =='2'">已通知</span>
  140. <span v-if="record.state =='1'">未处理</span>
  141. </span>
  142. <span slot="action" slot-scope="text, record">
  143. <a @click="handleEdit(record,'edit')">编辑</a>
  144. <a-divider type="vertical" />
  145. <a @click="handleEdit(record,'detail')">详情</a>
  146. <!--
  147. <a-divider type="vertical" />
  148. <a-dropdown>
  149. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  150. <a-menu slot="overlay">
  151. <a-menu-item>
  152. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  153. <a>删除</a>
  154. </a-popconfirm>
  155. </a-menu-item>
  156. </a-menu>
  157. </a-dropdown> -->
  158. </span>
  159. </a-table>
  160. </div>
  161. <incidentTicket-modal ref="modalForm" @ok="modalFormOk" @close='loadData'></incidentTicket-modal>
  162. <incidentTicket-modal-detail ref="IncidentTicketModalDetail" @ok="modalFormOk" @close='loadData'></incidentTicket-modal-detail>
  163. </a-card>
  164. </template>
  165. <script>
  166. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  167. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  168. import IncidentTicketModal from './modules/IncidentTicketModal'
  169. import IncidentTicketModalDetail from './modules/IncidentTicketModalDetail'
  170. import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  171. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  172. import {filterObj, cloneObject, pushIfNotExist } from '@/utils/util'
  173. import JEllipsis from '@/components/jeecg/JEllipsis'
  174. import JInput from '@/components/jeecg/JInput'
  175. import moment from 'moment'
  176. export default {
  177. name: "IncidentTicketList",
  178. mixins:[JeecgListMixin],
  179. components: {
  180. JDictSelectTag,
  181. IncidentTicketModal,
  182. IncidentTicketModalDetail,
  183. JSearchSelectTag,
  184. JEllipsis,
  185. JInput,
  186. moment
  187. },
  188. data () {
  189. let ellipsis = (v, l ) => <j-ellipsis value={v} length={l} /> // 省略
  190. return {
  191. description: '森_工厂质量事故单-主表管理页面',
  192. // 表头
  193. columns: [
  194. {
  195. title:'序号',
  196. align:"center",
  197. ellipsis: true,
  198. dataIndex: 'sort',
  199. width:80
  200. },
  201. {
  202. title:'日期',
  203. align:"center",
  204. ellipsis: true,
  205. dataIndex: 'accidentData',
  206. width:100
  207. },
  208. {
  209. title:'质量事故单号',
  210. align:"center",
  211. customRender: (t) => ellipsis(t),
  212. dataIndex: 'accidentNumber',
  213. width:120
  214. },
  215. {
  216. title:'财务备注',
  217. align:"center",
  218. dataIndex: 'financeRemark',
  219. customRender: (t) => ellipsis(t,15),
  220. width:250,
  221. },
  222. {
  223. title:'账套号',
  224. align:"center",
  225. ellipsis: true,
  226. dataIndex: 'acSetNo',
  227. width:100
  228. },
  229. {
  230. title:'U8生成运费发票号',
  231. align:"center",
  232. dataIndex: 'u8Invoices',
  233. width:149,
  234. },
  235. {
  236. title:'责任单位',
  237. align:"center",
  238. // customRender: (t) => ellipsis(t),
  239. dataIndex: 'responsibilityCompany',
  240. width:100,
  241. },
  242. {
  243. title:'质量事故单主题',
  244. align:"center",
  245. customRender: (t) => ellipsis(t,13),
  246. dataIndex: 'accidentTheme',
  247. width:200,
  248. ellipsis: true,
  249. },
  250. {
  251. title:'责任人1',
  252. align:"center",
  253. dataIndex: 'responsibilityPerson1',
  254. width:90
  255. },
  256. {
  257. title:'责任人2',
  258. align:"center",
  259. dataIndex: 'responsibilityPerson2',
  260. width:90
  261. },
  262. {
  263. title:'责任人3',
  264. align:"center",
  265. dataIndex: 'responsibilityPerson3',
  266. width:90
  267. },
  268. {
  269. title:'填报人',
  270. align:"center",
  271. dataIndex: 'informant',
  272. width:90
  273. },
  274. {
  275. title:'计划单号',
  276. align:"center",
  277. dataIndex: 'planNumber',
  278. width:150
  279. },
  280. {
  281. title:'款号',
  282. align:"center",
  283. dataIndex: 'styleNumber',
  284. width:120
  285. },
  286. {
  287. title:'总金额',
  288. align:"center",
  289. dataIndex: 'totalMoney',
  290. width:100
  291. },
  292. {
  293. title:'状态',
  294. align:"center",
  295. dataIndex: 'state',
  296. fixed:"right",
  297. scopedSlots: { customRender: 'state' },
  298. width:120
  299. },
  300. {
  301. title: '操作',
  302. dataIndex: 'action',
  303. align:"center",
  304. scopedSlots: { customRender: 'action' },
  305. fixed:"right",
  306. width:135
  307. }
  308. ],
  309. url: {
  310. list: "/oa/incidentTicket/list",
  311. delete: "/oa/incidentTicket/delete",
  312. deleteBatch: "/oa/incidentTicket/deleteBatch",
  313. exportXlsUrl: "/oa/incidentTicket/exportXls",
  314. importExcelUrl: "oa/incidentTicket/importExcel",
  315. },
  316. ipagination: {
  317. current: 1,
  318. pageSize: 100,
  319. pageSizeOptions: ['10', '20', '30','100'],
  320. showTotal: (total, range) => {
  321. return range[0] + "-" + range[1] + " 共" + total + "条"
  322. },
  323. showQuickJumper: true,
  324. showSizeChanger: true,
  325. total: 0
  326. },
  327. dictOptions:{},
  328. dataSource:[]
  329. }
  330. },
  331. created(){
  332. this.dataSource.push({accidentTheme:''})
  333. },
  334. watch:{
  335. dataSource:{
  336. immediate:true,
  337. handler(newVlue) {
  338. newVlue.map(item=>{
  339. item.accidentData = moment(item.accidentData).format('YYYY-MM-DD');
  340. })
  341. },
  342. }
  343. },
  344. computed: {
  345. importExcelUrl: function(){
  346. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  347. }
  348. },
  349. methods: {
  350. getQueryParams() {
  351. this.toggleSearchStatus = false
  352. var param = Object.assign({}, this.queryParam, null);
  353. param.field = this.getQueryField();
  354. param.pageNo = this.ipagination.current;
  355. param.pageSize = this.ipagination.pageSize;
  356. return filterObj(param);
  357. },
  358. initDictConfig(){
  359. },
  360. handleEdit(record,data){
  361. if(data =='edit'){
  362. this.$refs.modalForm.visible = true
  363. this.$refs.modalForm.getHeaderList(record.id)
  364. // this.$refs.modalForm.defultMethods = 'edit'
  365. }else{
  366. this.$refs.IncidentTicketModalDetail.visible = true
  367. this.$refs.IncidentTicketModalDetail.getHeaderList(record.id)
  368. }
  369. }
  370. }
  371. }
  372. </script>
  373. <style scoped lang="less">
  374. @import '~@assets/less/common.less';
  375. /deep/ .ant-table td {
  376. // white-space: break-spaces !important;
  377. word-break: break-word;
  378. }
  379. /deep/ .ant-table-tbody .ant-table-row td{
  380. padding-top: 8px !important ;
  381. padding-bottom: 8px !important;
  382. }
  383. /deep/ .ant-table-thead > tr, .ant-table-tbody > tr {
  384. height: 0px !important;
  385. }
  386. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
  387. padding: 8px 16px !important;
  388. }
  389. </style>