displace_list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm">
  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="jxsNum">
  15. <el-input v-model="screenForm.jxsNum" 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="jxsName">
  20. <el-input v-model="screenForm.jxsName" 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="chName">
  25. <el-input v-model="screenForm.chName" 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="sqMan">
  43. <el-input v-model="screenForm.sqMan" 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="shMan">
  48. <el-input v-model="screenForm.shMan" 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="shMan">
  53. <el-input v-model="screenForm.shMan" placeholder="请输入销售订单类型"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  57. <el-form-item label="">
  58. <el-button size="small" @click="resetScreenForm">清空</el-button>
  59. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. </el-form>
  64. </div>
  65. <div class="mymain-container">
  66. <div class="btn-group clearfix">
  67. <div class="fl">
  68. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  69. </div>
  70. <div class="fr">
  71. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  72. </div>
  73. </div>
  74. <div class="table">
  75. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  76. <el-table-column align="center" label="订单号" prop="retreatOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="center" label="订单日期" prop="retreatTime" min-width="160" show-overflow-tooltip></el-table-column>
  78. <el-table-column align="center" label="原订单号" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
  79. <el-table-column align="center" label="订单类型" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="经销商编号" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
  81. <el-table-column align="center" label="经销商名称" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  82. <el-table-column align="center" label="产品编码" prop="totalPrice" min-width="160" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="产品名称" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
  84. <el-table-column align="center" label="规格型号" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="业务员" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="申请人" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="申请日期" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="审核人" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="审核日期" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="审核状态" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="操作" width="160" fixed="right">
  92. <template slot-scope="scope">
  93. <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
  94. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  95. <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
  96. <el-button slot="reference" type="text">删除</el-button>
  97. </el-popconfirm>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. </div>
  102. </div>
  103. <div class="pagination clearfix">
  104. <div class="fr">
  105. <el-pagination
  106. @size-change="handleSizeChange"
  107. @current-change="handleCurrentChange"
  108. :current-page="currentPage"
  109. :page-sizes="[10, 20, 30, 50]"
  110. :page-size="10"
  111. layout="total, sizes, prev, pager, next, jumper"
  112. :total="listTotal">
  113. </el-pagination>
  114. </div>
  115. </div>
  116. </div>
  117. <DisplaceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  118. <DisplaceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  119. </div>
  120. </template>
  121. <script>
  122. import { getList } from "@/api/supply/displace";
  123. import DisplaceDetail from "@/views/supply/displace/components/displace_detail";
  124. import DisplaceForm from "@/views/supply/displace/components/displace_form";
  125. export default {
  126. components: {
  127. DisplaceDetail,
  128. DisplaceForm,
  129. },
  130. data() {
  131. return {
  132. currentPage: 1, // 当前页码
  133. pageSize: 10, // 每页数量
  134. listTotal: 0, // 列表总数
  135. dataList: null, // 列表数据
  136. listLoading: false, // 列表加载loading
  137. screenForm: { // 筛选表单数据
  138. orderNum: '',
  139. jxsNum: '',
  140. jxsName: '',
  141. chName: '',
  142. model: '',
  143. date: '',
  144. },
  145. queryItem: {},
  146. isShowDetail: false,
  147. isShowForm: false,
  148. }
  149. },
  150. computed: {
  151. exParams() {
  152. return {
  153. retreatOrderNo: this.screenForm.orderNum,
  154. customerNumber: this.screenForm.jxsNum,
  155. customerName: this.screenForm.jxsName,
  156. productName: this.screenForm.chName,
  157. specification: this.screenForm.model,
  158. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  159. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  160. status: 1, // 1:退货单,2:电商退货单
  161. }
  162. },
  163. },
  164. created() {
  165. this.getList();
  166. },
  167. methods: {
  168. // 查询按钮权限
  169. checkBtnRole(value) {
  170. // let btnRole = this.$route.meta.roles;
  171. // if(!btnRole) {return true}
  172. // let index = btnRole.indexOf(value);
  173. // return index >= 0;
  174. return true
  175. },
  176. // 查询列表
  177. getList() {
  178. this.listLoading = true;
  179. let params = {
  180. pageNum: this.currentPage,
  181. pageSize: this.pageSize,
  182. retreatOrderNo: this.screenForm.orderNum,
  183. customerNumber: this.screenForm.jxsNum,
  184. customerName: this.screenForm.jxsName,
  185. productName: this.screenForm.chName,
  186. specification: this.screenForm.model,
  187. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  188. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  189. status: 1, // 1:退货单,2:电商退货单
  190. };
  191. getList(params).then((res) => {
  192. this.dataList = res.data.records;
  193. this.listTotal = res.data.total;
  194. this.listLoading = false;
  195. })
  196. },
  197. // 提交筛选表单
  198. submitScreenForm() {
  199. this.currentPage = 1;
  200. this.getList();
  201. },
  202. // 重置筛选表单
  203. resetScreenForm() {
  204. this.$refs.screenForm.resetFields();
  205. this.currentPage = 1;
  206. this.getList();
  207. },
  208. // 更改每页数量
  209. handleSizeChange(val) {
  210. this.pageSize = val;
  211. this.currentPage = 1;
  212. this.getList();
  213. },
  214. // 更改当前页
  215. handleCurrentChange(val) {
  216. this.currentPage = val;
  217. this.getList();
  218. },
  219. // 进入表单
  220. toForm(item) {
  221. this.queryItem = item;
  222. this.isShowForm = true;
  223. },
  224. // 进入详情
  225. toDetail(item) {
  226. this.queryItem = item;
  227. this.isShowDetail = true;
  228. },
  229. backList() {
  230. this.queryItem = {};
  231. this.isShowDetail = false;
  232. this.isShowForm = false;
  233. },
  234. handleDelete(id) {
  235. }
  236. }
  237. }
  238. </script>
  239. <style lang="scss" scoped>
  240. </style>