retail_detail.vue 32 KB

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