retail_detail.vue 33 KB

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