deliver_list.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="90px" 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="model">
  30. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="6">
  34. <el-form-item label="发货日期" prop="date">
  35. <el-date-picker
  36. v-model="screenForm.date"
  37. type="datetimerange"
  38. range-separator="至"
  39. style="width: 100%;"
  40. value-format="yyyy-MM-dd HH:mm:ss"
  41. start-placeholder="开始日期"
  42. end-placeholder="结束日期">
  43. </el-date-picker>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="24" :lg="12" class="tr">
  47. <el-form-item label="">
  48. <el-button size="small" @click="resetScreenForm">清空</el-button>
  49. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. </div>
  55. <div class="mymain-container">
  56. <div class="btn-group clearfix">
  57. <div class="fr">
  58. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  59. </div>
  60. </div>
  61. <div class="table">
  62. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  63. <el-table-column align="center" label="发货单号" prop="shipOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
  64. <el-table-column align="center" label="发货日期" prop="shipTime" min-width="160" show-overflow-tooltip></el-table-column>
  65. <el-table-column align="center" label="仓库" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
  66. <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  67. <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
  68. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  69. <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
  70. <el-table-column align="center" label="无税金额" prop="price" min-width="100" show-overflow-tooltip>
  71. <template slot-scope="scope">
  72. {{ scope.row.number * scope.row.price }}
  73. </template>
  74. </el-table-column>
  75. <el-table-column align="center" label="无税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  76. <el-table-column align="center" label="数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
  78. <el-table-column align="center" label="操作" width="120" fixed="right">
  79. <template slot-scope="scope">
  80. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. </div>
  86. <div class="pagination clearfix">
  87. <div class="fr">
  88. <el-pagination
  89. @size-change="handleSizeChange"
  90. @current-change="handleCurrentChange"
  91. :current-page="currentPage"
  92. :page-sizes="[10, 20, 30, 50]"
  93. :page-size="10"
  94. layout="total, sizes, prev, pager, next, jumper"
  95. :total="listTotal">
  96. </el-pagination>
  97. </div>
  98. </div>
  99. </div>
  100. <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  101. </div>
  102. </template>
  103. <script>
  104. import { COMMON_SELECT } from '@/utils/select_data'
  105. import { getList } from "@/api/supply/deliver";
  106. import DeliverDetail from "@/views/supply/deliver/components/deliver_detail";
  107. export default {
  108. components: {
  109. DeliverDetail,
  110. },
  111. data() {
  112. return {
  113. currentPage: 1, // 当前页码
  114. pageSize: 10, // 每页数量
  115. listTotal: 0, // 列表总数
  116. dataList: null, // 列表数据
  117. listLoading: false, // 列表加载loading
  118. screenForm: { // 筛选表单数据
  119. orderNum: '',
  120. jxsNum: '',
  121. jxsName: '',
  122. chName: '',
  123. model: '',
  124. date: '',
  125. },
  126. queryItem: {},
  127. }
  128. },
  129. computed: {
  130. exParams() {
  131. return {
  132. retreatOrderNo: this.screenForm.orderNum,
  133. customerNumber: this.screenForm.jxsNum,
  134. customerName: this.screenForm.jxsName,
  135. productName: this.screenForm.chName,
  136. specification: this.screenForm.model,
  137. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  138. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  139. status: 1, // 1:发货单,2:工程发货单
  140. }
  141. },
  142. isShowDetail() {
  143. return this.queryItem.hasOwnProperty('id');
  144. },
  145. },
  146. created() {
  147. this.getList();
  148. },
  149. methods: {
  150. // 查询按钮权限
  151. checkBtnRole(value) {
  152. // let btnRole = this.$route.meta.roles;
  153. // if(!btnRole) {return true}
  154. // let index = btnRole.indexOf(value);
  155. // return index >= 0;
  156. return true
  157. },
  158. // 查询列表
  159. getList() {
  160. this.listLoading = true;
  161. let params = {
  162. pageNum: this.currentPage,
  163. pageSize: this.pageSize,
  164. retreatOrderNo: this.screenForm.orderNum,
  165. customerNumber: this.screenForm.jxsNum,
  166. customerName: this.screenForm.jxsName,
  167. productName: this.screenForm.chName,
  168. specification: this.screenForm.model,
  169. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  170. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  171. status: 1, // 1:发货单,2:工程发货单
  172. };
  173. getList(params).then((res) => {
  174. this.dataList = res.data.records;
  175. this.listTotal = res.data.total;
  176. this.listLoading = false;
  177. })
  178. },
  179. // 提交筛选表单
  180. submitScreenForm() {
  181. this.currentPage = 1;
  182. this.getList();
  183. },
  184. // 重置筛选表单
  185. resetScreenForm() {
  186. this.$refs.screenForm.resetFields();
  187. this.currentPage = 1;
  188. this.getList();
  189. },
  190. // 更改每页数量
  191. handleSizeChange(val) {
  192. this.pageSize = val;
  193. this.currentPage = 1;
  194. this.getList();
  195. },
  196. // 更改当前页
  197. handleCurrentChange(val) {
  198. this.currentPage = val;
  199. this.getList();
  200. },
  201. // 进入详情
  202. toDetail(item) {
  203. this.queryItem = item;
  204. },
  205. backList() {
  206. this.queryItem = {};
  207. },
  208. }
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. </style>