retail_detail.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowCheckOrder">
  4. <el-page-header content="详情" @back="goBack" />
  5. <div class="main-title">
  6. <div class="title">提货进度</div>
  7. </div>
  8. <div class="progress-container">
  9. <el-progress
  10. :text-inside="true"
  11. :stroke-width="26"
  12. :percentage="
  13. detailData.thjd ? +((detailData.thjd * 1000) / 10).toFixed(2) : 0
  14. "
  15. />
  16. </div>
  17. <div class="main-title">
  18. <div class="title">订单信息</div>
  19. </div>
  20. <div class="diy-table-1">
  21. <el-row>
  22. <el-col :span="8" class="item">
  23. <div class="label">订单号</div>
  24. <div class="value">{{ detailData.id }}</div>
  25. </el-col>
  26. <el-col :span="8" class="item">
  27. <div class="label">订单日期</div>
  28. <div class="value">{{ detailData.theTime }}</div>
  29. </el-col>
  30. <el-col :span="8" class="item">
  31. <div class="label">单据状态</div>
  32. <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
  33. </el-col>
  34. <el-col :span="16" class="item">
  35. <div class="label">备注</div>
  36. <div class="value">{{ detailData.remark }}</div>
  37. </el-col>
  38. <el-col :span="8" class="item">
  39. <div class="label">业务员</div>
  40. <div class="value">{{ detailData.k3ServiceName }}</div>
  41. </el-col>
  42. <el-col :span="8" class="item">
  43. <div class="label">制单人</div>
  44. <div class="value">{{ detailData.createName }}</div>
  45. </el-col>
  46. <el-col :span="8" class="item">
  47. <div class="label">制单日期</div>
  48. <div class="value">{{ detailData.createTime }}</div>
  49. </el-col>
  50. <el-col :span="8" class="item">
  51. <div class="label">审核人</div>
  52. <div class="value">{{ detailData.examineName }}</div>
  53. </el-col>
  54. <el-col :span="8" class="item">
  55. <div class="label">审核日期</div>
  56. <div class="value">{{ detailData.examineTime }}</div>
  57. </el-col>
  58. <el-col :span="8" class="item">
  59. <div class="label">关闭人</div>
  60. <div class="value">{{ detailData.closeName }}</div>
  61. </el-col>
  62. <el-col :span="8" class="item">
  63. <div class="label">关闭日期</div>
  64. <div class="value">{{ detailData.closeTime }}</div>
  65. </el-col>
  66. </el-row>
  67. </div>
  68. <div class="main-title">
  69. <div class="title">货品信息</div>
  70. </div>
  71. <div class="table" style="margin-top: 20px">
  72. <el-table
  73. :data="detailData.retailOrderItemList"
  74. element-loading-text="Loading"
  75. border
  76. fit
  77. highlight-current-row
  78. stripe
  79. max-height="400"
  80. show-summary
  81. :summary-method="$getSummaries"
  82. >
  83. <el-table-column align="center" label="序号" type="index" width="50" />
  84. <el-table-column
  85. align="center"
  86. label="销售类型"
  87. prop="saleTypeName"
  88. min-width="100"
  89. show-overflow-tooltip
  90. />
  91. <el-table-column
  92. align="center"
  93. label="物料编码"
  94. prop="materialCode"
  95. min-width="160"
  96. show-overflow-tooltip
  97. />
  98. <el-table-column
  99. align="center"
  100. label="产品名称"
  101. prop="materialName"
  102. min-width="160"
  103. show-overflow-tooltip
  104. />
  105. <el-table-column
  106. align="center"
  107. label="规格型号"
  108. prop="specification"
  109. min-width="160"
  110. show-overflow-tooltip
  111. />
  112. <el-table-column
  113. align="center"
  114. label="单位"
  115. prop="unit"
  116. min-width="100"
  117. show-overflow-tooltip
  118. />
  119. <el-table-column
  120. align="center"
  121. label="单价"
  122. prop="price"
  123. min-width="100"
  124. show-overflow-tooltip
  125. >
  126. <template slot-scope="scope">
  127. {{ scope.row.price | numToFixed }}
  128. </template>
  129. </el-table-column>
  130. <el-table-column
  131. align="center"
  132. label="数量"
  133. prop="qty"
  134. min-width="100"
  135. show-overflow-tooltip
  136. />
  137. <el-table-column
  138. align="center"
  139. label="订单金额"
  140. prop="totalAmount"
  141. min-width="100"
  142. show-overflow-tooltip
  143. >
  144. <template slot-scope="scope">
  145. {{ scope.row.totalAmount | numToFixed }}
  146. </template>
  147. </el-table-column>
  148. <el-table-column
  149. align="center"
  150. label="返利类型"
  151. prop="customerWalletName2"
  152. min-width="100"
  153. show-overflow-tooltip
  154. >
  155. <template slot-scope="scope">
  156. <!-- v-for="item in scope.row.rebateWallets" -->
  157. <el-tag
  158. v-if="scope.row.customerWalletName2"
  159. type="success"
  160. size="small"
  161. >
  162. {{ scope.row.customerWalletName2 }}
  163. </el-tag>
  164. </template>
  165. </el-table-column>
  166. <el-table-column
  167. align="center"
  168. label="返利金额"
  169. prop="payRebateAmount"
  170. min-width="100"
  171. show-overflow-tooltip
  172. >
  173. <template slot-scope="scope">
  174. {{ scope.row.payRebateAmount | numToFixed }}
  175. </template>
  176. </el-table-column>
  177. <el-table-column
  178. align="center"
  179. label="格力折扣"
  180. prop="totalDiscAmount"
  181. min-width="100"
  182. show-overflow-tooltip
  183. >
  184. <template slot-scope="scope">
  185. {{ scope.row.totalDiscAmount | numToFixed }}
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. align="center"
  190. label="现金钱包"
  191. prop="customerWalletName"
  192. min-width="100"
  193. show-overflow-tooltip
  194. >
  195. <template slot-scope="scope">
  196. <!-- v-for="item in scope.row.wallets" -->
  197. <el-tag type="success" size="small">
  198. {{ scope.row.customerWalletName }}
  199. </el-tag>
  200. </template>
  201. </el-table-column>
  202. <el-table-column
  203. align="center"
  204. label="实付金额"
  205. prop="payAmount"
  206. min-width="100"
  207. show-overflow-tooltip
  208. >
  209. <template slot-scope="scope">
  210. {{ scope.row.payAmount | numToFixed }}
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="center"
  215. label="是否直调"
  216. prop="isDirectTransfer"
  217. min-width="100"
  218. show-overflow-tooltip
  219. >
  220. <template slot-scope="scope">
  221. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  222. </template>
  223. </el-table-column>
  224. <el-table-column
  225. align="center"
  226. label="直调数量"
  227. prop="directTransferQty"
  228. min-width="100"
  229. show-overflow-tooltip
  230. />
  231. <!-- <el-table-column
  232. align="center"
  233. label="已退数量"
  234. prop="retiredQty"
  235. min-width="100"
  236. show-overflow-tooltip
  237. ></el-table-column> -->
  238. <el-table-column
  239. align="center"
  240. label="原订单数量"
  241. prop="oldQty"
  242. min-width="100"
  243. show-overflow-tooltip
  244. />
  245. <el-table-column
  246. align="center"
  247. label="备注"
  248. prop="remark"
  249. min-width="160"
  250. show-overflow-tooltip
  251. />
  252. <el-table-column
  253. align="center"
  254. label="税率"
  255. prop="tax"
  256. min-width="100"
  257. show-overflow-tooltip
  258. />
  259. </el-table>
  260. </div>
  261. <div>
  262. <div class="main-title">
  263. <div class="title">审批记录</div>
  264. </div>
  265. <div class="diy-table-1">
  266. <el-row :gutter="0">
  267. <el-col :span="12" class="item">
  268. <div class="label">审批人</div>
  269. <div class="value">{{ detailData.examineName }}</div>
  270. </el-col>
  271. <el-col :span="12" class="item">
  272. <div class="label">审批结果</div>
  273. <div class="value">
  274. {{ detailData.examineStatus | statusFilter }}
  275. </div>
  276. </el-col>
  277. <el-col :span="24" class="item">
  278. <div class="label">审批说明</div>
  279. <div class="value">{{ detailData.examineRemark }}</div>
  280. </el-col>
  281. </el-row>
  282. </div>
  283. </div>
  284. </div>
  285. <div class="page-footer">
  286. <div class="footer" :class="classObj">
  287. <el-button type="success" @click="toCheckOrder" >联查单据</el-button>
  288. <el-button type="primary" @click="openDirectDialog" v-if="isCustomer" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
  289. <el-button
  290. :type="status ? 'info' : 'primary'"
  291. v-if="isCustomer"
  292. :disabled="detailData.examineStatus !== 'OK' || status "
  293. @click="openDeliverDialog"
  294. >直调发货</el-button>
  295. <el-button
  296. v-if="isCustomer"
  297. :type="status ? 'info' : 'primary'"
  298. :disabled="detailData.examineStatus !== 'OK' || status"
  299. @click="handleFinish"
  300. >直调完成</el-button>
  301. <!-- <el-button @click="goBack">关 闭</el-button> -->
  302. </div>
  303. </div>
  304. <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
  305. <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
  306. <el-row :gutter="20">
  307. <el-col :xs="12" :sm="6" :lg="6">
  308. <el-form-item label="调出仓库" prop="warehouse1">
  309. <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
  310. <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  311. </el-select>
  312. </el-form-item>
  313. </el-col>
  314. <el-col :xs="12" :sm="6" :lg="6">
  315. <el-form-item label="调出仓位" prop="position1">
  316. <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
  317. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  318. </el-select>
  319. </el-form-item>
  320. </el-col>
  321. <el-col :xs="12" :sm="6" :lg="6">
  322. <el-form-item label="调入仓库" prop="warehouse2">
  323. <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
  324. <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  325. </el-select>
  326. </el-form-item>
  327. </el-col>
  328. <el-col :xs="12" :sm="6" :lg="6">
  329. <el-form-item label="调入仓位" prop="position2">
  330. <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
  331. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  332. </el-select>
  333. </el-form-item>
  334. </el-col>
  335. </el-row>
  336. </el-form>
  337. <div class="table" style="margin-top: 20px">
  338. <el-table :data="directGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  339. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  340. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  341. <el-table-column align="center" label="物料编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  342. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  343. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  344. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  345. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  346. <el-table-column align="center" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  347. <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
  348. <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
  349. <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
  350. <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
  351. <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
  352. <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
  353. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  354. <template slot-scope="">弘格</template>
  355. </el-table-column>
  356. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  357. <template slot-="scope">弘格</template>
  358. </el-table-column>
  359. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  360. </el-table>
  361. </div>
  362. <span slot="footer" class="dialog-footer">
  363. <el-button @click="closeDirectDialog">取 消</el-button>
  364. <el-button type="primary" @click="submitDirectForm">确 定</el-button>
  365. </span>
  366. </el-dialog>
  367. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  368. <el-form
  369. ref="deliverForm"
  370. :model="deliverForm"
  371. :rules="deliverFormRules"
  372. label-width="80px"
  373. size="small"
  374. label-position="left"
  375. >
  376. <el-row :gutter="20">
  377. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">
  378. <el-form-item label="发货日期" prop="date">
  379. <el-date-picker
  380. v-model="deliverForm.date"
  381. type="date"
  382. value-format="yyyy-MM-dd"
  383. style="width: 100%"
  384. placeholder="选择日期"
  385. />
  386. </el-form-item>
  387. </el-col>
  388. <!-- <el-col :xs="8" :sm="8" :lg="8">-->
  389. <!-- <el-form-item label="发货仓库" prop="warehouse">-->
  390. <!-- <el-select-->
  391. <!-- v-model="deliverForm.warehouse"-->
  392. <!-- placeholder="请选择发货仓库"-->
  393. <!-- style="width: 100%"-->
  394. <!-- filterable-->
  395. <!-- @change="changeWarehouse"-->
  396. <!-- >-->
  397. <!-- <el-option-->
  398. <!-- v-for="item in warehouseList"-->
  399. <!-- :key="item.id"-->
  400. <!-- :label="item.name"-->
  401. <!-- :value="item.id"-->
  402. <!-- />-->
  403. <!-- </el-select>-->
  404. <!-- </el-form-item>-->
  405. <!-- </el-col>-->
  406. <el-col :xs="8" :sm="8" :lg="8">
  407. <el-form-item label="选择仓位" prop="position">
  408. <el-select
  409. v-model="deliverForm.position"
  410. placeholder="请选择仓位"
  411. style="width: 100%"
  412. filterable
  413. >
  414. <el-option
  415. v-for="item in positionList"
  416. :key="item.id"
  417. :label="item.name"
  418. :value="item.id"
  419. />
  420. </el-select>
  421. </el-form-item>
  422. </el-col>
  423. </el-row>
  424. </el-form>
  425. <div class="table" style="margin-top: 20px">
  426. <el-table
  427. :data="goodsList"
  428. element-loading-text="Loading"
  429. border
  430. fit
  431. highlight-current-row
  432. stripe
  433. max-height="400"
  434. show-summary
  435. :summary-method="$getSummaries"
  436. >
  437. <el-table-column
  438. align="center"
  439. label="序号"
  440. type="index"
  441. width="50"
  442. />
  443. <el-table-column
  444. align="center"
  445. label="销售类型"
  446. prop="saleTypeName"
  447. min-width="100"
  448. show-overflow-tooltip
  449. />
  450. <el-table-column
  451. align="center"
  452. label="物料编码"
  453. prop="materialCode"
  454. min-width="160"
  455. show-overflow-tooltip
  456. />
  457. <el-table-column
  458. align="center"
  459. label="产品名称"
  460. prop="materialName"
  461. min-width="160"
  462. show-overflow-tooltip
  463. />
  464. <el-table-column
  465. align="center"
  466. label="规格型号"
  467. prop="specification"
  468. min-width="160"
  469. show-overflow-tooltip
  470. />
  471. <el-table-column
  472. align="center"
  473. label="单位"
  474. prop="unit"
  475. min-width="100"
  476. show-overflow-tooltip
  477. />
  478. <el-table-column
  479. align="center"
  480. label="订单数量"
  481. prop="refundableQty"
  482. min-width="100"
  483. show-overflow-tooltip
  484. />
  485. <el-table-column
  486. align="center"
  487. label="发货数量"
  488. prop="hasSendQty"
  489. min-width="100"
  490. show-overflow-tooltip
  491. />
  492. <el-table-column
  493. align="center"
  494. label="直调数量"
  495. prop="adjustNum"
  496. min-width="100"
  497. show-overflow-tooltip
  498. >
  499. <template slot-scope="scope">
  500. <el-input
  501. v-model="scope.row.adjustNum"
  502. size="small"
  503. type="number"
  504. :disabled="!scope.row.isDirectTransfer"
  505. />
  506. </template>
  507. </el-table-column>
  508. <el-table-column
  509. align="center"
  510. label="单价"
  511. prop="price"
  512. min-width="100"
  513. show-overflow-tooltip
  514. >
  515. <template slot-scope="scope">
  516. {{ scope.row.price | numToFixed }}
  517. </template>
  518. </el-table-column>
  519. <el-table-column
  520. align="center"
  521. label="金额"
  522. prop="totalAmount"
  523. min-width="100"
  524. show-overflow-tooltip
  525. >
  526. <template slot-scope="scope">
  527. {{ scope.row.totalAmount | numToFixed }}
  528. </template>
  529. </el-table-column>
  530. <el-table-column
  531. align="center"
  532. label="返利"
  533. prop="payRebateAmount"
  534. min-width="100"
  535. show-overflow-tooltip
  536. >
  537. <template slot-scope="scope">
  538. {{ scope.row.payRebateAmount | numToFixed }}
  539. </template>
  540. </el-table-column>
  541. <el-table-column
  542. align="center"
  543. label="备注"
  544. prop="remark"
  545. min-width="160"
  546. show-overflow-tooltip
  547. />
  548. </el-table>
  549. </div>
  550. <span slot="footer" class="dialog-footer">
  551. <el-button @click="closeDeliverDialog">取 消</el-button>
  552. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  553. </span>
  554. </el-dialog>
  555. <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
  556. </div>
  557. </template>
  558. <script>
  559. import { getDetail } from '@/api/supply/policy'
  560. import { adjustDeliver, directOrder, finishData, getPositionList, getWarehouseList } from '@/api/supply/retail'
  561. import { mapState } from 'vuex'
  562. import CheckOrder from '@/components/Common/check-order'
  563. export default {
  564. name: 'RetailDetail',
  565. componentName: 'RetailDetail',
  566. components: {
  567. CheckOrder,
  568. },
  569. filters: {
  570. statusFilter(val) {
  571. const statusList = [
  572. { label: '已保存', value: 'SAVE' },
  573. { label: '待审核', value: 'WAIT' },
  574. { label: '审核通过', value: 'OK' },
  575. { label: '审核驳回', value: 'FAIL' }
  576. ]
  577. const obj = statusList.find((o) => o.value == val)
  578. return obj ? obj.label : ''
  579. }
  580. },
  581. props: ['listItem'],
  582. data() {
  583. return {
  584. detailData: {},
  585. isShowDeliverDialog: false,
  586. deliverForm: {
  587. date: '',
  588. position: '',
  589. },
  590. deliverFormRules: {
  591. date: [
  592. { required: true, message: '请选择发货日期', trigger: 'change' }
  593. ],
  594. position: [
  595. { required: true, message: '请选择虚拟仓位', trigger: 'change' }
  596. ],
  597. },
  598. positionList: [],
  599. goodsList: [],
  600. isShowDirectDialog: false,
  601. directForm: {
  602. warehouse1: '',
  603. position1: '',
  604. warehouse2: '',
  605. position2: '',
  606. },
  607. directFormRules: {
  608. warehouse1: [
  609. { required: true, message: '请选择调出仓库', trigger: 'change' }
  610. ],
  611. position1: [
  612. { required: true, message: '请选择调出仓位', trigger: 'change' }
  613. ],
  614. warehouse2: [
  615. { required: true, message: '请选择调入仓库', trigger: 'change' }
  616. ],
  617. position2: [
  618. { required: true, message: '请选择调入仓位', trigger: 'change' }
  619. ],
  620. },
  621. warehouseList1: [],
  622. warehouseList2: [],
  623. positionList1: [],
  624. positionList2: [],
  625. directGoodsList: [],
  626. status:false,
  627. checkOrderId: {},
  628. isShowCheckOrder: false,
  629. }
  630. },
  631. computed: {
  632. sidebar() {
  633. return this.$store.state.app.sidebar
  634. },
  635. classObj() {
  636. return {
  637. hideSidebar: !this.sidebar.opened,
  638. openSidebar: this.sidebar.opened
  639. }
  640. },
  641. isExamine() {
  642. return (
  643. this.detailData.examineStatus === 'OK' ||
  644. this.detailData.examineStatus === 'FAIL'
  645. )
  646. },
  647. isDealer() {
  648. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  649. },
  650. progress() {
  651. if (this.detailData.totalQty == 0) return 0
  652. return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100)
  653. },
  654. ...mapState({
  655. isCustomer: ({ user }) => {
  656. return !(user.customerName || user.customerNumber)
  657. }
  658. })
  659. },
  660. created() {
  661. this.getDetail()
  662. },
  663. methods: {
  664. // 返回列表
  665. goBack() {
  666. this.$emit('backListFormDetail')
  667. },
  668. // 是否直调完成
  669. directTransferStatus(val) {
  670. this.status = val.retailOrderItemList.some((k) => {
  671. return k.directTransferStatus == true
  672. })
  673. console.log(this.status, '4554545')
  674. },
  675. // 获取详情
  676. getDetail() {
  677. getDetail({ id: this.listItem.id }).then((res) => {
  678. if (res.data.retailOrderItemList) {
  679. res.data.retailOrderItemList.forEach((item) => {
  680. item.sums1 = [
  681. 'directTransferQty',
  682. 'qty',
  683. 'refundableQty',
  684. 'oldQty'
  685. ]
  686. item.sums2 = [
  687. 'totalAmount',
  688. 'payAmount',
  689. 'price',
  690. 'payRebateAmount',
  691. 'discAmount',
  692. 'totalDiscAmount'
  693. ]
  694. })
  695. }
  696. this.detailData = res.data
  697. this.directTransferStatus(res.data)
  698. })
  699. },
  700. // 直调完成
  701. handleFinish() {
  702. this.$confirm('此操作将直调完成, 是否继续?', '提示', {
  703. confirmButtonText: '确定',
  704. cancelButtonText: '取消',
  705. type: 'warning'
  706. })
  707. .then(() => {
  708. finishData({
  709. id: this.listItem.id
  710. }).then((res) => {
  711. this.$successMsg()
  712. this.getDetail()
  713. })
  714. })
  715. .catch(() => {})
  716. },
  717. // 获取仓库列表
  718. getWarehouseList() {
  719. getWarehouseList({
  720. pageNum: 1,
  721. pageSize: -1
  722. }).then((res) => {
  723. this.warehouseList = res.data.records
  724. })
  725. },
  726. // 更改仓库
  727. changeWarehouse() {
  728. this.deliverForm.position = ''
  729. const obj = this.warehouseList.find(
  730. (o) => o.id == this.deliverForm.warehouse
  731. )
  732. this.positionList = obj.kingDeeStocks
  733. },
  734. // 打开 直调发货
  735. openDeliverDialog() {
  736. this.isShowDeliverDialog = true
  737. this.goodsList = this.detailData.retailOrderItemList
  738. this.getPositionList()
  739. },
  740. // 获取虚拟仓位列表
  741. getPositionList() {
  742. getPositionList({
  743. pageNum: 1,
  744. pageSize: -1,
  745. type:2
  746. }).then(res => {
  747. this.positionList = res.data.records;
  748. })
  749. },
  750. // 关闭 直调发货
  751. closeDeliverDialog() {
  752. this.isShowDeliverDialog = false
  753. },
  754. // 联查单据
  755. toCheckOrder() {
  756. this.checkOrderId = this.detailData.id;
  757. this.isShowCheckOrder = true;
  758. },
  759. // 关闭 提前开票
  760. closeDirectDialog() {
  761. this.isShowDirectDialog = false;
  762. },
  763. // 更改调出仓库
  764. changeWarehouse1() {
  765. this.directForm.position1 = '';
  766. let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  767. this.positionList1 = obj.kingDeeStocks;
  768. this.directGoodsList.forEach(item => {
  769. item.warehouse1 = obj.name;
  770. });
  771. },
  772. // 更改调入仓库
  773. changeWarehouse2() {
  774. this.directForm.position2 = '';
  775. let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  776. this.positionList2 = obj.kingDeeStocks;
  777. this.directGoodsList.forEach(item => {
  778. item.warehouse2 = obj.name;
  779. });
  780. },
  781. // 获取仓库列表
  782. getWarehouseList() {
  783. getWarehouseList({
  784. pageNum: 1,
  785. pageSize: -1
  786. }).then(res => {
  787. this.warehouseList1 = res.data.records;
  788. this.warehouseList2 = res.data.records;
  789. })
  790. },
  791. // 更改调出仓位
  792. changePosition1() {
  793. let obj = this.positionList1.find(o => o.id == this.directForm.position1);
  794. this.directGoodsList.forEach(item => {
  795. item.position1 = obj.name;
  796. item.status1 = obj.defStockStatusName;
  797. });
  798. },
  799. // 更改调入仓位
  800. changePosition2() {
  801. let obj = this.positionList2.find(o => o.id == this.directForm.position2);
  802. this.directGoodsList.forEach(item => {
  803. item.position2 = obj.name;
  804. item.status2 = obj.defStockStatusName;
  805. });
  806. },
  807. // 提交 提前开票
  808. submitDirectForm() {
  809. this.$refs.directForm.validate((valid) => {
  810. if (valid) {
  811. let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  812. let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
  813. let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  814. let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
  815. let params = {
  816. orderNo: this.detailData.id,
  817. orderType: 'RETAIL', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  818. correspondId: this.directForm.warehouse1,
  819. correspondName: warehouseItem1.name,
  820. stockId: this.directForm.position1,
  821. stockName: positionItem1.name,
  822. inCorrespondId: this.directForm.warehouse2,
  823. inCorrespondName: warehouseItem2.name,
  824. inStockId: this.directForm.position2,
  825. inStockName: positionItem2.name,
  826. }
  827. directOrder(params).then(res => {
  828. this.$successMsg();
  829. this.isShowDirectDialog = false;
  830. this.getDetail();
  831. })
  832. }
  833. })
  834. },
  835. backDetail() {
  836. this.isShowCheckOrder = false;
  837. },
  838. // 提交 直调发货
  839. submitDeliverForm() {
  840. this.$refs.deliverForm.validate((valid) => {
  841. if (valid) {
  842. for (let i = 0; i < this.goodsList.length; i++) {
  843. if (
  844. !this.goodsList[i].adjustNum &&
  845. this.goodsList[i].isDirectTransfer
  846. ) {
  847. this.$errorMsg('请输入直调数量')
  848. return
  849. }
  850. }
  851. const goodsList = this.goodsList.map((item) => {
  852. return {
  853. itemId: item.id,
  854. qty: item.adjustNum || 0
  855. }
  856. })
  857. const params = {
  858. orderNo: this.listItem.id,
  859. orderDate: this.deliverForm.date + ' 00:00:00',
  860. correspondId: this.deliverForm.position,
  861. directItems: goodsList
  862. }
  863. adjustDeliver(params).then((res) => {
  864. this.$successMsg()
  865. this.isShowDeliverDialog = false
  866. this.getDetail()
  867. })
  868. }
  869. })
  870. },
  871. // 打开 提前开票
  872. openDirectDialog() {
  873. this.isShowDirectDialog = true;
  874. this.directGoodsList = this.detailData.retailOrderItemList;
  875. this.getWarehouseList();
  876. },
  877. }
  878. }
  879. </script>
  880. <style scoped lang="scss">
  881. .detail-container {
  882. width: 100%;
  883. height: 100%;
  884. margin-bottom: 50px;
  885. }
  886. .main-title {
  887. display: flex;
  888. justify-content: space-between;
  889. align-items: center;
  890. margin-top: 20px;
  891. height: 60px;
  892. border-bottom: 1px solid #dcdfe6;
  893. margin-bottom: 20px;
  894. .title {
  895. font-size: 16px;
  896. font-weight: 600;
  897. padding-left: 10px;
  898. }
  899. }
  900. .progress-container {
  901. display: flex;
  902. .el-progress {
  903. width: 500px;
  904. }
  905. }
  906. .page-footer{
  907. height: 0;
  908. }
  909. </style>