IncidentTicketList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. <a-input placeholder="请输入事故单号" v-model="queryParam.accidentNumber"></a-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. <a-input placeholder="请输入责任单位" v-model="queryParam.responsibilityCompany"></a-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-dict-select-tag placeholder="请选择填报人" v-model="queryParam.informant" dictCode="sys_user ,realname,username"/>
  20. </a-form-item>
  21. </a-col>
  22. <template v-if="toggleSearchStatus">
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="计划单号">
  25. <!-- <j-dict-select-tag placeholder="请选择业务员" v-model="queryParam.businessPeople" dictCode="sys_user,realname,username"/> -->
  26. <a-input placeholder="请输入计划单号" v-model="queryParam.planNumber"></a-input>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  30. <a-form-item label="质量事故单主题">
  31. <a-input placeholder="请输入质量事故单主题" v-model="queryParam.accidentTheme"></a-input>
  32. </a-form-item>
  33. </a-col>
  34. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  35. <a-form-item label="财务备注">
  36. <a-input placeholder="请输入财务备注" v-model="queryParam.financeRemark"></a-input>
  37. </a-form-item>
  38. </a-col>
  39. </template>
  40. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  41. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  42. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  43. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  44. <a @click="handleToggleSearch" style="margin-left: 8px">
  45. {{ toggleSearchStatus ? '收起' : '展开' }}
  46. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  47. </a>
  48. </span>
  49. </a-col>
  50. </a-row>
  51. </a-form>
  52. </div>
  53. <!-- 查询区域-END -->
  54. <!-- 操作按钮区域 -->
  55. <div class="table-operator">
  56. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  57. <a-button type="primary" icon="download" @click="handleExportXls('森_工厂质量事故单-主表')">导出</a-button>
  58. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  59. <a-button type="primary" icon="import">导入</a-button>
  60. </a-upload>
  61. <a-dropdown v-if="selectedRowKeys.length > 0">
  62. <a-menu slot="overlay">
  63. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  64. </a-menu>
  65. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  66. </a-dropdown> -->
  67. </div>
  68. <!-- table区域-begin -->
  69. <div>
  70. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  71. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  72. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  73. </div> -->
  74. <a-table
  75. ref="table"
  76. size="middle"
  77. bordered
  78. rowKey="id"
  79. :columns="columns"
  80. :dataSource="dataSource"
  81. :pagination="ipagination"
  82. :loading="loading"
  83. :scroll="{x: 2000}"
  84. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  85. @change="handleTableChange">
  86. <template slot="htmlSlot" slot-scope="text">
  87. <div v-html="text"></div>
  88. </template>
  89. <template slot="imgSlot" slot-scope="text">
  90. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  91. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  92. </template>
  93. <template slot="fileSlot" slot-scope="text">
  94. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  95. <a-button
  96. v-else
  97. :ghost="true"
  98. type="primary"
  99. icon="download"
  100. size="small"
  101. @click="uploadFile(text)">
  102. 下载
  103. </a-button>
  104. </template>
  105. <span slot="state" slot-scope="text, record">
  106. <span v-if="record.state =='5'">已完结</span>
  107. <span v-if="record.state =='4'">已推送</span>
  108. <span v-if="record.state =='3'">已反馈通知</span>
  109. <span v-if="record.state =='2'">已通知</span>
  110. <span v-if="record.state =='1'">未处理</span>
  111. </span>
  112. <span slot="action" slot-scope="text, record">
  113. <a @click="handleEdit(record,'edit')">编辑</a>
  114. <a-divider type="vertical" />
  115. <a @click="handleEdit(record,'detail')">详情</a>
  116. <!--
  117. <a-divider type="vertical" />
  118. <a-dropdown>
  119. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  120. <a-menu slot="overlay">
  121. <a-menu-item>
  122. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  123. <a>删除</a>
  124. </a-popconfirm>
  125. </a-menu-item>
  126. </a-menu>
  127. </a-dropdown> -->
  128. </span>
  129. </a-table>
  130. </div>
  131. <incidentTicket-modal ref="modalForm" @ok="modalFormOk" @close='loadData'></incidentTicket-modal>
  132. <incidentTicket-modal-detail ref="IncidentTicketModalDetail" @ok="modalFormOk" @close='loadData'></incidentTicket-modal-detail>
  133. </a-card>
  134. </template>
  135. <script>
  136. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  137. import IncidentTicketModal from './modules/IncidentTicketModal'
  138. import IncidentTicketModalDetail from './modules/IncidentTicketModalDetail'
  139. import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  140. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  141. import {filterObj, cloneObject, pushIfNotExist } from '@/utils/util'
  142. import JEllipsis from '@/components/jeecg/JEllipsis'
  143. export default {
  144. name: "IncidentTicketList",
  145. mixins:[JeecgListMixin],
  146. components: {
  147. JDictSelectTag,
  148. IncidentTicketModal,
  149. IncidentTicketModalDetail,
  150. JEllipsis
  151. },
  152. data () {
  153. let ellipsis = (v, l = 15) => <j-ellipsis value={v} length={l} /> // 省略
  154. return {
  155. description: '森_工厂质量事故单-主表管理页面',
  156. // 表头
  157. columns: [
  158. {
  159. title:'日期',
  160. align:"center",
  161. ellipsis: true,
  162. dataIndex: 'accidentData',
  163. width:100
  164. },
  165. {
  166. title:'质量事故单号',
  167. align:"center",
  168. customRender: (t) => ellipsis(t),
  169. dataIndex: 'accidentNumber',
  170. width:100
  171. },
  172. {
  173. title:'质量事故单主题',
  174. align:"center",
  175. customRender: (t) => ellipsis(t),
  176. dataIndex: 'accidentTheme',
  177. width:100,
  178. ellipsis: true,
  179. },
  180. {
  181. title:'责任单位',
  182. align:"center",
  183. customRender: (t) => ellipsis(t),
  184. dataIndex: 'responsibilityCompany',
  185. width:160,
  186. },
  187. {
  188. title:'责任人1',
  189. align:"center",
  190. dataIndex: 'responsibilityPerson1',
  191. width:80
  192. },
  193. {
  194. title:'责任人2',
  195. align:"center",
  196. dataIndex: 'responsibilityPerson2',
  197. width:80
  198. },
  199. {
  200. title:'责任人3',
  201. align:"center",
  202. dataIndex: 'responsibilityPerson3',
  203. width:80
  204. },
  205. {
  206. title:'计划单号',
  207. align:"center",
  208. dataIndex: 'planNumber',
  209. width:100
  210. },
  211. {
  212. title:'款号',
  213. align:"center",
  214. dataIndex: 'styleNumber',
  215. width:100
  216. },
  217. {
  218. title:'总金额',
  219. align:"center",
  220. dataIndex: 'totalMoney',
  221. width:80
  222. },
  223. {
  224. title:'财务备注',
  225. align:"center",
  226. dataIndex: 'financeRemark',
  227. customRender: (t) => ellipsis(t),
  228. width:140
  229. },
  230. {
  231. title:'状态',
  232. align:"center",
  233. dataIndex: 'state',
  234. scopedSlots: { customRender: 'state' },
  235. width:80
  236. },
  237. {
  238. title: '操作',
  239. dataIndex: 'action',
  240. align:"center",
  241. scopedSlots: { customRender: 'action' },
  242. fixed:"right",
  243. width:120
  244. }
  245. ],
  246. url: {
  247. list: "/oa/incidentTicket/list",
  248. delete: "/oa/incidentTicket/delete",
  249. deleteBatch: "/oa/incidentTicket/deleteBatch",
  250. exportXlsUrl: "/oa/incidentTicket/exportXls",
  251. importExcelUrl: "oa/incidentTicket/importExcel",
  252. },
  253. dictOptions:{},
  254. dataSource:[]
  255. }
  256. },
  257. created(){
  258. this.dataSource.push({accidentTheme:''})
  259. },
  260. computed: {
  261. importExcelUrl: function(){
  262. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  263. }
  264. },
  265. methods: {
  266. getQueryParams() {
  267. var param = Object.assign({}, this.queryParam, null);
  268. param.field = this.getQueryField();
  269. param.pageNo = this.ipagination.current;
  270. param.pageSize = this.ipagination.pageSize;
  271. return filterObj(param);
  272. },
  273. initDictConfig(){
  274. },
  275. handleEdit(record,data){
  276. if(data =='edit'){
  277. this.$refs.modalForm.visible = true
  278. this.$refs.modalForm.getHeaderList(record.id)
  279. // this.$refs.modalForm.defultMethods = 'edit'
  280. }else{
  281. this.$refs.IncidentTicketModalDetail.visible = true
  282. this.$refs.IncidentTicketModalDetail.getHeaderList(record.id)
  283. }
  284. }
  285. }
  286. }
  287. </script>
  288. <style scoped>
  289. @import '~@assets/less/common.less';
  290. </style>