serviceRepairList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 :md="4" :sm="6">
  8. <a-form-item>
  9. <a-select
  10. :maxTagCount="1"
  11. mode="multiple"
  12. v-model="queryParam.hotelId"
  13. placeholder="商家名称"
  14. :allowClear="true"
  15. >
  16. <a-select-option :value="item.id" v-for="(item,index) in hotelList" :key="index">{{ item.name }}</a-select-option>
  17. </a-select>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="4" :sm="6">
  21. <a-form-item>
  22. <j-dict-select-tag v-model="queryParam.type" placeholder="请选择类型" dictCode="service_repair_type"/>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="4" :sm="6">
  26. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  27. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  28. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  29. </span>
  30. </a-col>
  31. </a-row>
  32. </a-form>
  33. </div>
  34. <!-- 查询区域-END -->
  35. <!-- 操作按钮区域 -->
  36. <div class="table-operator">
  37. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  38. <!-- <a-button type="primary" icon="download" @click="handleExportXls('服务维修')">导出</a-button>-->
  39. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  40. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  41. <!-- </a-upload>-->
  42. <!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  43. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  44. <a-dropdown v-if="selectedRowKeys.length > 0">
  45. <!-- <a-menu slot="overlay">-->
  46. <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  47. <!-- </a-menu>-->
  48. <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  49. <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
  50. </a-dropdown>
  51. <a-button @click="handleCategory" icon="gold">物品分类管理</a-button>
  52. </div>
  53. <!-- table区域-begin -->
  54. <div>
  55. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  56. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  57. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  58. </div>
  59. <a-table
  60. ref="table"
  61. size="middle"
  62. :scroll="{x:true}"
  63. bordered
  64. rowKey="id"
  65. :columns="columns"
  66. :dataSource="dataSource"
  67. :pagination="ipagination"
  68. :loading="loading"
  69. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  70. class="j-table-force-nowrap"
  71. @change="handleTableChange">
  72. <template slot="htmlSlot" slot-scope="text">
  73. <div v-html="text"></div>
  74. </template>
  75. <template slot="imgSlot" slot-scope="text,record">
  76. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  77. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  78. </template>
  79. <template slot="fileSlot" slot-scope="text">
  80. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  81. <a-button
  82. v-else
  83. :ghost="true"
  84. type="primary"
  85. icon="download"
  86. size="small"
  87. @click="downloadFile(text)">
  88. 下载
  89. </a-button>
  90. </template>
  91. <span slot="action" slot-scope="text, record">
  92. <a @click="handleEdit(record)">编辑</a>
  93. <a-divider type="vertical" />
  94. <a-dropdown>
  95. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  96. <a-menu slot="overlay">
  97. <a-menu-item>
  98. <a @click="handleDetail(record)">详情</a>
  99. </a-menu-item>
  100. <a-menu-item>
  101. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  102. <a>删除</a>
  103. </a-popconfirm>
  104. </a-menu-item>
  105. </a-menu>
  106. </a-dropdown>
  107. </span>
  108. </a-table>
  109. </div>
  110. <service-repair-modal ref="modalForm" @ok="modalFormOk"></service-repair-modal>
  111. <service-repair-category-list ref="modalCategoryList"></service-repair-category-list>
  112. </a-card>
  113. </template>
  114. <script>
  115. import '@/assets/less/TableExpand.less'
  116. import { mixinDevice } from '@/utils/mixin'
  117. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118. import serviceRepairModal from './modules/serviceRepairModal'
  119. import ServiceRepairCategoryList from "./serviceRepairCategoryList";
  120. import {hotelQueryList} from "../../../../api/hotel";
  121. export default {
  122. name: 'serviceRepairList',
  123. mixins: [JeecgListMixin, mixinDevice],
  124. components: {
  125. ServiceRepairCategoryList,
  126. serviceRepairModal
  127. },
  128. data() {
  129. return {
  130. description: '服务维修管理页面',
  131. // 表头
  132. columns: [
  133. {
  134. title: '商家',
  135. align: "center",
  136. dataIndex: 'hotelName'
  137. },
  138. {
  139. title: '名称',
  140. align: "center",
  141. dataIndex: 'name'
  142. },
  143. {
  144. title: '类型',
  145. align: "center",
  146. dataIndex: 'type_dictText',
  147. // customRender:function (text) {
  148. // return text==1?'服务':'维修'
  149. // },
  150. },
  151. {
  152. title: '模块',
  153. align: "center",
  154. dataIndex: 'serviceType_dictText',
  155. // customRender:function (text) {
  156. // return text==1?'物品':'服务内容'
  157. // },
  158. },
  159. {
  160. title: '分类名称',
  161. align: "center",
  162. dataIndex: 'categoryName'
  163. },
  164. {
  165. title: '时间',
  166. align: "center",
  167. dataIndex: 'createTime'
  168. },
  169. {
  170. title: '操作',
  171. dataIndex: 'action',
  172. align: "center",
  173. fixed: "right",
  174. width: 147,
  175. scopedSlots: {customRender: 'action'}
  176. }
  177. ],
  178. url: {
  179. list: "/business/busServiceRepair/list",
  180. delete: "/business/busServiceRepair/delete",
  181. deleteBatch: "/business/busServiceRepair/deleteBatch",
  182. exportXlsUrl: "/business/busServiceRepair/exportXls",
  183. importExcelUrl: "business/busServiceRepair/importExcel",
  184. },
  185. dictOptions: {},
  186. superFieldList: [],
  187. hotelList: [],
  188. }
  189. },
  190. created() {
  191. this.getSuperFieldList();
  192. hotelQueryList({
  193. key: ''
  194. }).then(res => {
  195. console.log(res)
  196. if (res.code == 200 && res.result) {
  197. this.hotelList = res.result;
  198. }
  199. })
  200. },
  201. computed: {
  202. importExcelUrl: function () {
  203. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  204. },
  205. },
  206. methods: {
  207. initDictConfig() {
  208. },
  209. getSuperFieldList() {
  210. let fieldList = [];
  211. fieldList.push({type: 'string', value: 'tenantId', text: '关联租户'})
  212. fieldList.push({type: 'string', value: 'hotelId', text: '关联酒店'})
  213. fieldList.push({type: 'string', value: 'name', text: '铃声名称'})
  214. fieldList.push({type: 'int', value: 'type', text: '类型(1-服务;2-维修)'})
  215. fieldList.push({type: 'int', value: 'serviceType', text: '服务模块(1-物品;2-服务内容)'})
  216. fieldList.push({type: 'string', value: 'categoryId', text: '关联物品分类'})
  217. fieldList.push({type: 'int', value: 'delFlag', text: '删除状态(0-正常,1-已删除)'})
  218. this.superFieldList = fieldList
  219. },
  220. handleCategory() {
  221. console.log('物品分类')
  222. this.$refs.modalCategoryList.show();
  223. this.$refs.modalCategoryList.title = "物品分类管理";
  224. this.$refs.modalCategoryList.disableSubmit = true;
  225. }
  226. }
  227. }
  228. </script>
  229. <style scoped>
  230. @import '~@assets/less/common.less';
  231. </style>