retail_detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="详情"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">提货进度</div>
  6. </div>
  7. <div class="progress-container">
  8. <el-progress
  9. :text-inside="true"
  10. :stroke-width="26"
  11. :percentage="detailData.thjd ? (detailData.thjd * 1000) / 10 : 0"
  12. ></el-progress>
  13. </div>
  14. <div class="main-title">
  15. <div class="title">订单信息</div>
  16. </div>
  17. <div class="diy-table-1">
  18. <el-row>
  19. <el-col :span="8" class="item">
  20. <div class="label">订单号</div>
  21. <div class="value">{{ detailData.id }}</div>
  22. </el-col>
  23. <el-col :span="8" class="item">
  24. <div class="label">订单日期</div>
  25. <div class="value">{{ detailData.theTime }}</div>
  26. </el-col>
  27. <el-col :span="8" class="item">
  28. <div class="label">单据状态</div>
  29. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  30. </el-col>
  31. <el-col :span="16" class="item">
  32. <div class="label">备注</div>
  33. <div class="value">{{ detailData.remark }}</div>
  34. </el-col>
  35. <el-col :span="8" class="item">
  36. <div class="label">业务员</div>
  37. <div class="value">{{ detailData.serviceName }}</div>
  38. </el-col>
  39. <el-col :span="8" class="item">
  40. <div class="label">制单人</div>
  41. <div class="value">{{ detailData.createName }}</div>
  42. </el-col>
  43. <el-col :span="8" class="item">
  44. <div class="label">制单日期</div>
  45. <div class="value">{{ detailData.createTime }}</div>
  46. </el-col>
  47. <el-col :span="8" class="item">
  48. <div class="label">审核人</div>
  49. <div class="value">{{ detailData.examineName }}</div>
  50. </el-col>
  51. <el-col :span="8" class="item">
  52. <div class="label">审核日期</div>
  53. <div class="value">{{ detailData.examineTime }}</div>
  54. </el-col>
  55. <el-col :span="8" class="item">
  56. <div class="label">关闭人</div>
  57. <div class="value">{{ detailData.closeName }}</div>
  58. </el-col>
  59. <el-col :span="8" class="item">
  60. <div class="label">关闭日期</div>
  61. <div class="value">{{ detailData.closeTime }}</div>
  62. </el-col>
  63. </el-row>
  64. </div>
  65. <div class="main-title">
  66. <div class="title">货品信息</div>
  67. </div>
  68. <div class="table" style="margin-top: 20px">
  69. <el-table
  70. :data="detailData.retailOrderItemList"
  71. element-loading-text="Loading"
  72. border
  73. fit
  74. highlight-current-row
  75. stripe
  76. max-height="400"
  77. >
  78. <el-table-column
  79. align="center"
  80. label="序号"
  81. type="index"
  82. width="50"
  83. ></el-table-column>
  84. <el-table-column
  85. align="center"
  86. label="销售类型"
  87. prop="saleTypeName"
  88. min-width="100"
  89. show-overflow-tooltip
  90. ></el-table-column>
  91. <el-table-column
  92. align="center"
  93. label="产品编码"
  94. prop="materialCode"
  95. min-width="160"
  96. show-overflow-tooltip
  97. ></el-table-column>
  98. <el-table-column
  99. align="center"
  100. label="产品名称"
  101. prop="materialName"
  102. min-width="160"
  103. show-overflow-tooltip
  104. ></el-table-column>
  105. <el-table-column
  106. align="center"
  107. label="规格型号"
  108. prop="specification"
  109. min-width="160"
  110. show-overflow-tooltip
  111. ></el-table-column>
  112. <el-table-column
  113. align="center"
  114. label="单位"
  115. prop="unit"
  116. min-width="100"
  117. show-overflow-tooltip
  118. ></el-table-column>
  119. <el-table-column
  120. align="center"
  121. label="单价"
  122. prop="price"
  123. min-width="100"
  124. show-overflow-tooltip
  125. ></el-table-column>
  126. <el-table-column
  127. align="center"
  128. label="数量"
  129. prop="qty"
  130. min-width="100"
  131. show-overflow-tooltip
  132. ></el-table-column>
  133. <el-table-column
  134. align="center"
  135. label="订单金额"
  136. prop="totalAmount"
  137. min-width="100"
  138. show-overflow-tooltip
  139. ></el-table-column>
  140. <el-table-column
  141. align="center"
  142. label="返利类型"
  143. prop="customerWalletName2"
  144. min-width="200"
  145. show-overflow-tooltip
  146. >
  147. <template slot-scope="scope">
  148. <el-tag
  149. type="success"
  150. size="small"
  151. v-if="scope.row.customerWalletName2"
  152. >
  153. {{ scope.row.customerWalletName2 }}
  154. </el-tag>
  155. </template>
  156. </el-table-column>
  157. <el-table-column
  158. align="center"
  159. label="返利金额"
  160. prop="payRebateAmount"
  161. min-width="100"
  162. show-overflow-tooltip
  163. ></el-table-column>
  164. <el-table-column
  165. align="center"
  166. label="格力折扣"
  167. prop="totalDiscAmount"
  168. min-width="100"
  169. show-overflow-tooltip
  170. ></el-table-column>
  171. <el-table-column
  172. align="center"
  173. label="现金钱包"
  174. prop="customerWalletName"
  175. min-width="100"
  176. show-overflow-tooltip
  177. ></el-table-column>
  178. <el-table-column
  179. align="center"
  180. label="金额"
  181. prop="payAmount"
  182. min-width="100"
  183. show-overflow-tooltip
  184. ></el-table-column>
  185. <el-table-column
  186. align="center"
  187. label="是否直调"
  188. prop="isDirectTransfer"
  189. min-width="100"
  190. show-overflow-tooltip
  191. >
  192. <template slot-scope="scope">
  193. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. align="center"
  198. label="直调数量"
  199. prop="directTransferQty"
  200. min-width="100"
  201. show-overflow-tooltip
  202. ></el-table-column>
  203. <el-table-column
  204. align="center"
  205. label="原订单数量"
  206. prop="oldQty"
  207. min-width="100"
  208. show-overflow-tooltip
  209. ></el-table-column>
  210. <el-table-column
  211. align="center"
  212. label="备注"
  213. prop="remark"
  214. min-width="160"
  215. show-overflow-tooltip
  216. ></el-table-column>
  217. <el-table-column
  218. align="center"
  219. label="税率"
  220. prop="tax"
  221. min-width="100"
  222. show-overflow-tooltip
  223. ></el-table-column>
  224. </el-table>
  225. </div>
  226. <div class="page-footer">
  227. <div class="footer" :class="classObj">
  228. <el-button
  229. type="primary"
  230. @click="openDeliverDialog"
  231. :disabled="detailData.examineStatus !== 'OK'"
  232. >直调发货</el-button
  233. >
  234. <el-button
  235. type="primary"
  236. @click="handleFinish"
  237. :disabled="detailData.examineStatus !== 'OK'"
  238. >直调完成</el-button
  239. >
  240. <!-- <el-button @click="goBack">关 闭</el-button> -->
  241. </div>
  242. </div>
  243. <div v-if="isExamine">
  244. <div class="main-title">
  245. <div class="title">审批记录</div>
  246. </div>
  247. <div class="diy-table-1">
  248. <el-row :gutter="0">
  249. <el-col :span="12" class="item">
  250. <div class="label">审批人</div>
  251. <div class="value">{{ detailData.examineName }}</div>
  252. </el-col>
  253. <el-col :span="12" class="item">
  254. <div class="label">审批结果</div>
  255. <div class="value">
  256. {{ detailData.examineStatus | statusFilter }}
  257. </div>
  258. </el-col>
  259. <el-col :span="24" class="item">
  260. <div class="label">审批说明</div>
  261. <div class="value">{{ detailData.examineRemark }}</div>
  262. </el-col>
  263. </el-row>
  264. </div>
  265. </div>
  266. <!--
  267. <div class="page-footer">
  268. <div class="footer" :class="classObj">
  269. <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
  270. <el-button @click="goBack">关 闭</el-button>
  271. </div>
  272. </div> -->
  273. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  274. <el-form
  275. ref="deliverForm"
  276. :model="deliverForm"
  277. :rules="deliverFormRules"
  278. label-width="80px"
  279. size="small"
  280. label-position="left"
  281. >
  282. <el-row :gutter="20">
  283. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">
  284. <el-form-item label="发货日期" prop="date">
  285. <el-date-picker
  286. v-model="deliverForm.date"
  287. type="date"
  288. value-format="yyyy-MM-dd"
  289. style="width: 100%"
  290. placeholder="选择日期"
  291. >
  292. </el-date-picker>
  293. </el-form-item>
  294. </el-col>
  295. <el-col :xs="8" :sm="8" :lg="8">
  296. <el-form-item label="发货仓库" prop="warehouse">
  297. <el-select
  298. v-model="deliverForm.warehouse"
  299. placeholder="请选择发货仓库"
  300. style="width: 100%"
  301. filterable
  302. @change="changeWarehouse"
  303. >
  304. <el-option
  305. v-for="item in warehouseList"
  306. :key="item.id"
  307. :label="item.name"
  308. :value="item.id"
  309. ></el-option>
  310. </el-select>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :xs="8" :sm="8" :lg="8">
  314. <el-form-item label="选择仓位" prop="position">
  315. <el-select
  316. v-model="deliverForm.position"
  317. placeholder="请选择仓位"
  318. style="width: 100%"
  319. filterable
  320. >
  321. <el-option
  322. v-for="item in positionList"
  323. :key="item.id"
  324. :label="item.name"
  325. :value="item.id"
  326. ></el-option>
  327. </el-select>
  328. </el-form-item>
  329. </el-col>
  330. </el-row>
  331. </el-form>
  332. <div class="table" style="margin-top: 20px">
  333. <el-table
  334. :data="goodsList"
  335. element-loading-text="Loading"
  336. border
  337. fit
  338. highlight-current-row
  339. stripe
  340. max-height="400"
  341. >
  342. <el-table-column
  343. align="center"
  344. label="序号"
  345. type="index"
  346. width="50"
  347. ></el-table-column>
  348. <el-table-column
  349. align="center"
  350. label="销售类型"
  351. prop="saleTypeName"
  352. min-width="100"
  353. show-overflow-tooltip
  354. ></el-table-column>
  355. <el-table-column
  356. align="center"
  357. label="产品编码"
  358. prop="materialCode"
  359. min-width="160"
  360. show-overflow-tooltip
  361. ></el-table-column>
  362. <el-table-column
  363. align="center"
  364. label="产品名称"
  365. prop="materialName"
  366. min-width="160"
  367. show-overflow-tooltip
  368. ></el-table-column>
  369. <el-table-column
  370. align="center"
  371. label="规格型号"
  372. prop="specification"
  373. min-width="160"
  374. show-overflow-tooltip
  375. ></el-table-column>
  376. <el-table-column
  377. align="center"
  378. label="单位"
  379. prop="unit"
  380. min-width="100"
  381. show-overflow-tooltip
  382. ></el-table-column>
  383. <el-table-column
  384. align="center"
  385. label="订单数量"
  386. prop="qty"
  387. min-width="100"
  388. show-overflow-tooltip
  389. ></el-table-column>
  390. <el-table-column
  391. align="center"
  392. label="发货数量"
  393. prop="hasSendQty"
  394. min-width="100"
  395. show-overflow-tooltip
  396. ></el-table-column>
  397. <el-table-column
  398. align="center"
  399. label="直调数量"
  400. prop="adjustNum"
  401. min-width="100"
  402. show-overflow-tooltip
  403. >
  404. <template slot-scope="scope">
  405. <el-input
  406. v-model="scope.row.adjustNum"
  407. size="small"
  408. type="number"
  409. ></el-input>
  410. </template>
  411. </el-table-column>
  412. <el-table-column
  413. align="center"
  414. label="单价"
  415. prop="price"
  416. min-width="100"
  417. show-overflow-tooltip
  418. ></el-table-column>
  419. <el-table-column
  420. align="center"
  421. label="金额"
  422. prop="totalAmount"
  423. min-width="100"
  424. show-overflow-tooltip
  425. ></el-table-column>
  426. <el-table-column
  427. align="center"
  428. label="返利"
  429. prop="rebateAmount"
  430. min-width="100"
  431. show-overflow-tooltip
  432. ></el-table-column>
  433. <el-table-column
  434. align="center"
  435. label="实付金额"
  436. prop="payAmount"
  437. min-width="100"
  438. show-overflow-tooltip
  439. ></el-table-column>
  440. <el-table-column
  441. align="center"
  442. label="备注"
  443. prop="remark"
  444. min-width="160"
  445. show-overflow-tooltip
  446. ></el-table-column>
  447. </el-table>
  448. </div>
  449. <span slot="footer" class="dialog-footer">
  450. <el-button @click="closeDeliverDialog">取 消</el-button>
  451. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  452. </span>
  453. </el-dialog>
  454. </div>
  455. </template>
  456. <script>
  457. import { getDetail } from "@/api/supply/policy";
  458. import {
  459. getWarehouseList,
  460. adjustDeliver,
  461. finishData,
  462. } from "@/api/supply/retail";
  463. export default {
  464. name: "RetailDetail",
  465. componentName: "RetailDetail",
  466. props: ["listItem"],
  467. filters: {
  468. statusFilter(val) {
  469. const statusList = [
  470. { label: "已保存", value: "SAVE" },
  471. { label: "待审核", value: "WAIT" },
  472. { label: "审核通过", value: "OK" },
  473. { label: "审核驳回", value: "FAIL" },
  474. ];
  475. let obj = statusList.find((o) => o.value == val);
  476. return obj ? obj.label : "";
  477. },
  478. },
  479. data() {
  480. return {
  481. detailData: {},
  482. isShowDeliverDialog: false,
  483. deliverForm: {
  484. date: "",
  485. warehouse: "",
  486. position: "",
  487. },
  488. deliverFormRules: {
  489. date: [
  490. { required: true, message: "请选择发货日期", trigger: "change" },
  491. ],
  492. warehouse: [
  493. { required: true, message: "请选择发货仓库", trigger: "change" },
  494. ],
  495. position: [
  496. { required: true, message: "请选择仓位", trigger: "change" },
  497. ],
  498. },
  499. warehouseList: [],
  500. positionList: [],
  501. goodsList: [],
  502. };
  503. },
  504. computed: {
  505. sidebar() {
  506. return this.$store.state.app.sidebar;
  507. },
  508. classObj() {
  509. return {
  510. hideSidebar: !this.sidebar.opened,
  511. openSidebar: this.sidebar.opened,
  512. };
  513. },
  514. isExamine() {
  515. return (
  516. this.detailData.examineStatus === "OK" ||
  517. this.detailData.examineStatus === "FAIL"
  518. );
  519. },
  520. progress() {
  521. if (this.detailData.totalQty == 0) return 0;
  522. return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100);
  523. },
  524. },
  525. created() {
  526. this.getDetail();
  527. },
  528. methods: {
  529. // 返回列表
  530. goBack() {
  531. this.$emit("backListFormDetail");
  532. },
  533. // 获取详情
  534. getDetail() {
  535. getDetail({ id: this.listItem.id }).then((res) => {
  536. this.detailData = res.data;
  537. });
  538. },
  539. // 直调完成
  540. handleFinish() {
  541. this.$confirm("此操作将直调完成, 是否继续?", "提示", {
  542. confirmButtonText: "确定",
  543. cancelButtonText: "取消",
  544. type: "warning",
  545. })
  546. .then(() => {
  547. finishData({
  548. id: this.listItem.id,
  549. }).then((res) => {
  550. this.$successMsg();
  551. this.getDetail();
  552. });
  553. })
  554. .catch(() => {});
  555. },
  556. // 获取仓库列表
  557. getWarehouseList() {
  558. getWarehouseList({
  559. pageNum: 1,
  560. pageSize: -1,
  561. }).then((res) => {
  562. this.warehouseList = res.data.records;
  563. });
  564. },
  565. // 更改仓库
  566. changeWarehouse() {
  567. this.deliverForm.position = "";
  568. let obj = this.warehouseList.find(
  569. (o) => o.id == this.deliverForm.warehouse
  570. );
  571. this.positionList = obj.kingDeeStocks;
  572. },
  573. // 打开 直调发货
  574. openDeliverDialog() {
  575. this.isShowDeliverDialog = true;
  576. this.goodsList = this.detailData.retailOrderItemList;
  577. this.getWarehouseList();
  578. },
  579. // 关闭 直调发货
  580. closeDeliverDialog() {
  581. this.isShowDeliverDialog = false;
  582. },
  583. // 提交 直调发货
  584. submitDeliverForm() {
  585. this.$refs.deliverForm.validate((valid) => {
  586. if (valid) {
  587. for (let i = 0; i < this.goodsList.length; i++) {
  588. if (!this.goodsList[i].adjustNum) {
  589. this.$errorMsg("请输入直调数量");
  590. return;
  591. }
  592. }
  593. let goodsList = this.goodsList.map((item) => {
  594. return {
  595. itemId: item.id,
  596. qty: item.adjustNum,
  597. };
  598. });
  599. let params = {
  600. orderNo: this.listItem.id,
  601. orderDate: this.deliverForm.date + " 00:00:00",
  602. correspondId: this.deliverForm.warehouse,
  603. stockId: this.deliverForm.position,
  604. directItems: goodsList,
  605. };
  606. adjustDeliver(params).then((res) => {
  607. this.$successMsg();
  608. this.isShowDeliverDialog = false;
  609. this.getDetail();
  610. });
  611. }
  612. });
  613. },
  614. },
  615. };
  616. </script>
  617. <style scoped lang="scss">
  618. .detail-container {
  619. width: 100%;
  620. height: 100%;
  621. margin-bottom: 50px;
  622. }
  623. .main-title {
  624. display: flex;
  625. justify-content: space-between;
  626. align-items: center;
  627. margin-top: 20px;
  628. height: 60px;
  629. border-bottom: 1px solid #dcdfe6;
  630. margin-bottom: 20px;
  631. .title {
  632. font-size: 16px;
  633. font-weight: 600;
  634. padding-left: 10px;
  635. }
  636. }
  637. .progress-container {
  638. display: flex;
  639. .el-progress {
  640. width: 500px;
  641. }
  642. }
  643. </style>