IncidentTicketList.vue 12 KB

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