displace_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="12" :lg="6">
  9. <el-form-item label="订单号" prop="orderNum">
  10. <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="原订单号" prop="originOrderNo">
  15. <el-input v-model="screenForm.originOrderNo" placeholder="请输入原订单号"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="经销商名称" prop="customerKeyword">
  20. <el-input v-model="screenForm.customerKeyword" placeholder="请输入经销商名称"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="产品名称" prop="productName">
  25. <el-input v-model="screenForm.productName" placeholder="请输入产品名称"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="订单日期" prop="date">
  30. <el-date-picker
  31. v-model="screenForm.date"
  32. type="datetimerange"
  33. range-separator="至"
  34. style="width: 100%;"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期">
  38. </el-date-picker>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="申请人" prop="createName">
  43. <el-input v-model="screenForm.createName" placeholder="请输入申请人"></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="审核人" prop="confirmName">
  48. <el-input v-model="screenForm.confirmName" placeholder="请输入审核人"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="订单类型" prop="orderType">
  53. <el-select v-model="screenForm.orderType" placeholder="选择订单类型" style="width: 100%">
  54. <el-option label="全部" value="" />
  55. <el-option v-for="item in orderType" :key="item.val" :label="item.label" :value="item.val"></el-option>
  56. </el-select>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  60. <el-form-item label="">
  61. <el-button size="small" @click="resetScreenForm">清空</el-button>
  62. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. </el-form>
  67. </div>
  68. <div class="mymain-container">
  69. <div class="btn-group clearfix">
  70. <div class="fl">
  71. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  72. </div>
  73. <div class="fr">
  74. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  75. </div>
  76. </div>
  77. <div class="table">
  78. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  79. <el-table-column align="center" label="订单号" prop="displaceOrderId" min-width="160" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
  81. <el-table-column align="center" label="原订单号" prop="orderNo" min-width="160" show-overflow-tooltip></el-table-column>
  82. <el-table-column align="center" label="订单类型" min-width="160" show-overflow-tooltip>
  83. <template slot-scope="{ row }">
  84. {{ findOrderType(row.orderType) }}
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="center" label="经销商编号" prop="customerId" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="业务员" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="申请人" prop="createName" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="申请日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="审核人" prop="confirmName" min-width="160" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="审核状态" min-width="100" show-overflow-tooltip>
  98. <template slot-scope="{ row }">
  99. {{ findExamineStatus(row.examineStatus) }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" label="操作" width="160" fixed="right">
  103. <template slot-scope="scope">
  104. <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.displaceOrderId)" v-if="scope.row.examineStatus === 'WAIT'" >
  105. <el-button slot="reference" type="text">撤回</el-button>
  106. </el-popconfirm>
  107. <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
  108. <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
  109. <el-button type="text" @click="toReturn(scope.row)" v-if="scope.row.examineStatus === 'OK'">退订</el-button>
  110. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  111. <el-popconfirm style="margin-left: 10px;" title="确定提审吗?" @onConfirm="handleSubmit(scope.row.displaceOrderId)" v-if="scope.row.examineStatus === 'SAVE'" >
  112. <el-button slot="reference" type="text">提审</el-button>
  113. </el-popconfirm>
  114. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.displaceOrderId)" >
  115. <el-button slot="reference" type="text">删除</el-button>
  116. </el-popconfirm>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. </div>
  121. </div>
  122. <div class="pagination clearfix">
  123. <div class="fr">
  124. <el-pagination
  125. @size-change="handleSizeChange"
  126. @current-change="handleCurrentChange"
  127. :current-page="currentPage"
  128. :page-sizes="[10, 20, 30, 50]"
  129. :page-size="10"
  130. layout="total, sizes, prev, pager, next, jumper"
  131. :total="listTotal">
  132. </el-pagination>
  133. </div>
  134. </div>
  135. </div>
  136. <DisplaceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  137. <DisplaceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  138. <DisplaceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  139. <DisplaceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
  140. </div>
  141. </template>
  142. <script>
  143. import {deleteOrder, getList, revokeOrder, submitData} from "@/api/supply/displace";
  144. import DisplaceDetail from "@/views/supply/displace/components/displace_detail";
  145. import DisplaceForm from "@/views/supply/displace/components/displace_form";
  146. import DisplaceExamine from "@/views/supply/displace/components/displace_examine";
  147. import DisplaceReturn from "@/views/supply/displace/components/displace_return";
  148. export default {
  149. components: {
  150. DisplaceDetail,
  151. DisplaceForm,
  152. DisplaceExamine,
  153. DisplaceReturn
  154. },
  155. data() {
  156. return {
  157. currentPage: 1, // 当前页码
  158. pageSize: 10, // 每页数量
  159. listTotal: 0, // 列表总数
  160. dataList: null, // 列表数据
  161. listLoading: false, // 列表加载loading
  162. screenForm: { // 筛选表单数据
  163. orderNum: '',
  164. originOrderNo: '',
  165. customerKeyword: '',
  166. productName: '',
  167. date: '',
  168. createName: '',
  169. confirmName: '',
  170. orderType: '',
  171. },
  172. queryItem: {},
  173. isShowDetail: false,
  174. isShowForm: false,
  175. isShowExamine: false,
  176. isShowReturn: false,
  177. orderType : [
  178. { label: '商用工程', val: 'TRADE'},
  179. { label: '家用工程', val: 'HOME'},
  180. { label: '零售订单', val: 'RETAIL'},
  181. { label: '销售政策单', val: 'RETAIL_POLICY'}
  182. ],
  183. examineStatus : [
  184. { label: '保存', val: 'SAVE'},
  185. { label: '待审核', val: 'WAIT'},
  186. { label: '通过', val: 'OK'},
  187. { label: '不通过', val: 'FAIL'},
  188. { label: '关闭', val: 'CLOSE'}
  189. ],
  190. }
  191. },
  192. computed: {
  193. exParams() {
  194. return {
  195. retreatOrderNo: this.screenForm.orderNum,
  196. customerKeyword: this.screenForm.jxsNum,
  197. productName: this.screenForm.chName,
  198. specification: this.screenForm.model,
  199. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  200. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  201. status: 1, // 1:退货单,2:电商退货单
  202. }
  203. }
  204. },
  205. created() {
  206. this.getList();
  207. },
  208. methods: {
  209. // 查询按钮权限
  210. checkBtnRole(value) {
  211. // let btnRole = this.$route.meta.roles;
  212. // if(!btnRole) {return true}
  213. // let index = btnRole.indexOf(value);
  214. // return index >= 0;
  215. return true
  216. },
  217. // 查询列表
  218. getList() {
  219. this.listLoading = true;
  220. let params = {
  221. pageNum: this.currentPage,
  222. pageSize: this.pageSize,
  223. displaceOrderId: this.screenForm.orderNum,
  224. originOrderNo: this.screenForm.originOrderNo,
  225. customerKeyword: this.screenForm.customerKeyword,
  226. productName: this.screenForm.productName,
  227. createName: this.screenForm.createName,
  228. confirmName: this.screenForm.confirmName,
  229. orderType: this.screenForm.orderType,
  230. startOrderTime: this.screenForm.date ? this.screenForm.date[0] : '',
  231. endOrderTime: this.screenForm.date ? this.screenForm.date[1] : ''
  232. };
  233. getList(params).then((res) => {
  234. this.dataList = res.data.records;
  235. this.listTotal = res.data.total;
  236. this.listLoading = false;
  237. })
  238. },
  239. // 提交筛选表单
  240. submitScreenForm() {
  241. this.currentPage = 1;
  242. this.getList();
  243. },
  244. // 重置筛选表单
  245. resetScreenForm() {
  246. this.$refs.screenForm.resetFields();
  247. this.currentPage = 1;
  248. this.getList();
  249. },
  250. // 更改每页数量
  251. handleSizeChange(val) {
  252. this.pageSize = val;
  253. this.currentPage = 1;
  254. this.getList();
  255. },
  256. // 更改当前页
  257. handleCurrentChange(val) {
  258. this.currentPage = val;
  259. this.getList();
  260. },
  261. // 进入表单
  262. toForm(item) {
  263. this.queryItem = item;
  264. this.isShowForm = true;
  265. },
  266. // 进入审批
  267. toExamine(item) {
  268. this.queryItem = item;
  269. this.isShowExamine = true;
  270. },
  271. // 进入详情
  272. toDetail(item) {
  273. this.queryItem = item;
  274. this.isShowDetail = true;
  275. },
  276. // 进入退订
  277. toReturn(item) {
  278. this.queryItem = item;
  279. this.isShowReturn = true;
  280. },
  281. backList() {
  282. this.queryItem = {};
  283. this.isShowDetail = false;
  284. this.isShowForm = false;
  285. this.isShowExamine = false;
  286. this.isShowReturn = false;
  287. },
  288. handleSubmit(id) {
  289. submitData({id}).then(res => {
  290. this.$successMsg();
  291. this.getList();
  292. })
  293. },
  294. // 撤回
  295. handleWithdraw(id) {
  296. revokeOrder({id}).then(res => {
  297. this.$successMsg();
  298. this.getList();
  299. })
  300. },
  301. // 删除
  302. handleDelete(id) {
  303. deleteOrder({ids: id}).then(res => {
  304. this.$successMsg();
  305. this.getList();
  306. })
  307. },
  308. // 批量删除
  309. batchDelete() {
  310. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  311. confirmButtonText: '确定',
  312. cancelButtonText: '取消',
  313. type: 'warning'
  314. }).then(() => {
  315. let ids = this.multipleSelection.map(item => {
  316. return item.parentId;
  317. });
  318. deleteOrder({ids: ids.join(',')}).then(res => {
  319. this.$successMsg();
  320. this.getList();
  321. })
  322. }).catch(() => {});
  323. },
  324. findOrderType(val) {
  325. const obj = this.orderType.find((value) => value.val === val)
  326. return obj ? obj.label : ''
  327. },
  328. findExamineStatus(val) {
  329. const obj = this.examineStatus.find((value) => value.val === val)
  330. return obj ? obj.label : ''
  331. }
  332. }
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. </style>