You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

591 lines
20 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <a-row :gutter="10">
  3. <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
  4. <a-card :bordered="false">
  5. <!-- 查询区域 -->
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="12">
  10. <a-form-item label="订单编号">
  11. <a-input placeholder="请输入订单编号" v-model="queryParam.id"></a-input>
  12. <!-- <j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>-->
  13. </a-form-item>
  14. </a-col>
  15. <a-col :md="6" :sm="12">
  16. <a-form-item label="用户编号">
  17. <a-input placeholder="请输入用户编号" v-model="queryParam.userId"></a-input>
  18. <!-- <j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>-->
  19. </a-form-item>
  20. </a-col>
  21. <a-col :md="6" :sm="12">
  22. <a-form-item label="店铺编号">
  23. <a-input placeholder="请输入店铺编号" v-model="queryParam.shopId"></a-input>
  24. <!-- <j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>-->
  25. </a-form-item>
  26. </a-col>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 查询区域-END -->
  31. <!-- 操作按钮区域 -->
  32. <div class="table-operator">
  33. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
  34. <!-- <a-button type="primary" icon="download" @click="handleExportXls('hotel_order')">导出</a-button>-->
  35. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  36. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  37. <!-- </a-upload>-->
  38. <!-- 高级查询区域 -->
  39. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  40. <a-dropdown v-if="selectedRowKeys.length > 0">
  41. <a-menu slot="overlay">
  42. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  43. </a-menu>
  44. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  45. </a-dropdown>
  46. </div>
  47. <!-- table区域-begin -->
  48. <div>
  49. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  50. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
  51. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  52. </div>
  53. <a-table
  54. ref="table"
  55. size="middle"
  56. :scroll="{x:true}"
  57. bordered
  58. rowKey="id"
  59. :columns="columns"
  60. :dataSource="dataSource"
  61. :pagination="ipagination"
  62. :loading="loading"
  63. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  64. class="j-table-force-nowrap"
  65. @change="handleTableChange">
  66. <template slot="htmlSlot" slot-scope="text">
  67. <div v-html="text"></div>
  68. </template>
  69. <template slot="imgSlot" slot-scope="text,record">
  70. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  71. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  72. </template>
  73. <template slot="fileSlot" slot-scope="text">
  74. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  75. <a-button
  76. v-else
  77. :ghost="true"
  78. type="primary"
  79. icon="download"
  80. size="small"
  81. @click="downloadFile(text)">
  82. 下载
  83. </a-button>
  84. </template>
  85. <span slot="action" slot-scope="text, record">
  86. <!-- <a @click="handleEdit(record)">编辑</a>-->
  87. <a @click="handleOpen(record)">订单详情</a>
  88. <a-divider type="vertical"/>
  89. <!-- <a-divider type="vertical" />-->
  90. <div v-if="record.status === 7">
  91. <a @click="handleAudit(0,record)">通过</a>
  92. <a-divider type="vertical" />
  93. <a @click="handleAudit(1,record)">不通过</a>
  94. <a-divider type="vertical" />
  95. </div>
  96. <div v-if="record.status === 9">
  97. <a @click="handleTake(record)">确认收货</a>
  98. <a-divider type="vertical" />
  99. </div>
  100. <a-dropdown>
  101. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  102. <a-menu slot="overlay">
  103. <a-menu-item>
  104. <a @click="handleDetail(record)">详情</a>
  105. </a-menu-item>
  106. <a-menu-item>
  107. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  108. <a>删除</a>
  109. </a-popconfirm>
  110. </a-menu-item>
  111. </a-menu>
  112. </a-dropdown>
  113. </span>
  114. </a-table>
  115. </div>
  116. <hotel-order-modal ref="modalForm" @ok="modalFormOk"></hotel-order-modal>
  117. <wash-order-modal ref="modalForm2" @ok="modalFormOk"></wash-order-modal>
  118. </a-card>
  119. </a-col>
  120. <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1">
  121. <a-card :bordered="false">
  122. <!-- 查询区域 -->
  123. <div class="table-page-search-wrapper">
  124. <a-form layout="inline">
  125. <a-row :gutter="24">
  126. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  127. <!-- <a-col :md="9" :sm="24">-->
  128. <!-- <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>-->
  129. <!-- <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>-->
  130. <!-- </a-col>-->
  131. </span>
  132. </a-row>
  133. </a-form>
  134. </div>
  135. <!-- 操作按钮区域 -->
  136. <div class="table-operator" :md="24" :sm="24">
  137. <!-- <a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">新增规格</a-button>-->
  138. <!--<a-button @click="handleEdit2" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
  139. <!-- <a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">已有用户</a-button>-->
  140. <a-dropdown v-if="selectedRowKeys2.length > 0">
  141. <a-menu slot="overlay">
  142. <a-menu-item key="1" @click="batchDel2">
  143. <a-icon type="delete"/>
  144. 删除
  145. </a-menu-item>
  146. </a-menu>
  147. <a-button style="margin-left: 8px"> 批量操作
  148. <a-icon type="down"/>
  149. </a-button>
  150. </a-dropdown>
  151. </div>
  152. <!-- table区域-begin -->
  153. <div>
  154. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
  155. <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{-->
  156. <!-- selectedRowKeys2.length }}</a>-->
  157. <!-- <a style="margin-left: 24px" @click="onClearSelected2">清空</a>-->
  158. <!-- </div>-->
  159. <a-table
  160. style="height:500px"
  161. ref="table2"
  162. bordered
  163. size="middle"
  164. rowKey="id"
  165. :columns="columns2"
  166. :dataSource="dataSource2"
  167. :pagination="ipagination2"
  168. :loading="loading2"
  169. :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
  170. @change="handleTableChange2">
  171. <template slot="imgSlot" slot-scope="text,record">
  172. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  173. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  174. </template>
  175. <span slot="action" slot-scope="text, record">
  176. <a @click="handleEdit2(record)">编辑</a>
  177. <a-divider type="vertical"/>
  178. <a-dropdown>
  179. <a class="ant-dropdown-link">
  180. 更多 <a-icon type="down"/>
  181. </a>
  182. <a-menu slot="overlay">
  183. <a-menu-item>
  184. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete2(record.id)">
  185. <a>删除</a>
  186. </a-popconfirm>
  187. </a-menu-item>
  188. </a-menu>
  189. </a-dropdown>
  190. </span>
  191. </a-table>
  192. </div>
  193. <!-- 表单区域 -->
  194. <hotel-goods-modal ref="modalForm" @ok="modalFormOk"></hotel-goods-modal>
  195. <hotel-order-detail-modal ref="modalForm2" @ok="modalFormOk2"></hotel-order-detail-modal>
  196. <!-- <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>-->
  197. </a-card>
  198. </a-col>
  199. </a-row>
  200. </template>
  201. <script>
  202. import '@/assets/less/TableExpand.less'
  203. import { mixinDevice } from '@/utils/mixin'
  204. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  205. import HotelOrderModal from './modules/HotelOrderModal'
  206. import WashOrderModal from './modules/WashOrderModal'
  207. import { httpAction, getAction } from '@/api/manage'
  208. import HotelOrderDetailModal from './modules/HotelOrderDetailModal'
  209. import {filterObj} from "@/utils/util";
  210. export default {
  211. name: 'ReplaceOrderList',
  212. mixins:[JeecgListMixin, mixinDevice],
  213. components: {
  214. HotelOrderModal,
  215. WashOrderModal,
  216. HotelOrderDetailModal
  217. },
  218. data () {
  219. return {
  220. description: '换货订单管理页面',
  221. // 表头
  222. columns: [
  223. {
  224. title: '#',
  225. dataIndex: '',
  226. key:'rowIndex',
  227. width:60,
  228. align:"center",
  229. customRender:function (t,r,index) {
  230. return parseInt(index)+1;
  231. }
  232. },
  233. {
  234. title:'创建时间',
  235. align:"center",
  236. dataIndex: 'createTime',
  237. sorter: true,
  238. },
  239. {
  240. title:'标题',
  241. align:"center",
  242. dataIndex: 'title'
  243. },
  244. {
  245. title:'商品图片',
  246. align:"center",
  247. dataIndex: 'pic',
  248. scopedSlots: {customRender: 'imgSlot'}
  249. },
  250. {
  251. title:'客户姓名',
  252. align:"center",
  253. dataIndex: 'userName'
  254. },
  255. {
  256. title:'客户手机号',
  257. align:"center",
  258. dataIndex: 'userPhone'
  259. },
  260. {
  261. title:'用户地址',
  262. align:"center",
  263. dataIndex: 'userAddress'
  264. },
  265. {
  266. title:'用户编号',
  267. align:"center",
  268. dataIndex: 'userId'
  269. },
  270. {
  271. title:'店铺编号',
  272. align:"center",
  273. dataIndex: 'shopId'
  274. },
  275. {
  276. title:'申请原因',
  277. align:"center",
  278. dataIndex: 'reason'
  279. },
  280. {
  281. title:'换货数量',
  282. align:"center",
  283. dataIndex: 'refundNum'
  284. },
  285. {
  286. title:'换货支付金额',
  287. align:"center",
  288. dataIndex: 'reasonPrice'
  289. },
  290. {
  291. title:'换货说明',
  292. align:"center",
  293. dataIndex: 'reasonInfo'
  294. },
  295. {
  296. title:'换货说明图',
  297. align:"center",
  298. dataIndex: 'reasonPic',
  299. scopedSlots: {customRender: 'imgSlot'}
  300. },
  301. // {
  302. // title:'租赁时间',
  303. // align:"center",
  304. // dataIndex: 'leaseTime'
  305. // },
  306. // {
  307. // title:'缴纳费用',
  308. // align:"center",
  309. // dataIndex: 'payFee'
  310. // },
  311. // {
  312. // title:'押金',
  313. // align:"center",
  314. // dataIndex: 'deposit'
  315. // },
  316. // {
  317. // title:'水洗费用',
  318. // align:"center",
  319. // dataIndex: 'washPay'
  320. // },
  321. // {
  322. // title:'水洗费用',
  323. // align:"center",
  324. // dataIndex: 'rentPay'
  325. // },
  326. // {
  327. // title:'支付金额',
  328. // align:"center",
  329. // dataIndex: 'orderPay'
  330. // },
  331. {
  332. title:'状态',
  333. align:"center",
  334. dataIndex: 'status_dictText'
  335. },
  336. {
  337. title:'类型',
  338. align:"center",
  339. dataIndex: 'type_dictText'
  340. },
  341. {
  342. title:'是否删除',
  343. align:"center",
  344. dataIndex: 'delFlag_dictText'
  345. },
  346. {
  347. title: '操作',
  348. dataIndex: 'action',
  349. align:"center",
  350. fixed:"right",
  351. width:147,
  352. scopedSlots: { customRender: 'action' }
  353. }
  354. ],
  355. url: {
  356. list: "/hotelorder/hotelOrder/replace/list",
  357. delete: "/hotelorder/hotelOrder/delete",
  358. deleteBatch: "/hotelorder/hotelOrder/deleteBatch",
  359. exportXlsUrl: "/hotelorder/hotelOrder/exportXls",
  360. importExcelUrl: "hotelorder/hotelOrder/importExcel",
  361. damageAuditUrl: "/hotelorder/hotelOrder/damage/audit",
  362. takeUrl: "/hotelorder/hotelOrder/take",
  363. detailList: "/hotelorderdetail/hotelOrderDetail/list",
  364. },
  365. dictOptions:{},
  366. superFieldList:[],
  367. rightcolval:0,
  368. currentRoleId: '',
  369. selectionRows2: [],
  370. selectedRowKeys2:[],
  371. dataSource2:[],
  372. ipagination2: {
  373. current: 1,
  374. pageSize: 10,
  375. pageSizeOptions: ['10', '20', '30'],
  376. showTotal: (total, range) => {
  377. return range[0] + '-' + range[1] + ' 共' + total + '条'
  378. },
  379. showQuickJumper: true,
  380. showSizeChanger: true,
  381. total: 0
  382. },
  383. columns2:[
  384. {
  385. title:'商品名',
  386. align:"center",
  387. dataIndex: 'goodsName'
  388. },
  389. {
  390. title:'商品图',
  391. align:"center",
  392. dataIndex: 'pic',
  393. scopedSlots: {customRender: 'imgSlot'}
  394. },
  395. {
  396. title:'规格',
  397. align:"center",
  398. dataIndex: 'sku'
  399. },
  400. {
  401. title:'数量',
  402. align:"center",
  403. dataIndex: 'num'
  404. },
  405. {
  406. title:'押金',
  407. align:"center",
  408. dataIndex: 'deposit'
  409. },
  410. {
  411. title:'租金',
  412. align:"center",
  413. dataIndex: 'rentPay'
  414. },
  415. {
  416. title:'水洗费用',
  417. align:"center",
  418. dataIndex: 'washPay'
  419. },
  420. {
  421. title:'优惠金额',
  422. align:"center",
  423. dataIndex: 'discountPrice'
  424. },
  425. {
  426. title:'是否删除',
  427. align:"center",
  428. dataIndex: 'delFlag_dictText'
  429. },
  430. {
  431. title: '操作',
  432. dataIndex: 'action',
  433. align:"center",
  434. fixed:"right",
  435. width:147,
  436. scopedSlots: { customRender: 'action' }
  437. }
  438. ],
  439. }
  440. },
  441. created() {
  442. this.getSuperFieldList();
  443. },
  444. computed: {
  445. importExcelUrl: function(){
  446. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  447. },
  448. leftColMd() {
  449. return this.selectedRowKeys.length === 0 ? 24 : 12
  450. },
  451. rightColMd() {
  452. return this.selectedRowKeys.length === 0 ? 0 : 12
  453. }
  454. },
  455. methods: {
  456. initDictConfig(){
  457. },
  458. getSuperFieldList(){
  459. let fieldList=[];
  460. fieldList.push({type:'string',value:'title',text:'标题',dictCode:''})
  461. fieldList.push({type:'string',value:'userName',text:'客户姓名',dictCode:''})
  462. fieldList.push({type:'string',value:'userPhone',text:'客户手机号',dictCode:''})
  463. fieldList.push({type:'string',value:'userId',text:'用户编号',dictCode:''})
  464. fieldList.push({type:'string',value:'shopId',text:'店铺编号',dictCode:''})
  465. fieldList.push({type:'int',value:'status',text:'状态',dictCode:'order_status'})
  466. fieldList.push({type:'int',value:'type',text:'类型',dictCode:'hotel_order_type'})
  467. fieldList.push({type:'int',value:'delFlag',text:'是否删除',dictCode:'is_delete'})
  468. this.superFieldList = fieldList
  469. },
  470. handleAudit(e,obj){
  471. obj.audit = e;
  472. httpAction(this.url.damageAuditUrl,obj,'post').then((res)=>{
  473. this.loadData();
  474. })
  475. },
  476. handleTake(obj){
  477. this.$refs.modalForm2.audit(obj);
  478. this.$refs.modalForm2.title = "确认收货";
  479. this.$refs.modalForm2.disableSubmit = false;
  480. },
  481. searchQuery2() {
  482. this.loadData2(1)
  483. },
  484. searchReset2() {
  485. this.queryParam2 = {}
  486. this.loadData2(1)
  487. },
  488. handleTableChange2(pagination, filters, sorter) {
  489. //分页、排序、筛选变化时触发
  490. //TODO 筛选
  491. if (Object.keys(sorter).length > 0) {
  492. this.isorter2.column = sorter.field
  493. this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
  494. }
  495. this.ipagination2 = pagination
  496. this.loadData2()
  497. },
  498. hideUserList(){
  499. //this.rightcolval = 0
  500. this.selectedRowKeys1 = []
  501. },
  502. handlePerssion(roleId){
  503. this.$refs.modalUserRole.show(roleId);
  504. },
  505. onSelectChange2(selectedRowKeys, selectionRows) {
  506. this.selectedRowKeys2 = selectedRowKeys
  507. this.selectionRows2 = selectionRows
  508. },
  509. onClearSelected2() {
  510. this.selectedRowKeys2 = []
  511. this.selectionRows2 = []
  512. },
  513. handleOpen(record) {
  514. this.rightcolval = 1
  515. this.selectedRowKeys = [record.id]
  516. this.model = Object.assign({}, record)
  517. this.currentRoleId = record.id
  518. this.onClearSelected2()
  519. this.loadData2()
  520. },
  521. loadData2(arg) {
  522. if (!this.url.detailList) {
  523. this.$message.error('请设置url.list2属性!')
  524. return
  525. }
  526. //加载数据 若传入参数1则加载第一页的内容
  527. if (arg === 1) {
  528. this.ipagination2.current = 1
  529. }
  530. if (this.currentRoleId === '') return
  531. // let params = this.getQueryParams2()//查询条件
  532. // params.orderId = this.currentRoleId
  533. let params = {
  534. orderId: this.currentRoleId
  535. }
  536. this.loading2 = true
  537. getAction(this.url.detailList, params).then((res) => {
  538. if (res.success) {
  539. this.dataSource2 = res.result.records
  540. this.ipagination2.total = res.result.total
  541. }
  542. this.loading2 = false
  543. })
  544. },
  545. getQueryParams2() {
  546. //获取查询条件
  547. let sqp = {}
  548. if (this.superQueryParams2) {
  549. sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
  550. sqp['superQueryMatchType'] = this.superQueryMatchType2
  551. }
  552. var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
  553. param.field = this.getQueryField2()
  554. param.pageNo = this.ipagination2.current
  555. param.pageSize = this.ipagination2.pageSize
  556. return filterObj(param)
  557. },
  558. handleEdit2: function(record) {
  559. this.$refs.modalForm2.title = '编辑'
  560. this.$refs.modalForm2.roleDisabled = true
  561. this.$refs.modalForm2.edit(record)
  562. },
  563. modalFormOk2() {
  564. // 新增/修改 成功时,重载列表
  565. this.loadData2()
  566. },
  567. }
  568. }
  569. </script>
  570. <style scoped>
  571. @import '~@assets/less/common.less';
  572. </style>