retail_detail.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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="80px"
  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-row>
  475. </el-form>
  476. <div class="table" style="margin-top: 20px">
  477. <el-table
  478. :data="goodsList"
  479. element-loading-text="Loading"
  480. border
  481. fit
  482. highlight-current-row
  483. stripe
  484. max-height="400"
  485. show-summary
  486. :summary-method="$getSummaries"
  487. >
  488. <el-table-column
  489. align="left"
  490. label="序号"
  491. type="index"
  492. width="50"
  493. />
  494. <el-table-column
  495. align="left"
  496. label="销售类型"
  497. prop="saleTypeName"
  498. min-width="100"
  499. show-overflow-tooltip
  500. />
  501. <el-table-column
  502. align="left"
  503. label="物料编码"
  504. prop="materialCode"
  505. min-width="160"
  506. show-overflow-tooltip
  507. >
  508. <template slot-scope="scope">
  509. <CopyButton :copyText="scope.row.materialCode" />
  510. <span>{{scope.row.materialCode}}</span>
  511. </template>
  512. </el-table-column>
  513. <el-table-column
  514. align="left"
  515. label="产品名称"
  516. prop="materialName"
  517. min-width="160"
  518. show-overflow-tooltip
  519. >
  520. <template slot-scope="scope">
  521. <CopyButton :copyText="scope.row.materialName" />
  522. <span>{{scope.row.materialName}}</span>
  523. </template>
  524. </el-table-column>
  525. <el-table-column
  526. align="left"
  527. label="规格型号"
  528. prop="specification"
  529. min-width="160"
  530. show-overflow-tooltip
  531. >
  532. <template slot-scope="scope">
  533. <CopyButton :copyText="scope.row.specification" />
  534. <span>{{scope.row.specification}}</span>
  535. </template>
  536. </el-table-column>
  537. <el-table-column
  538. align="left"
  539. label="单位"
  540. prop="unit"
  541. min-width="100"
  542. show-overflow-tooltip
  543. />
  544. <el-table-column
  545. align="right"
  546. label="订单数量"
  547. prop="qty"
  548. min-width="100"
  549. show-overflow-tooltip
  550. />
  551. <!-- refundableQty -->
  552. <el-table-column
  553. align="right"
  554. label="发货数量"
  555. prop="hasSendQty"
  556. min-width="100"
  557. show-overflow-tooltip
  558. />
  559. <el-table-column
  560. align="right"
  561. label="直调数量"
  562. prop="adjustNum"
  563. min-width="100"
  564. show-overflow-tooltip
  565. >
  566. <template slot-scope="scope">
  567. <el-input
  568. v-model="scope.row.adjustNum"
  569. size="small"
  570. type="number"
  571. :disabled="!scope.row.isDirectTransfer"
  572. />
  573. </template>
  574. </el-table-column>
  575. <el-table-column
  576. align="right"
  577. label="单价"
  578. prop="price"
  579. min-width="100"
  580. show-overflow-tooltip
  581. >
  582. <template slot-scope="scope">
  583. {{ scope.row.price | numToFixed }}
  584. </template>
  585. </el-table-column>
  586. <el-table-column
  587. align="right"
  588. label="金额"
  589. prop="totalAmount"
  590. min-width="100"
  591. show-overflow-tooltip
  592. >
  593. <template slot-scope="scope">
  594. {{ scope.row.totalAmount | numToFixed }}
  595. </template>
  596. </el-table-column>
  597. <el-table-column
  598. align="right"
  599. label="返利"
  600. prop="payRebateAmount"
  601. min-width="100"
  602. show-overflow-tooltip
  603. >
  604. <template slot-scope="scope">
  605. {{ scope.row.payRebateAmount | numToFixed }}
  606. </template>
  607. </el-table-column>
  608. <el-table-column
  609. align="left"
  610. label="表体备注"
  611. prop="itemRemark"
  612. min-width="160"
  613. show-overflow-tooltip
  614. />
  615. </el-table>
  616. </div>
  617. <span slot="footer" class="dialog-footer">
  618. <el-button @click="closeDeliverDialog">取 消</el-button>
  619. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  620. </span>
  621. </el-dialog>
  622. <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
  623. </div>
  624. </template>
  625. <script>
  626. import { getDetail } from '@/api/supply/policy'
  627. import { adjustDeliver, directOrder, finishData, getPositionList, getWarehouseList } from '@/api/supply/retail'
  628. import { mapState } from 'vuex'
  629. import CheckOrder from '@/components/Common/check-order'
  630. export default {
  631. name: 'RetailDetail',
  632. componentName: 'RetailDetail',
  633. components: {
  634. CheckOrder
  635. },
  636. filters: {
  637. statusFilter(val, time) {
  638. const statusList = [
  639. { label: '已保存', value: 'SAVE' },
  640. { label: '待审核', value: 'WAIT' },
  641. { label: '审核通过', value: 'OK' },
  642. // { label: '审核驳回', value: 'FAIL' },
  643. ]
  644. const obj = statusList.find((o) => o.value === val)
  645. if (!time) {
  646. return obj ? obj.label : ''
  647. } else {
  648. return val === 'SAVE' && time ? '驳回' : obj.label
  649. }
  650. }
  651. },
  652. props: ['listItem'],
  653. data() {
  654. return {
  655. detailData: {},
  656. isShowDeliverDialog: false,
  657. deliverForm: {
  658. date: '',
  659. position: ''
  660. },
  661. deliverFormRules: {
  662. date: [
  663. { required: true, message: '请选择发货日期', trigger: 'change' }
  664. ],
  665. position: [
  666. { required: true, message: '请选择虚拟仓位', trigger: 'change' }
  667. ]
  668. },
  669. positionList: [],
  670. goodsList: [],
  671. isShowDirectDialog: false,
  672. directForm: {
  673. warehouse1: '',
  674. position1: '',
  675. warehouse2: '',
  676. position2: ''
  677. },
  678. directFormRules: {
  679. warehouse1: [
  680. { required: true, message: '请选择调出仓库', trigger: 'change' }
  681. ],
  682. position1: [
  683. { required: true, message: '请选择调出仓位', trigger: 'change' }
  684. ],
  685. warehouse2: [
  686. { required: true, message: '请选择调入仓库', trigger: 'change' }
  687. ],
  688. position2: [
  689. { required: true, message: '请选择调入仓位', trigger: 'change' }
  690. ]
  691. },
  692. warehouseList1: [],
  693. warehouseList2: [],
  694. positionList1: [],
  695. positionList2: [],
  696. directGoodsList: [],
  697. status: false,
  698. checkOrderId: {},
  699. isShowCheckOrder: false
  700. }
  701. },
  702. computed: {
  703. sidebar() {
  704. return this.$store.state.app.sidebar
  705. },
  706. classObj() {
  707. return {
  708. hideSidebar: !this.sidebar.opened,
  709. openSidebar: this.sidebar.opened
  710. }
  711. },
  712. isExamine() {
  713. return (
  714. this.detailData.examineStatus === 'OK' ||
  715. this.detailData.examineStatus === 'FAIL'
  716. )
  717. },
  718. isDealer() {
  719. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  720. },
  721. progress() {
  722. if (this.detailData.totalQty == 0) return 0
  723. return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100)
  724. },
  725. ...mapState({
  726. isCustomer: ({ user }) => {
  727. return !(user.customerName || user.customerNumber)
  728. }
  729. })
  730. },
  731. created() {
  732. this.getDetail()
  733. this.deliverForm.date = this.getDate()
  734. },
  735. methods: {
  736. getDate() {
  737. var date = new Date();
  738. var seperator1 = "-";
  739. var year = date.getFullYear();
  740. var month = date.getMonth() + 1;
  741. var strDate = date.getDate();
  742. if (month >= 1 && month <= 9) {
  743. month = "0" + month;
  744. }
  745. if (strDate >= 0 && strDate <= 9) {
  746. strDate = "0" + strDate;
  747. }
  748. var currentdate = year + seperator1 + month + seperator1 + strDate;
  749. return currentdate;
  750. },
  751. // 返回列表
  752. goBack() {
  753. this.$emit('backListFormDetail')
  754. },
  755. // 是否直调完成
  756. directTransferStatus(val) {
  757. this.status = val.retailOrderItemList.some((k) => {
  758. return k.directTransferStatus == true
  759. })
  760. console.log(this.status, '4554545')
  761. },
  762. // 获取详情
  763. getDetail() {
  764. getDetail({ id: this.listItem.id }).then((res) => {
  765. if (res.data.retailOrderItemList) {
  766. res.data.retailOrderItemList.forEach((item) => {
  767. item.sums1 = [
  768. 'directTransferQty',
  769. 'qty',
  770. 'refundableQty',
  771. 'oldQty'
  772. ]
  773. item.sums2 = [
  774. 'totalAmount',
  775. 'payAmount',
  776. 'price',
  777. 'payRebateAmount',
  778. 'discAmount',
  779. 'totalDiscAmount'
  780. ]
  781. })
  782. }
  783. this.detailData = res.data
  784. this.directTransferStatus(res.data)
  785. })
  786. },
  787. // 直调完成
  788. handleFinish() {
  789. this.$confirm('此操作将直调完成, 是否继续?', '提示', {
  790. confirmButtonText: '确定',
  791. cancelButtonText: '取消',
  792. type: 'warning'
  793. })
  794. .then(() => {
  795. finishData({
  796. id: this.listItem.id
  797. }).then((res) => {
  798. this.$successMsg()
  799. this.getDetail()
  800. })
  801. })
  802. .catch(() => {})
  803. },
  804. // 获取仓库列表
  805. getWarehouseList() {
  806. getWarehouseList({
  807. pageNum: 1,
  808. pageSize: -1
  809. }).then((res) => {
  810. this.warehouseList = res.data.records
  811. })
  812. },
  813. // 更改仓库
  814. changeWarehouse() {
  815. this.deliverForm.position = ''
  816. const obj = this.warehouseList.find(
  817. (o) => o.id == this.deliverForm.warehouse
  818. )
  819. this.positionList = obj.kingDeeStocks
  820. },
  821. // 打开 直调发货
  822. openDeliverDialog() {
  823. this.isShowDeliverDialog = true
  824. this.detailData.retailOrderItemList.forEach(item => {
  825. if(item.isDirectTransfer){
  826. this.$set(item,'adjustNum',item.refundableQty)
  827. }else{
  828. this.$set(item,'adjustNum',0)
  829. }
  830. })
  831. this.goodsList = this.detailData.retailOrderItemList
  832. this.getPositionList()
  833. },
  834. // 获取虚拟仓位列表
  835. getPositionList() {
  836. getPositionList({
  837. pageNum: 1,
  838. pageSize: -1,
  839. type: 2
  840. }).then(res => {
  841. this.positionList = res.data.records
  842. })
  843. },
  844. // 关闭 直调发货
  845. closeDeliverDialog() {
  846. this.isShowDeliverDialog = false
  847. },
  848. // 联查单据
  849. toCheckOrder() {
  850. this.checkOrderId = this.detailData.id
  851. this.isShowCheckOrder = true
  852. },
  853. // 关闭 提前开票
  854. closeDirectDialog() {
  855. this.isShowDirectDialog = false
  856. },
  857. // 更改调出仓库
  858. changeWarehouse1() {
  859. this.directForm.position1 = ''
  860. const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  861. this.positionList1 = obj.kingDeeStocks
  862. this.directGoodsList.forEach(item => {
  863. item.warehouse1 = obj.name
  864. })
  865. },
  866. // 更改调入仓库
  867. changeWarehouse2() {
  868. this.directForm.position2 = ''
  869. const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  870. this.positionList2 = obj.kingDeeStocks
  871. this.directGoodsList.forEach(item => {
  872. item.warehouse2 = obj.name
  873. })
  874. },
  875. // 获取仓库列表
  876. getWarehouseList() {
  877. getWarehouseList({
  878. pageNum: 1,
  879. pageSize: -1
  880. }).then(res => {
  881. this.warehouseList1 = res.data.records
  882. this.warehouseList2 = res.data.records
  883. })
  884. },
  885. // 更改调出仓位
  886. changePosition1() {
  887. const obj = this.positionList1.find(o => o.id == this.directForm.position1)
  888. this.directGoodsList.forEach(item => {
  889. item.position1 = obj.name
  890. item.status1 = obj.defStockStatusName
  891. })
  892. },
  893. // 更改调入仓位
  894. changePosition2() {
  895. const obj = this.positionList2.find(o => o.id == this.directForm.position2)
  896. this.directGoodsList.forEach(item => {
  897. item.position2 = obj.name
  898. item.status2 = obj.defStockStatusName
  899. })
  900. },
  901. // 提交 提前开票
  902. submitDirectForm() {
  903. this.$refs.directForm.validate((valid) => {
  904. if (valid) {
  905. const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  906. const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
  907. const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  908. const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
  909. const params = {
  910. orderNo: this.detailData.id,
  911. orderType: 'RETAIL', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  912. correspondId: this.directForm.warehouse1,
  913. correspondName: warehouseItem1.name,
  914. stockId: this.directForm.position1,
  915. stockName: positionItem1.name,
  916. inCorrespondId: this.directForm.warehouse2,
  917. inCorrespondName: warehouseItem2.name,
  918. inStockId: this.directForm.position2,
  919. inStockName: positionItem2.name
  920. }
  921. directOrder(params).then(res => {
  922. this.$successMsg()
  923. this.isShowDirectDialog = false
  924. this.getDetail()
  925. })
  926. }
  927. })
  928. },
  929. backDetail() {
  930. this.isShowCheckOrder = false
  931. },
  932. // 提交 直调发货
  933. submitDeliverForm() {
  934. this.$refs.deliverForm.validate((valid) => {
  935. if (valid) {
  936. for (let i = 0; i < this.goodsList.length; i++) {
  937. if (
  938. !this.goodsList[i].adjustNum &&
  939. this.goodsList[i].isDirectTransfer
  940. ) {
  941. this.$errorMsg('请输入直调数量')
  942. return
  943. }
  944. }
  945. const goodsList = this.goodsList.map((item) => {
  946. return {
  947. itemId: item.id,
  948. qty: item.adjustNum || 0
  949. }
  950. })
  951. const params = {
  952. orderNo: this.listItem.id,
  953. orderDate: this.deliverForm.date + ' 00:00:00',
  954. correspondId: this.deliverForm.position,
  955. directItems: goodsList
  956. }
  957. adjustDeliver(params).then((res) => {
  958. this.$successMsg()
  959. this.isShowDeliverDialog = false
  960. this.getDetail()
  961. })
  962. }
  963. })
  964. },
  965. // 打开 提前开票
  966. openDirectDialog() {
  967. this.isShowDirectDialog = true
  968. this.directGoodsList = this.detailData.retailOrderItemList
  969. this.getWarehouseList()
  970. }
  971. }
  972. }
  973. </script>
  974. <style scoped lang="scss">
  975. .detail-container {
  976. width: 100%;
  977. height: 100%;
  978. margin-bottom: 80px;
  979. }
  980. .main-title {
  981. display: flex;
  982. justify-content: space-between;
  983. align-items: center;
  984. margin-top: 20px;
  985. height: 60px;
  986. border-bottom: 1px solid #dcdfe6;
  987. margin-bottom: 20px;
  988. .title {
  989. font-size: 16px;
  990. font-weight: 600;
  991. padding-left: 10px;
  992. }
  993. }
  994. .progress-container {
  995. display: flex;
  996. .el-progress {
  997. width: 500px;
  998. }
  999. }
  1000. .page-footer{
  1001. height: 0;
  1002. }
  1003. </style>