pickup_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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="mini" 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 @click="resetScreenForm">清空</el-button>
  39. <el-button 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="mini" 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="left" 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="left" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  62. <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="100" show-overflow-tooltip>
  63. <template slot-scope="scope">
  64. <CopyButton :copyText="scope.row.informationKey" />
  65. <span>{{scope.row.informationKey}}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="left" label="发货申请单号" prop="invoiceId" min-width="120" show-overflow-tooltip>
  69. <template slot-scope="scope">
  70. <CopyButton :copyText="scope.row.invoiceId" />
  71. <span>{{scope.row.invoiceId}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="left" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
  75. <template slot-scope="scope">
  76. {{ scope.row.pickTime | dateToDayFilter }}
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="left" label="提货时段" min-width="100" show-overflow-tooltip>
  80. <template slot-scope="scope">
  81. {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="left" label="提货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="left" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  86. <template slot-scope="scope">
  87. {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
  88. </template>
  89. </el-table-column>
  90. <el-table-column align="left" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
  91. <template slot-scope="scope">
  92. {{ scope.row.theTime | dateToDayFilter }}
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="160" show-overflow-tooltip>
  96. <template slot-scope="scope">
  97. <CopyButton :copyText="(scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId" />
  98. <span>{{ (scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="left" label="工程编号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  102. <template slot-scope="scope">
  103. <CopyButton :copyText="scope.row.enginOrderNo" />
  104. <span>{{scope.row.enginOrderNo}}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  108. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <CopyButton :copyText="scope.row.materialCode" />
  111. <span>{{scope.row.materialCode}}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. <CopyButton :copyText="scope.row.materialOldNumber" />
  117. <span>{{scope.row.materialOldNumber}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  121. <template slot-scope="scope">
  122. <CopyButton :copyText="scope.row.materialName" />
  123. <span>{{scope.row.materialName}}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  127. <template slot-scope="scope">
  128. <CopyButton :copyText="scope.row.specification" />
  129. <span>{{scope.row.specification}}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="left" label="提货总数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  133. <el-table-column align="left" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
  134. <el-table-column align="center" label="操作" width="100" fixed="right">
  135. <template slot-scope="scope">
  136. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)">编辑</el-button>
  137. <el-popconfirm
  138. style="margin-left: 10px;"
  139. :title="'确定' + (scope.row.printNum ? '作废' : '取消') +'吗?'"
  140. @onConfirm="handleCancel(scope.row.id)"
  141. v-if="$checkBtnRole('del', $route.meta.roles)" >
  142. <el-button slot="reference" type="text">{{scope.row.printNum ? '作废' : '取消'}}</el-button>
  143. </el-popconfirm>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. </div>
  148. </div>
  149. <div class="pagination clearfix">
  150. <div class="fr">
  151. <el-pagination
  152. @size-change="handleSizeChange"
  153. @current-change="handleCurrentChange"
  154. :current-page="currentPage"
  155. :page-sizes="[10, 20, 30, 50]"
  156. :page-size="10"
  157. layout="total, sizes, prev, pager, next, jumper"
  158. :total="listTotal">
  159. </el-pagination>
  160. </div>
  161. </div>
  162. </div>
  163. <PickupForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  164. </div>
  165. </template>
  166. <script>
  167. import { getPickupList, cancelData } from "@/api/supply/pickup";
  168. import PickupForm from "@/views/supply/pickup/components/pickup_form";
  169. export default {
  170. components: {
  171. PickupForm
  172. },
  173. data() {
  174. return {
  175. currentPage: 1, // 当前页码
  176. pageSize: 10, // 每页数量
  177. listTotal: 0, // 列表总数
  178. dataList: null, // 列表数据
  179. listLoading: false, // 列表加载loading
  180. screenForm: { // 筛选表单数据
  181. orderNum: '',
  182. applyName: '',
  183. warehouse: '',
  184. date: '',
  185. },
  186. queryItem: {},
  187. isShowForm: false,
  188. }
  189. },
  190. computed: {
  191. exParams() {
  192. return {
  193. invoiceId: this.screenForm.orderNum,
  194. createBy: this.screenForm.applyName,
  195. stockName: this.screenForm.warehouse,
  196. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  197. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  198. }
  199. },
  200. },
  201. created() {
  202. this.getList();
  203. },
  204. methods: {
  205. // 查询按钮权限
  206. checkBtnRole(value) {
  207. // let btnRole = this.$route.meta.roles;
  208. // if(!btnRole) {return true}
  209. // let index = btnRole.indexOf(value);
  210. // return index >= 0;
  211. return true
  212. },
  213. // 查询列表
  214. getList() {
  215. this.listLoading = true;
  216. let params = {
  217. pageNum: this.currentPage,
  218. pageSize: this.pageSize,
  219. invoiceId: this.screenForm.orderNum,
  220. createBy: this.screenForm.applyName,
  221. stockName: this.screenForm.warehouse,
  222. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  223. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  224. };
  225. getPickupList(params).then((res) => {
  226. this.dataList = res.data.records;
  227. this.listTotal = res.data.total;
  228. this.listLoading = false;
  229. })
  230. },
  231. // 提交筛选表单
  232. submitScreenForm() {
  233. this.currentPage = 1;
  234. this.getList();
  235. },
  236. // 重置筛选表单
  237. resetScreenForm() {
  238. this.$refs.screenForm.resetFields();
  239. this.currentPage = 1;
  240. this.getList();
  241. },
  242. // 更改每页数量
  243. handleSizeChange(val) {
  244. this.pageSize = val;
  245. this.currentPage = 1;
  246. this.getList();
  247. },
  248. // 更改当前页
  249. handleCurrentChange(val) {
  250. this.currentPage = val;
  251. this.getList();
  252. },
  253. // 进入表单
  254. toForm(item) {
  255. this.queryItem = item;
  256. this.isShowForm = true;
  257. },
  258. backList() {
  259. this.queryItem = {};
  260. this.isShowForm = false;
  261. },
  262. // 取消/作废
  263. handleCancel(id) {
  264. cancelData({id}).then(res => {
  265. this.$successMsg();
  266. this.getList();
  267. })
  268. },
  269. }
  270. }
  271. </script>
  272. <style lang="scss" scoped>
  273. </style>