pickup_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form
  7. ref="screenForm"
  8. :model="screenForm"
  9. label-width="100px"
  10. size="mini"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="申请发货单号" prop="orderNum">
  16. <el-input
  17. v-model="screenForm.orderNum"
  18. placeholder="请输入申请发货单号"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="申请人" prop="applyName">
  24. <el-input
  25. v-model="screenForm.applyName"
  26. placeholder="请输入申请人"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="提货仓库" prop="warehouse">
  32. <el-input
  33. v-model="screenForm.warehouse"
  34. placeholder="请输入提货仓库"
  35. ></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item label="提货日期" prop="date">
  40. <el-date-picker
  41. v-model="screenForm.date"
  42. type="datetimerange"
  43. range-separator="至"
  44. style="width: 100%"
  45. value-format="yyyy-MM-dd HH:mm:ss"
  46. start-placeholder="开始日期"
  47. end-placeholder="结束日期"
  48. >
  49. </el-date-picker>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  53. <el-form-item label="">
  54. <el-button @click="resetScreenForm">清空</el-button>
  55. <el-button type="primary" @click="submitScreenForm"
  56. >搜索</el-button
  57. >
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. </el-form>
  62. </div>
  63. <div class="mymain-container">
  64. <div class="btn-group clearfix">
  65. <div class="fl">
  66. <el-button
  67. size="mini"
  68. type="primary"
  69. icon="el-icon-plus"
  70. @click="toForm()"
  71. v-if="$checkBtnRole('add', $route.meta.roles)"
  72. >新增</el-button
  73. >
  74. </div>
  75. <div class="fr">
  76. <ExportButton :exUrl="'pick/export'" :exParams="exParams" />
  77. </div>
  78. </div>
  79. <div class="table">
  80. <el-table
  81. v-loading="listLoading"
  82. :data="dataList"
  83. element-loading-text="Loading"
  84. border
  85. fit
  86. highlight-current-row
  87. stripe
  88. >
  89. <el-table-column
  90. align="left"
  91. label="状态"
  92. min-width="80"
  93. show-overflow-tooltip
  94. >
  95. <template slot-scope="scope">
  96. {{ scope.row.printNum ? "已打单" : "未打单" }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column
  100. align="left"
  101. label="打单日期"
  102. prop="printTime"
  103. min-width="160"
  104. show-overflow-tooltip
  105. ></el-table-column>
  106. <el-table-column
  107. align="left"
  108. label="信息密钥"
  109. prop="informationKey"
  110. min-width="100"
  111. show-overflow-tooltip
  112. >
  113. <template slot-scope="scope">
  114. <CopyButton :copyText="scope.row.informationKey" />
  115. <span>{{ scope.row.informationKey }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. align="left"
  120. label="物料编码"
  121. prop="materialCode"
  122. min-width="120"
  123. show-overflow-tooltip
  124. >
  125. <template slot-scope="scope">
  126. <CopyButton :copyText="scope.row.materialCode" />
  127. <span>{{ scope.row.materialCode }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column
  131. align="left"
  132. label="产品编码"
  133. prop="materialOldNumber"
  134. min-width="140"
  135. show-overflow-tooltip
  136. >
  137. <template slot-scope="scope">
  138. <CopyButton :copyText="scope.row.materialOldNumber" />
  139. <span>{{ scope.row.materialOldNumber }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column
  143. align="left"
  144. label="产品名称"
  145. prop="materialName"
  146. min-width="160"
  147. show-overflow-tooltip
  148. >
  149. <template slot-scope="scope">
  150. <CopyButton :copyText="scope.row.materialName" />
  151. <span>{{ scope.row.materialName }}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column
  155. align="left"
  156. label="规格型号"
  157. prop="specification"
  158. min-width="350"
  159. show-overflow-tooltip
  160. >
  161. <template slot-scope="scope">
  162. <CopyButton :copyText="scope.row.specification" />
  163. <span>{{ scope.row.specification }}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column
  167. align="left"
  168. label="提货总数量"
  169. prop="refundableQty"
  170. min-width="100"
  171. show-overflow-tooltip
  172. ></el-table-column>
  173. <el-table-column
  174. align="left"
  175. label="发货申请单号"
  176. prop="invoiceId"
  177. min-width="120"
  178. show-overflow-tooltip
  179. >
  180. <template slot-scope="scope">
  181. <CopyButton :copyText="scope.row.invoiceId" />
  182. <span>{{ scope.row.invoiceId }}</span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. align="left"
  187. label="销售订单号"
  188. prop="mainOrderId"
  189. min-width="140"
  190. show-overflow-tooltip
  191. >
  192. <template slot-scope="scope">
  193. <CopyButton :copyText='scope.row.orderType === "TRADE" ||
  194. scope.row.orderType === "HOME" || scope.row.orderType
  195. ==="REQUISITION_TRADE" || scope.row.orderType
  196. ==="REQUISITION_HOME"? scope.row.enginOrderNo:scope.row.mainOrderId' />
  197. <span>{{
  198. scope.row.orderType === "TRADE" ||
  199. scope.row.orderType === "HOME" ||
  200. scope.row.orderType === "REQUISITION_TRADE" ||
  201. scope.row.orderType === "REQUISITION_HOME"
  202. ? scope.row.enginOrderNo
  203. : scope.row.mainOrderId
  204. }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. align="left"
  209. label="销售类型"
  210. prop="saleTypeName"
  211. min-width="100"
  212. show-overflow-tooltip
  213. ></el-table-column>
  214. <el-table-column
  215. align="left"
  216. label="工程订单号"
  217. prop="enginOrderNo"
  218. min-width="140"
  219. show-overflow-tooltip
  220. >
  221. <template slot-scope="scope">
  222. <CopyButton :copyText="scope.row.enginOrderNo" />
  223. <span>{{ scope.row.enginOrderNo }}</span>
  224. </template>
  225. </el-table-column>
  226. <el-table-column
  227. align="left"
  228. label="预约日期"
  229. prop="pickTime"
  230. min-width="100"
  231. show-overflow-tooltip
  232. >
  233. <template slot-scope="scope">
  234. {{ scope.row.pickTime | dateToDayFilter }}
  235. </template>
  236. </el-table-column>
  237. <el-table-column
  238. align="left"
  239. label="提货时段"
  240. min-width="100"
  241. show-overflow-tooltip
  242. >
  243. <template slot-scope="scope">
  244. {{ scope.row.pickStatus == "1" ? "上午" : "下午" }}
  245. </template>
  246. </el-table-column>
  247. <el-table-column
  248. align="left"
  249. label="提货仓库"
  250. prop="correspondName"
  251. min-width="100"
  252. show-overflow-tooltip
  253. ></el-table-column>
  254. <el-table-column
  255. align="left"
  256. label="提货方式"
  257. prop="pickType"
  258. min-width="100"
  259. show-overflow-tooltip
  260. >
  261. <template slot-scope="scope">
  262. {{ scope.row.pickType == "1" ? "自提" : "物流快递" }}
  263. </template>
  264. </el-table-column>
  265. <el-table-column
  266. align="left"
  267. label="单据日期"
  268. prop="theTime"
  269. min-width="120"
  270. show-overflow-tooltip
  271. >
  272. <template slot-scope="scope">
  273. {{ scope.row.theTime | dateToDayFilter }}
  274. </template>
  275. </el-table-column>
  276. <el-table-column
  277. align="left"
  278. label="备注"
  279. prop="remark"
  280. min-width="100"
  281. show-overflow-tooltip
  282. ></el-table-column>
  283. <el-table-column
  284. align="center"
  285. label="操作"
  286. width="100"
  287. fixed="right"
  288. >
  289. <template slot-scope="scope">
  290. <el-button
  291. type="text"
  292. @click="toForm(scope.row,true)"
  293. >详情</el-button
  294. >
  295. <el-button
  296. type="text"
  297. @click="toForm(scope.row)"
  298. v-if="
  299. $checkBtnRole('edit', $route.meta.roles) &&
  300. !scope.row.printNum
  301. "
  302. >编辑</el-button
  303. >
  304. <el-popconfirm
  305. style="margin-left: 10px"
  306. :title="
  307. '确定' + (scope.row.printNum ? '作废' : '取消') + '吗?'
  308. "
  309. @onConfirm="handleCancel(scope.row.id)"
  310. v-if="
  311. $checkBtnRole('cancel', $route.meta.roles) &&
  312. ((isDealer && !scope.row.printNum) || !isDealer)
  313. "
  314. >
  315. <el-button slot="reference" type="text">{{
  316. scope.row.printNum ? "作废" : "取消"
  317. }}</el-button>
  318. </el-popconfirm>
  319. </template>
  320. </el-table-column>
  321. </el-table>
  322. </div>
  323. </div>
  324. <div class="pagination clearfix">
  325. <div class="fr">
  326. <el-pagination
  327. @size-change="handleSizeChange"
  328. @current-change="handleCurrentChange"
  329. :current-page="currentPage"
  330. :page-sizes="[10, 20, 30, 50]"
  331. :page-size="10"
  332. layout="total, sizes, prev, pager, next, jumper"
  333. :total="listTotal"
  334. >
  335. </el-pagination>
  336. </div>
  337. </div>
  338. </div>
  339. <PickupForm
  340. :listItem="queryItem"
  341. v-if="isShowForm"
  342. @backListFormDetail="backList"
  343. />
  344. </div>
  345. </template>
  346. <script>
  347. import { getPickupList, cancelData } from "@/api/supply/pickup";
  348. import PickupForm from "@/views/supply/pickup/components/pickup_form";
  349. export default {
  350. components: {
  351. PickupForm,
  352. },
  353. data() {
  354. return {
  355. currentPage: 1, // 当前页码
  356. pageSize: 10, // 每页数量
  357. listTotal: 0, // 列表总数
  358. dataList: null, // 列表数据
  359. listLoading: false, // 列表加载loading
  360. screenForm: {
  361. // 筛选表单数据
  362. orderNum: "",
  363. applyName: "",
  364. warehouse: "",
  365. date: "",
  366. },
  367. queryItem: {},
  368. isShowForm: false,
  369. };
  370. },
  371. computed: {
  372. isDealer() {
  373. return JSON.parse(localStorage.getItem("supply_user")).isCustomer;
  374. },
  375. exParams() {
  376. return {
  377. invoiceId: this.screenForm.orderNum,
  378. createBy: this.screenForm.applyName,
  379. stockName: this.screenForm.warehouse,
  380. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : "",
  381. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : "",
  382. };
  383. },
  384. },
  385. created() {
  386. this.getList();
  387. },
  388. methods: {
  389. // 查询按钮权限
  390. checkBtnRole(value) {
  391. // let btnRole = this.$route.meta.roles;
  392. // if(!btnRole) {return true}
  393. // let index = btnRole.indexOf(value);
  394. // return index >= 0;
  395. return true;
  396. },
  397. // 查询列表
  398. getList() {
  399. this.listLoading = true;
  400. let params = {
  401. pageNum: this.currentPage,
  402. pageSize: this.pageSize,
  403. invoiceId: this.screenForm.orderNum,
  404. createBy: this.screenForm.applyName,
  405. stockName: this.screenForm.warehouse,
  406. pickStartTime: this.screenForm.date ? this.screenForm.date[0] : "",
  407. pickEndTime: this.screenForm.date ? this.screenForm.date[1] : "",
  408. };
  409. getPickupList(params).then((res) => {
  410. this.dataList = res.data.records;
  411. this.listTotal = res.data.total;
  412. this.listLoading = false;
  413. });
  414. },
  415. // 提交筛选表单
  416. submitScreenForm() {
  417. this.currentPage = 1;
  418. this.getList();
  419. },
  420. // 重置筛选表单
  421. resetScreenForm() {
  422. this.$refs.screenForm.resetFields();
  423. this.currentPage = 1;
  424. this.getList();
  425. },
  426. // 更改每页数量
  427. handleSizeChange(val) {
  428. this.pageSize = val;
  429. this.currentPage = 1;
  430. this.getList();
  431. },
  432. // 更改当前页
  433. handleCurrentChange(val) {
  434. this.currentPage = val;
  435. this.getList();
  436. },
  437. // 进入表单
  438. toForm(item,flag) {
  439. item.flag = flag // 详情 flag 为 details
  440. this.queryItem = item;
  441. this.isShowForm = true;
  442. },
  443. backList() {
  444. this.queryItem = {};
  445. this.isShowForm = false;
  446. },
  447. // 取消/作废
  448. handleCancel(id) {
  449. cancelData({ id }).then((res) => {
  450. this.$successMsg();
  451. this.getList();
  452. });
  453. },
  454. },
  455. };
  456. </script>
  457. <style lang="scss" scoped></style>