retail_detail.vue 33 KB

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