retail_detail.vue 19 KB

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