retail_detail.vue 34 KB

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