IncidentTicketList.vue 15 KB

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