implement_list.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :optionsEvensGroup="optionsEvensGroup"
  7. :columnParsing="columnParsing"
  8. :tableAttributes="tableAttributes"
  9. :tableEvents="tableEvents"
  10. >
  11. <div slot="moreSearch">
  12. <el-radio-group @change="changeType" size="mini" v-model="radioType">
  13. <el-radio-button label="政策零售订单"></el-radio-button>
  14. <el-radio-button label="零售订单"></el-radio-button>
  15. <el-radio-button label="家用工程订单"></el-radio-button>
  16. <el-radio-button label="商用工程订单"></el-radio-button>
  17. </el-radio-group>
  18. <br /><br />
  19. </div>
  20. <Popu v-if="isShowDisplaceDetail">
  21. <DisplaceDetail :listItem="queryItem" @backListFormDetail="backList" />
  22. </Popu>
  23. </template-page>
  24. </template>
  25. <script>
  26. import TemplatePage from '@/components/template/template-page-1.vue'
  27. import Popu from '@/components/template/popu.vue'
  28. import {
  29. getList,
  30. retailExecRetailV2,
  31. retailExecRetailV2Export,
  32. retailExecPolicyListV2,
  33. retailExecPolicyListV2Export,
  34. retailExecEnginListV2,
  35. retailExecEnginListV2Export
  36. } from '@/api/supply/implement'
  37. import { getCategoryList } from '@/api/common'
  38. import DisplaceDetail from '@/views/supply/implement/components/displace_detail'
  39. import { getNoRebateWalletList } from '@/api/policy_list'
  40. let that
  41. export default {
  42. components: {
  43. DisplaceDetail,
  44. TemplatePage,
  45. Popu
  46. },
  47. filters: {
  48. statusFilter(val) {
  49. if (that.statusList.length) {
  50. let obj = that.statusList.find(o => o.value == val)
  51. return obj ? obj.label : ''
  52. }
  53. return ''
  54. }
  55. },
  56. data() {
  57. return {
  58. radioType: '政策零售订单',
  59. // 事件组合
  60. optionsEvensGroup: [],
  61. // 表格属性
  62. tableAttributes: {
  63. // 启用勾选列
  64. selectColumn: false
  65. },
  66. // 表格事件
  67. tableEvents: {
  68. 'selection-change': this.selectionChange
  69. },
  70. recordSelected: [],
  71. currentPage: 1, // 当前页码
  72. pageSize: 10, // 每页数量
  73. listTotal: 0, // 列表总数
  74. dataList: null, // 列表数据
  75. listLoading: false, // 列表加载loading
  76. screenForm: {
  77. // 筛选表单数据
  78. status: '2',
  79. goodsCode: '',
  80. saleNum: '',
  81. dealer: '',
  82. goodsName: '',
  83. model: '',
  84. date: [],
  85. serviceName: '',
  86. itemServiceName: '',
  87. newServiceName: '',
  88. enginName: '',
  89. loginNum: '',
  90. k3CategoryNumber: [],
  91. policyCode: '',
  92. policyRemark: '',
  93. isOver: '',
  94. walletIds1: [],
  95. orderDate: []
  96. },
  97. categoryList: [],
  98. statusList: [
  99. { label: '政策零售订单', value: '2' },
  100. { label: '零售订单', value: '1' },
  101. { label: '家用工程订单', value: 'HOME' },
  102. { label: '商用工程订单', value: 'TRADE' }
  103. ],
  104. isCollapse: true,
  105. queryItem: {},
  106. isShowDisplaceDetail: false,
  107. NoRebateWalletList: []
  108. }
  109. },
  110. computed: {
  111. exParams() {
  112. return {
  113. type: this.screenForm.status,
  114. materialOldNumber: this.screenForm.goodsCode,
  115. id: this.screenForm.saleNum,
  116. customerName: this.screenForm.dealer,
  117. materialName: this.screenForm.goodsName,
  118. specification: this.screenForm.model,
  119. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  120. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  121. orderStartTime: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
  122. orderEndTime: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
  123. serviceName: this.screenForm.serviceName,
  124. newServiceName: this.screenForm.newServiceName,
  125. itemServiceName: this.screenForm.itemServiceName,
  126. projectName: this.screenForm.enginName,
  127. enginRecordNo: this.screenForm.loginNum,
  128. k3CategoryNumber: this.screenForm.k3CategoryNumber.join(','),
  129. policyCode: this.screenForm.policyCode,
  130. policyRemark: this.screenForm.policyRemark,
  131. isOver: this.screenForm.isOver,
  132. walletIds1: this.screenForm.walletIds1.join(','),
  133. isDisplaceOrder: this.screenForm.isDisplaceOrder
  134. }
  135. }
  136. },
  137. beforeCreate() {
  138. that = this
  139. },
  140. created() {
  141. // this.getList()
  142. // this.getCategoryList()
  143. },
  144. methods: {
  145. changeType() {
  146. this.$refs.pageRef.refreshList()
  147. },
  148. // 列表请求函数
  149. getList(...p) {
  150. this.$refs.pageRef.showTable = false
  151. if (this.radioType === '政策零售订单') {
  152. return retailExecPolicyListV2(...p)
  153. }
  154. if (this.radioType === '零售订单') {
  155. return retailExecRetailV2(...p)
  156. }
  157. if (this.radioType === '家用工程订单') {
  158. let params = {
  159. ...p[0],
  160. enginOrderType: 'HOME'
  161. }
  162. return retailExecEnginListV2(params)
  163. }
  164. if (this.radioType === '商用工程订单') {
  165. let params = {
  166. ...p[0],
  167. enginOrderType: 'TRADE'
  168. }
  169. return retailExecEnginListV2(params)
  170. }
  171. },
  172. // 列表导出函数
  173. exportList(...p) {
  174. if (this.radioType === '政策零售订单') {
  175. return retailExecPolicyListV2Export()
  176. }
  177. if (this.radioType === '零售订单') {
  178. return retailExecRetailV2Export()
  179. }
  180. if (this.radioType === '家用工程订单') {
  181. let params = {
  182. ...p[0],
  183. enginOrderType: 'HOME'
  184. }
  185. return retailExecEnginListV2Export(params)
  186. }
  187. if (this.radioType === '商用工程订单') {
  188. let params = {
  189. ...p[0],
  190. enginOrderType: 'TRADE'
  191. }
  192. return retailExecEnginListV2Export(params)
  193. }
  194. },
  195. // 表格列解析渲染数据更改
  196. columnParsing(item, defaultData) {
  197. if (item.colName === 'is_displace_order') {
  198. defaultData.render = (h, { row, index, column }) => {
  199. return (
  200. <div
  201. onClick={() => {
  202. console.log(11111)
  203. this.openDisplaceDetail(row)
  204. }}
  205. style="display: flex;justify-content: center;align-items: center;"
  206. >
  207. {row.isDisplaceOrder === '是' ? (
  208. <el-tag size="mini" type="warning">
  209. 置换
  210. </el-tag>
  211. ) : null}
  212. </div>
  213. )
  214. }
  215. }
  216. return defaultData
  217. },
  218. // 监听勾选变化
  219. selectionChange(data) {
  220. this.recordSelected = data
  221. },
  222. operation() {
  223. return (h, { row, index, column }) => {
  224. return (
  225. <div class="operation-btns">
  226. <el-button size="mini" type="text" onClick={async () => {}}>
  227. 查看
  228. </el-button>
  229. </div>
  230. )
  231. }
  232. },
  233. // 查询列表
  234. // getList() {
  235. // this.listLoading = true
  236. // let params = {
  237. // pageNum: this.currentPage,
  238. // pageSize: this.pageSize,
  239. // type: this.screenForm.status,
  240. // materialOldNumber: this.screenForm.goodsCode,
  241. // id: this.screenForm.saleNum,
  242. // customerName: this.screenForm.dealer,
  243. // materialName: this.screenForm.goodsName,
  244. // specification: this.screenForm.model,
  245. // startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  246. // endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  247. // orderStartTime: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
  248. // orderEndTime: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
  249. // serviceName: this.screenForm.serviceName,
  250. // newServiceName: this.screenForm.newServiceName,
  251. // itemServiceName: this.screenForm.itemServiceName,
  252. // projectName: this.screenForm.enginName,
  253. // enginRecordNo: this.screenForm.loginNum,
  254. // k3CategoryNumber: this.screenForm.k3CategoryNumber.join(','),
  255. // policyCode: this.screenForm.policyCode,
  256. // policyRemark: this.screenForm.policyRemark,
  257. // isOver: this.screenForm.isOver,
  258. // walletIds1: this.screenForm.walletIds1.join(','),
  259. // isDisplaceOrder: this.screenForm.isDisplaceOrder
  260. // }
  261. // getList(params).then(res => {
  262. // res.data.records.forEach(item => {
  263. // item.sums1 = ['refundableQty', 'qty', 'retiredQty', 'hasSendQty', 'directTransferQty', 'refundProductQty']
  264. // item.sums2 = ['payAmount', 'payRebateAmount', 'hasSendAmount', 'retiredAmount', 'refundProductAmount']
  265. // })
  266. // this.dataList = res.data.records
  267. // this.listTotal = res.data.total
  268. // this.listLoading = false
  269. // })
  270. // },
  271. // 获取存货类别列表
  272. getCategoryList() {
  273. getCategoryList({
  274. pageNum: 1,
  275. pageSize: -1,
  276. keyword: ''
  277. }).then(res => {
  278. this.categoryList = res.data.records
  279. })
  280. getNoRebateWalletList({
  281. walletName: ''
  282. }).then(res => {
  283. console.log(res)
  284. this.NoRebateWalletList = res.data
  285. })
  286. },
  287. // 提交筛选表单
  288. submitScreenForm() {
  289. this.currentPage = 1
  290. this.getList()
  291. },
  292. // 重置筛选表单
  293. resetScreenForm() {
  294. this.$refs.screenForm.resetFields()
  295. this.currentPage = 1
  296. this.getList()
  297. },
  298. // 更改每页数量
  299. handleSizeChange(val) {
  300. this.pageSize = val
  301. this.currentPage = 1
  302. this.getList()
  303. },
  304. // 更改当前页
  305. handleCurrentChange(val) {
  306. this.currentPage = val
  307. this.getList()
  308. },
  309. // 置换详情
  310. openDisplaceDetail(item) {
  311. this.queryItem = item
  312. this.isShowDisplaceDetail = true
  313. },
  314. backList() {
  315. this.queryItem = {}
  316. this.isShowDisplaceDetail = false
  317. }
  318. }
  319. }
  320. </script>
  321. <style lang="scss" scoped></style>