pickup_list.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!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="applyName">
  15. <el-input v-model="screenForm.applyName" 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="warehouse">
  20. <el-input v-model="screenForm.warehouse" 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="date">
  25. <el-date-picker
  26. v-model="screenForm.date"
  27. type="datetimerange"
  28. range-separator="至"
  29. style="width: 100%;"
  30. value-format="yyyy-MM-dd HH:mm:ss"
  31. start-placeholder="开始日期"
  32. end-placeholder="结束日期">
  33. </el-date-picker>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  37. <el-form-item label="">
  38. <el-button size="small" @click="resetScreenForm">清空</el-button>
  39. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. </el-form>
  44. </div>
  45. <div class="mymain-container">
  46. <div class="btn-group clearfix">
  47. <div class="fl">
  48. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
  49. </div>
  50. <div class="fr">
  51. <ExportButton :exUrl="'pick/export'" :exParams="exParams" />
  52. </div>
  53. </div>
  54. <div class="table">
  55. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  56. <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. {{ scope.row.printNum ? '已打单':'未打单' }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  62. <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="120" show-overflow-tooltip></el-table-column>
  63. <el-table-column align="center" label="发货申请单号" prop="invoiceId" min-width="120" show-overflow-tooltip></el-table-column>
  64. <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
  65. <template slot-scope="scope">
  66. {{ scope.row.pickTime | dateToDayFilter }}
  67. </template>
  68. </el-table-column>
  69. <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
  70. <template slot-scope="scope">
  71. {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="center" label="提货仓库" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
  75. <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  76. <template slot-scope="scope">
  77. {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
  78. </template>
  79. </el-table-column>
  80. <el-table-column align="center" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. {{ scope.row.theTime | dateToDayFilter }}
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="工程编号" prop="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" 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="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="操作" width="100" fixed="right">
  95. <template slot-scope="scope">
  96. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)">编辑</el-button>
  97. <el-popconfirm
  98. style="margin-left: 10px;"
  99. :title="'确定' + (scope.row.printNum ? '作废' : '取消') +'吗?'"
  100. @onConfirm="handleCancel(scope.row.id)"
  101. v-if="$checkBtnRole('del', $route.meta.roles)" >
  102. <el-button slot="reference" type="text">{{scope.row.printNum ? '作废' : '取消'}}</el-button>
  103. </el-popconfirm>
  104. </template>
  105. </el-table-column>
  106. </el-table>
  107. </div>
  108. </div>
  109. <div class="pagination clearfix">
  110. <div class="fr">
  111. <el-pagination
  112. @size-change="handleSizeChange"
  113. @current-change="handleCurrentChange"
  114. :current-page="currentPage"
  115. :page-sizes="[10, 20, 30, 50]"
  116. :page-size="10"
  117. layout="total, sizes, prev, pager, next, jumper"
  118. :total="listTotal">
  119. </el-pagination>
  120. </div>
  121. </div>
  122. </div>
  123. <PickupForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  124. </div>
  125. </template>
  126. <script>
  127. import { getPickupList, cancelData } from "@/api/supply/pickup";
  128. import PickupForm from "@/views/supply/pickup/components/pickup_form";
  129. export default {
  130. components: {
  131. PickupForm
  132. },
  133. data() {
  134. return {
  135. currentPage: 1, // 当前页码
  136. pageSize: 10, // 每页数量
  137. listTotal: 0, // 列表总数
  138. dataList: null, // 列表数据
  139. listLoading: false, // 列表加载loading
  140. screenForm: { // 筛选表单数据
  141. orderNum: '',
  142. applyName: '',
  143. warehouse: '',
  144. date: '',
  145. },
  146. queryItem: {},
  147. isShowForm: false,
  148. }
  149. },
  150. computed: {
  151. exParams() {
  152. return {
  153. invoiceId: this.screenForm.orderNum,
  154. createBy: this.screenForm.applyName,
  155. stockName: this.screenForm.warehouse,
  156. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  157. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  158. }
  159. },
  160. },
  161. created() {
  162. this.getList();
  163. },
  164. methods: {
  165. // 查询按钮权限
  166. checkBtnRole(value) {
  167. // let btnRole = this.$route.meta.roles;
  168. // if(!btnRole) {return true}
  169. // let index = btnRole.indexOf(value);
  170. // return index >= 0;
  171. return true
  172. },
  173. // 查询列表
  174. getList() {
  175. this.listLoading = true;
  176. let params = {
  177. pageNum: this.currentPage,
  178. pageSize: this.pageSize,
  179. invoiceId: this.screenForm.orderNum,
  180. createBy: this.screenForm.applyName,
  181. stockName: this.screenForm.warehouse,
  182. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  183. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  184. };
  185. getPickupList(params).then((res) => {
  186. this.dataList = res.data.records;
  187. this.listTotal = res.data.total;
  188. this.listLoading = false;
  189. })
  190. },
  191. // 提交筛选表单
  192. submitScreenForm() {
  193. this.currentPage = 1;
  194. this.getList();
  195. },
  196. // 重置筛选表单
  197. resetScreenForm() {
  198. this.$refs.screenForm.resetFields();
  199. this.currentPage = 1;
  200. this.getList();
  201. },
  202. // 更改每页数量
  203. handleSizeChange(val) {
  204. this.pageSize = val;
  205. this.currentPage = 1;
  206. this.getList();
  207. },
  208. // 更改当前页
  209. handleCurrentChange(val) {
  210. this.currentPage = val;
  211. this.getList();
  212. },
  213. // 进入表单
  214. toForm(item) {
  215. this.queryItem = item;
  216. this.isShowForm = true;
  217. },
  218. backList() {
  219. this.queryItem = {};
  220. this.isShowForm = false;
  221. },
  222. // 取消/作废
  223. handleCancel(id) {
  224. cancelData({id}).then(res => {
  225. this.$successMsg();
  226. this.getList();
  227. })
  228. },
  229. }
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. </style>