pickup_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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="80" 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="printTime" 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="materialCode" min-width="120" show-overflow-tooltip>
  69. <template slot-scope="scope">
  70. <CopyButton :copyText="scope.row.materialCode" />
  71. <span>{{scope.row.materialCode}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  75. <template slot-scope="scope">
  76. <CopyButton :copyText="scope.row.materialOldNumber" />
  77. <span>{{scope.row.materialOldNumber}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. <CopyButton :copyText="scope.row.materialName" />
  83. <span>{{scope.row.materialName}}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  87. <template slot-scope="scope">
  88. <CopyButton :copyText="scope.row.specification" />
  89. <span>{{scope.row.specification}}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column align="left" label="提货总数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="left" label="发货申请单号" prop="invoiceId" min-width="120" show-overflow-tooltip>
  94. <template slot-scope="scope">
  95. <CopyButton :copyText="scope.row.invoiceId" />
  96. <span>{{scope.row.invoiceId}}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  100. <template slot-scope="scope">
  101. <CopyButton :copyText="(scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId" />
  102. <span>{{ (scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  106. <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. <CopyButton :copyText="scope.row.enginOrderNo" />
  109. <span>{{scope.row.enginOrderNo}}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column align="left" label="预约日期" prop="pickTime" min-width="100" show-overflow-tooltip>
  113. <template slot-scope="scope">
  114. {{ scope.row.pickTime | dateToDayFilter }}
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="left" label="提货时段" min-width="100" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
  120. </template>
  121. </el-table-column>
  122. <el-table-column align="left" label="提货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
  123. <el-table-column align="left" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
  126. </template>
  127. </el-table-column>
  128. <el-table-column align="left" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
  129. <template slot-scope="scope">
  130. {{ scope.row.theTime | dateToDayFilter }}
  131. </template>
  132. </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) && !scope.row.printNum">编辑</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('cancel', $route.meta.roles) && ((isDealer && !scope.row.printNum) || !isDealer)" >
  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. isDealer() {
  192. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  193. },
  194. exParams() {
  195. return {
  196. invoiceId: this.screenForm.orderNum,
  197. createBy: this.screenForm.applyName,
  198. stockName: this.screenForm.warehouse,
  199. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  200. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  201. }
  202. },
  203. },
  204. created() {
  205. this.getList();
  206. },
  207. methods: {
  208. // 查询按钮权限
  209. checkBtnRole(value) {
  210. // let btnRole = this.$route.meta.roles;
  211. // if(!btnRole) {return true}
  212. // let index = btnRole.indexOf(value);
  213. // return index >= 0;
  214. return true
  215. },
  216. // 查询列表
  217. getList() {
  218. this.listLoading = true;
  219. let params = {
  220. pageNum: this.currentPage,
  221. pageSize: this.pageSize,
  222. invoiceId: this.screenForm.orderNum,
  223. createBy: this.screenForm.applyName,
  224. stockName: this.screenForm.warehouse,
  225. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
  226. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : '',
  227. };
  228. getPickupList(params).then((res) => {
  229. this.dataList = res.data.records;
  230. this.listTotal = res.data.total;
  231. this.listLoading = false;
  232. })
  233. },
  234. // 提交筛选表单
  235. submitScreenForm() {
  236. this.currentPage = 1;
  237. this.getList();
  238. },
  239. // 重置筛选表单
  240. resetScreenForm() {
  241. this.$refs.screenForm.resetFields();
  242. this.currentPage = 1;
  243. this.getList();
  244. },
  245. // 更改每页数量
  246. handleSizeChange(val) {
  247. this.pageSize = val;
  248. this.currentPage = 1;
  249. this.getList();
  250. },
  251. // 更改当前页
  252. handleCurrentChange(val) {
  253. this.currentPage = val;
  254. this.getList();
  255. },
  256. // 进入表单
  257. toForm(item) {
  258. this.queryItem = item;
  259. this.isShowForm = true;
  260. },
  261. backList() {
  262. this.queryItem = {};
  263. this.isShowForm = false;
  264. },
  265. // 取消/作废
  266. handleCancel(id) {
  267. cancelData({id}).then(res => {
  268. this.$successMsg();
  269. this.getList();
  270. })
  271. },
  272. }
  273. }
  274. </script>
  275. <style lang="scss" scoped>
  276. </style>