IncidentTicketList.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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.accidentTheme"></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.styleNumber"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="业务员">
  20. <j-dict-select-tag placeholder="请选择业务员" v-model="queryParam.businessPeople" dictCode="sys_user,realname,username"/>
  21. </a-form-item>
  22. </a-col>
  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.informant" dictCode="sys_user ,realname,username"/>
  26. </a-form-item>
  27. </a-col>
  28. </template>
  29. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  30. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  31. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  32. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  33. <a @click="handleToggleSearch" style="margin-left: 8px">
  34. {{ toggleSearchStatus ? '收起' : '展开' }}
  35. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  36. </a>
  37. </span>
  38. </a-col>
  39. </a-row>
  40. </a-form>
  41. </div>
  42. <!-- 查询区域-END -->
  43. <!-- 操作按钮区域 -->
  44. <div class="table-operator">
  45. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  46. <a-button type="primary" icon="download" @click="handleExportXls('森_工厂质量事故单-主表')">导出</a-button>
  47. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  48. <a-button type="primary" icon="import">导入</a-button>
  49. </a-upload>
  50. <a-dropdown v-if="selectedRowKeys.length > 0">
  51. <a-menu slot="overlay">
  52. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  53. </a-menu>
  54. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  55. </a-dropdown> -->
  56. </div>
  57. <!-- table区域-begin -->
  58. <div>
  59. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  60. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  61. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  62. </div> -->
  63. <a-table
  64. ref="table"
  65. size="middle"
  66. bordered
  67. rowKey="id"
  68. :columns="columns"
  69. :dataSource="dataSource"
  70. :pagination="ipagination"
  71. :loading="loading"
  72. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  73. @change="handleTableChange">
  74. <template slot="htmlSlot" slot-scope="text">
  75. <div v-html="text"></div>
  76. </template>
  77. <template slot="imgSlot" slot-scope="text">
  78. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  79. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  80. </template>
  81. <template slot="fileSlot" slot-scope="text">
  82. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  83. <a-button
  84. v-else
  85. :ghost="true"
  86. type="primary"
  87. icon="download"
  88. size="small"
  89. @click="uploadFile(text)">
  90. 下载
  91. </a-button>
  92. </template>
  93. <span slot="action" slot-scope="text, record">
  94. <a @click="handleEdit(record,'edit')">编辑</a>
  95. <a-divider type="vertical" />
  96. <a @click="handleEdit(record,'detail')">详情</a>
  97. <!--
  98. <a-divider type="vertical" />
  99. <a-dropdown>
  100. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  101. <a-menu slot="overlay">
  102. <a-menu-item>
  103. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  104. <a>删除</a>
  105. </a-popconfirm>
  106. </a-menu-item>
  107. </a-menu>
  108. </a-dropdown> -->
  109. </span>
  110. </a-table>
  111. </div>
  112. <incidentTicket-modal ref="modalForm" @ok="modalFormOk" @close='loadData'></incidentTicket-modal>
  113. <incidentTicket-modal-detail ref="IncidentTicketModalDetail" @ok="modalFormOk" @close='loadData'></incidentTicket-modal-detail>
  114. </a-card>
  115. </template>
  116. <script>
  117. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118. import IncidentTicketModal from './modules/IncidentTicketModal'
  119. import IncidentTicketModalDetail from './modules/IncidentTicketModalDetail'
  120. import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  121. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  122. export default {
  123. name: "IncidentTicketList",
  124. mixins:[JeecgListMixin],
  125. components: {
  126. JDictSelectTag,
  127. IncidentTicketModal,
  128. IncidentTicketModalDetail
  129. },
  130. data () {
  131. return {
  132. description: '森_工厂质量事故单-主表管理页面',
  133. // 表头
  134. columns: [
  135. {
  136. title:'日期',
  137. align:"center",
  138. dataIndex: 'accidentData'
  139. },
  140. {
  141. title:'质量事故单主题',
  142. align:"center",
  143. dataIndex: 'accidentTheme'
  144. },
  145. {
  146. title:'事故责任人',
  147. align:"center",
  148. dataIndex: 'accidentPersonLiable'
  149. },
  150. {
  151. title:'质量事故单号',
  152. align:"center",
  153. dataIndex: 'accidentNumber'
  154. },
  155. {
  156. title:'总金额',
  157. align:"center",
  158. dataIndex: 'totalMoney'
  159. },
  160. {
  161. title:'业务类型',
  162. align:"center",
  163. dataIndex: 'businessType'
  164. },
  165. {
  166. title: '操作',
  167. dataIndex: 'action',
  168. align:"center",
  169. scopedSlots: { customRender: 'action' },
  170. }
  171. ],
  172. url: {
  173. list: "/oa/incidentTicket/list",
  174. delete: "/oa/incidentTicket/delete",
  175. deleteBatch: "/oa/incidentTicket/deleteBatch",
  176. exportXlsUrl: "/oa/incidentTicket/exportXls",
  177. importExcelUrl: "oa/incidentTicket/importExcel",
  178. },
  179. dictOptions:{},
  180. dataSource:[]
  181. }
  182. },
  183. created(){
  184. this.dataSource.push({accidentTheme:''})
  185. },
  186. computed: {
  187. importExcelUrl: function(){
  188. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  189. }
  190. },
  191. methods: {
  192. initDictConfig(){
  193. },
  194. handleEdit(record,data){
  195. if(data =='edit'){
  196. this.$refs.modalForm.visible = true
  197. this.$refs.modalForm.getHeaderList(record.id)
  198. // this.$refs.modalForm.defultMethods = 'edit'
  199. }else{
  200. this.$refs.IncidentTicketModalDetail.visible = true
  201. this.$refs.IncidentTicketModalDetail.getHeaderList(record.id)
  202. }
  203. }
  204. }
  205. }
  206. </script>
  207. <style scoped>
  208. @import '~@assets/less/common.less';
  209. </style>