retail_detail.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowCheckOrder">
  4. <el-page-header @back="goBack" content="详情"></el-page-header>
  5. <div class="main-title">
  6. <div class="title">提货进度</div>
  7. </div>
  8. <div class="progress-container">
  9. <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 1000 / 10) : 0"></el-progress>
  10. </div>
  11. <div class="main-title">
  12. <div class="title">订单信息</div>
  13. </div>
  14. <div class="diy-table-1">
  15. <el-row>
  16. <el-col :span="8" class="item">
  17. <div class="label">订单号</div>
  18. <div class="value">{{detailData.id}}</div>
  19. </el-col>
  20. <el-col :span="8" class="item">
  21. <div class="label">订单日期</div>
  22. <div class="value">{{detailData.theTime | dateToDayFilter}}</div>
  23. </el-col>
  24. <el-col :span="8" class="item">
  25. <div class="label">单据状态</div>
  26. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  27. </el-col>
  28. <el-col :span="8" class="item">
  29. <div class="label">业务员</div>
  30. <div class="value">{{detailData.k3ServiceName}}</div>
  31. </el-col>
  32. <el-col :span="16" class="item">
  33. <div class="label">文件编号</div>
  34. <div class="value">{{detailData.fileNo}}</div>
  35. </el-col>
  36. <el-col :span="24" class="item">
  37. <div class="label">备注</div>
  38. <div class="value">{{detailData.remark}}</div>
  39. </el-col>
  40. <el-col :span="8" class="item">
  41. <div class="label">制单人</div>
  42. <div class="value">{{detailData.createName}}</div>
  43. </el-col>
  44. <el-col :span="8" class="item">
  45. <div class="label">制单日期</div>
  46. <div class="value">{{detailData.createTime}}</div>
  47. </el-col>
  48. <el-col :span="8" class="item">
  49. <div class="label">审核人</div>
  50. <div class="value">{{detailData.examineName}}</div>
  51. </el-col>
  52. <el-col :span="8" class="item">
  53. <div class="label">审核日期</div>
  54. <div class="value">{{detailData.examineTime}}</div>
  55. </el-col>
  56. <el-col :span="8" class="item">
  57. <div class="label">关闭人</div>
  58. <div class="value">{{detailData.closeName}}</div>
  59. </el-col>
  60. <el-col :span="8" class="item">
  61. <div class="label">关闭日期</div>
  62. <div class="value">{{detailData.closeTime}}</div>
  63. </el-col>
  64. </el-row>
  65. </div>
  66. <div class="main-title">
  67. <div class="title">货品信息</div>
  68. </div>
  69. <div class="table" style="margin-top: 20px">
  70. <el-table
  71. :data="detailData.retailOrderItemList"
  72. element-loading-text="Loading"
  73. border
  74. fit
  75. highlight-current-row
  76. stripe
  77. max-height="400"
  78. show-summary
  79. :summary-method="$getSummaries">
  80. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  81. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  82. <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  84. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="文件编号" prop="fileNo" min-width="100" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. {{ scope.row.price | numToFixed }}
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  95. <template slot-scope="scope">
  96. {{ scope.row.totalAmount | numToFixed }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="140" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. {{ scope.row.payRebateAmount | numToFixed }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  106. <template slot-scope="scope">
  107. {{ scope.row.totalDiscAmount | numToFixed }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="140" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. {{ scope.row.payAmount | numToFixed }}
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  117. <template slot-scope="scope">
  118. {{scope.row.isDirectTransfer ? '是':'否'}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  122. <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
  123. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  124. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  125. </el-table>
  126. </div>
  127. <div>
  128. <div class="main-title">
  129. <div class="title">审批记录</div>
  130. </div>
  131. <div class="diy-table-1">
  132. <el-row :gutter="0">
  133. <el-col :span="12" class="item">
  134. <div class="label">审批人</div>
  135. <div class="value">{{detailData.examineName}}</div>
  136. </el-col>
  137. <el-col :span="12" class="item">
  138. <div class="label">审批结果</div>
  139. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  140. </el-col>
  141. <el-col :span="24" class="item">
  142. <div class="label">审批说明</div>
  143. <div class="value">{{detailData.examineRemark}}</div>
  144. </el-col>
  145. </el-row>
  146. </div>
  147. </div>
  148. <div class="page-footer">
  149. <div class="footer">
  150. <el-button type="success" @click="toCheckOrder">联查单据</el-button>
  151. <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">提前开票</el-button>
  152. <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true" v-if="!isDealer">直调发货</el-button>
  153. <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">直调完成</el-button>
  154. <el-button @click="goBack">关 闭</el-button>
  155. </div>
  156. </div>
  157. </div>
  158. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  159. <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="80px" size="small" label-position="left">
  160. <el-row :gutter="20">
  161. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
  162. <el-form-item label="发货日期" prop="date">
  163. <el-date-picker
  164. v-model="deliverForm.date"
  165. type="date"
  166. disabled
  167. value-format="yyyy-MM-dd"
  168. style="width: 100%;"
  169. placeholder="选择日期">
  170. </el-date-picker>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :xs="8" :sm="8" :lg="8">
  174. <el-form-item label="选择仓位" prop="position">
  175. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  176. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  177. </el-select>
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. </el-form>
  182. <div class="table" style="margin-top: 20px">
  183. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  184. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  185. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  186. <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
  187. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  188. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  189. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  190. <!-- <el-table-column align="left" label="文件编号" prop="fileNo" min-width="200" show-overflow-tooltip>
  191. </el-table-column> -->
  192. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  193. <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  194. <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  195. <el-table-column align="right" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. <el-input v-model="scope.row.adjustNum" size="small" type="number" :disabled="!scope.row.isDirectTransfer"></el-input>
  198. </template>
  199. </el-table-column>
  200. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  201. <template slot-scope="scope">
  202. {{ scope.row.price | numToFixed }}
  203. </template>
  204. </el-table-column>
  205. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  206. <template slot-scope="scope">
  207. {{ scope.row.totalAmount | numToFixed }}
  208. </template>
  209. </el-table-column>
  210. <el-table-column align="right" label="返利" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  211. <template slot-scope="scope">
  212. {{ scope.row.payRebateAmount | numToFixed }}
  213. </template>
  214. </el-table-column>
  215. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  216. <template slot-scope="scope">
  217. {{ scope.row.payAmount | numToFixed }}
  218. </template>
  219. </el-table-column>
  220. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  221. </el-table>
  222. </div>
  223. <span slot="footer" class="dialog-footer">
  224. <el-button @click="closeDeliverDialog">取 消</el-button>
  225. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  226. </span>
  227. </el-dialog>
  228. <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
  229. <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
  230. <el-row :gutter="20">
  231. <el-col :xs="12" :sm="6" :lg="6">
  232. <el-form-item label="调出仓库" prop="warehouse1">
  233. <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
  234. <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  235. </el-select>
  236. </el-form-item>
  237. </el-col>
  238. <el-col :xs="12" :sm="6" :lg="6">
  239. <el-form-item label="调出仓位" prop="position1">
  240. <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
  241. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  242. </el-select>
  243. </el-form-item>
  244. </el-col>
  245. <el-col :xs="12" :sm="6" :lg="6">
  246. <el-form-item label="调入仓库" prop="warehouse2">
  247. <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
  248. <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  249. </el-select>
  250. </el-form-item>
  251. </el-col>
  252. <el-col :xs="12" :sm="6" :lg="6">
  253. <el-form-item label="调入仓位" prop="position2">
  254. <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
  255. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. </el-form>
  261. <div class="table" style="margin-top: 20px">
  262. <el-table :data="directGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  263. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  264. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  265. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  266. <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  267. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  268. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  269. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  270. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  271. <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
  272. <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
  273. <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
  274. <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
  275. <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
  276. <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
  277. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  278. <template slot-scope="">弘格</template>
  279. </el-table-column>
  280. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  281. <template slot-="scope">弘格</template>
  282. </el-table-column>
  283. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  284. </el-table>
  285. </div>
  286. <span slot="footer" class="dialog-footer">
  287. <el-button @click="closeDirectDialog">取 消</el-button>
  288. <el-button type="primary" @click="submitDirectForm">确 定</el-button>
  289. </span>
  290. </el-dialog>
  291. <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
  292. </div>
  293. </template>
  294. <script>
  295. import { getDetail, getWarehouseList, adjustDeliver, finishData, directOrder, getPositionList } from "@/api/supply/retail";
  296. import CheckOrder from "@/components/Common/check-order";
  297. export default {
  298. name: 'RetailDetail',
  299. componentName: 'RetailDetail',
  300. components: {
  301. CheckOrder,
  302. },
  303. props: ['listItem'],
  304. filters: {
  305. statusFilter(val) {
  306. const statusList = [
  307. { label: '已保存', value: 'SAVE' },
  308. { label: '待审核', value: 'WAIT' },
  309. { label: '审核通过', value: 'OK' },
  310. // { label: '审核驳回', value: 'FAIL' },,
  311. ];
  312. let obj = statusList.find(o => o.value == val);
  313. return obj ? obj.label : ''
  314. }
  315. },
  316. data() {
  317. return {
  318. detailData: {},
  319. isShowDeliverDialog: false,
  320. deliverForm: {
  321. date: '',
  322. position: '',
  323. },
  324. deliverFormRules: {
  325. date: [
  326. { required: true, message: '请选择发货日期', trigger: 'change' }
  327. ],
  328. position: [
  329. { required: true, message: '请选择虚拟仓位', trigger: 'change' }
  330. ],
  331. },
  332. positionList: [],
  333. goodsList: [],
  334. isShowDirectDialog: false,
  335. directForm: {
  336. warehouse1: '',
  337. position1: '',
  338. warehouse2: '',
  339. position2: '',
  340. },
  341. directFormRules: {
  342. warehouse1: [
  343. { required: true, message: '请选择调出仓库', trigger: 'change' }
  344. ],
  345. position1: [
  346. { required: true, message: '请选择调出仓位', trigger: 'change' }
  347. ],
  348. warehouse2: [
  349. { required: true, message: '请选择调入仓库', trigger: 'change' }
  350. ],
  351. position2: [
  352. { required: true, message: '请选择调入仓位', trigger: 'change' }
  353. ],
  354. },
  355. warehouseList1: [],
  356. warehouseList2: [],
  357. positionList1: [],
  358. positionList2: [],
  359. directGoodsList: [],
  360. checkOrderId: {},
  361. isShowCheckOrder: false,
  362. }
  363. },
  364. computed: {
  365. isExamine() {
  366. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  367. },
  368. isDealer() {
  369. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  370. },
  371. },
  372. created() {
  373. this.getDetail();
  374. this.deliverForm.date = this.getDate()
  375. },
  376. methods: {
  377. getDate() {
  378. var date = new Date();
  379. var seperator1 = "-";
  380. var year = date.getFullYear();
  381. var month = date.getMonth() + 1;
  382. var strDate = date.getDate();
  383. if (month >= 1 && month <= 9) {
  384. month = "0" + month;
  385. }
  386. if (strDate >= 0 && strDate <= 9) {
  387. strDate = "0" + strDate;
  388. }
  389. var currentdate = year + seperator1 + month + seperator1 + strDate;
  390. return currentdate;
  391. },
  392. // 返回列表
  393. goBack() {
  394. this.$emit('backListFormDetail');
  395. },
  396. // 获取详情
  397. getDetail() {
  398. getDetail({id: this.listItem.id}).then(res => {
  399. if(res.data.retailOrderItemList) {
  400. res.data.retailOrderItemList.forEach(item => {
  401. item.sums1 = ['directTransferQty', 'qty', 'refundableQty', 'oldQty'];
  402. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount', 'totalDiscAmount'];
  403. })
  404. }
  405. this.detailData = res.data;
  406. })
  407. },
  408. // 获取仓库列表
  409. getWarehouseList() {
  410. getWarehouseList({
  411. pageNum: 1,
  412. pageSize: -1,
  413. }).then(res => {
  414. this.warehouseList1 = res.data.records;
  415. this.warehouseList2 = res.data.records;
  416. })
  417. },
  418. // 获取虚拟仓位列表
  419. getPositionList() {
  420. getPositionList({
  421. pageNum: 1,
  422. pageSize: -1,
  423. type: 2
  424. }).then(res => {
  425. this.positionList = res.data.records;
  426. })
  427. },
  428. // 打开 直调发货
  429. openDeliverDialog() {
  430. this.isShowDeliverDialog = true;
  431. this.detailData.retailOrderItemList.forEach(item => {
  432. if(item.isDirectTransfer){
  433. this.$set(item,'adjustNum',item.refundableQty || item.qty)
  434. }else{
  435. this.$set(item,'adjustNum',0)
  436. }
  437. })
  438. this.goodsList = this.detailData.retailOrderItemList;
  439. this.getPositionList();
  440. },
  441. // 关闭 直调发货
  442. closeDeliverDialog() {
  443. this.isShowDeliverDialog = false;
  444. },
  445. // 提交 直调发货
  446. submitDeliverForm() {
  447. this.$refs.deliverForm.validate((valid) => {
  448. if (valid) {
  449. for(let i=0; i<this.goodsList.length; i++) {
  450. if(!this.goodsList[i].adjustNum && this.goodsList[i].isDirectTransfer) {
  451. this.$errorMsg('请输入直调数量');
  452. return;
  453. }
  454. }
  455. let goodsList = this.goodsList.map((item) => {
  456. return {
  457. itemId: item.id,
  458. qty: item.adjustNum || 0,
  459. }
  460. });
  461. let params = {
  462. orderNo: this.listItem.id,
  463. orderDate: this.deliverForm.date + ' 00:00:00',
  464. correspondId: this.deliverForm.position,
  465. directItems: goodsList
  466. }
  467. adjustDeliver(params).then(res => {
  468. this.$successMsg();
  469. this.isShowDeliverDialog = false;
  470. this.getDetail();
  471. })
  472. }
  473. })
  474. },
  475. // 直调完成
  476. handleFinish() {
  477. this.$confirm('此操作将直调完成, 是否继续?', '提示', {
  478. confirmButtonText: '确定',
  479. cancelButtonText: '取消',
  480. type: 'warning'
  481. }).then(() => {
  482. finishData({
  483. id: this.listItem.id
  484. }).then(res => {
  485. this.$successMsg();
  486. this.getDetail();
  487. })
  488. }).catch(() => {});
  489. },
  490. // 更改调出仓库
  491. changeWarehouse1() {
  492. this.directForm.position1 = '';
  493. let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  494. this.positionList1 = obj.kingDeeStocks;
  495. this.directGoodsList.forEach(item => {
  496. item.warehouse1 = obj.name;
  497. });
  498. },
  499. // 更改调入仓库
  500. changeWarehouse2() {
  501. this.directForm.position2 = '';
  502. let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  503. this.positionList2 = obj.kingDeeStocks;
  504. this.directGoodsList.forEach(item => {
  505. item.warehouse2 = obj.name;
  506. });
  507. },
  508. // 更改调出仓位
  509. changePosition1() {
  510. let obj = this.positionList1.find(o => o.id == this.directForm.position1);
  511. this.directGoodsList.forEach(item => {
  512. item.position1 = obj.name;
  513. item.status1 = obj.defStockStatusName;
  514. });
  515. },
  516. // 更改调入仓位
  517. changePosition2() {
  518. let obj = this.positionList2.find(o => o.id == this.directForm.position2);
  519. this.directGoodsList.forEach(item => {
  520. item.position2 = obj.name;
  521. item.status2 = obj.defStockStatusName;
  522. });
  523. },
  524. // 打开 提前开票
  525. openDirectDialog() {
  526. this.isShowDirectDialog = true;
  527. this.directGoodsList = this.detailData.retailOrderItemList;
  528. this.getWarehouseList();
  529. },
  530. // 关闭 提前开票
  531. closeDirectDialog() {
  532. this.isShowDirectDialog = false;
  533. },
  534. // 提交 提前开票
  535. submitDirectForm() {
  536. this.$refs.directForm.validate((valid) => {
  537. if (valid) {
  538. let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  539. let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
  540. let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  541. let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
  542. let params = {
  543. orderNo: this.detailData.id,
  544. orderType: 'RETAIL', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  545. correspondId: this.directForm.warehouse1,
  546. correspondName: warehouseItem1.name,
  547. stockId: this.directForm.position1,
  548. stockName: positionItem1.name,
  549. inCorrespondId: this.directForm.warehouse2,
  550. inCorrespondName: warehouseItem2.name,
  551. inStockId: this.directForm.position2,
  552. inStockName: positionItem2.name,
  553. }
  554. directOrder(params).then(res => {
  555. this.$successMsg();
  556. this.isShowDirectDialog = false;
  557. this.getDetail();
  558. })
  559. }
  560. })
  561. },
  562. // 联查单据
  563. toCheckOrder() {
  564. this.checkOrderId = this.detailData.id;
  565. this.isShowCheckOrder = true;
  566. },
  567. backDetail() {
  568. this.isShowCheckOrder = false;
  569. },
  570. }
  571. }
  572. </script>
  573. <style scoped lang="scss">
  574. .detail-container {
  575. width: 100%;
  576. height: 100%;
  577. }
  578. .main-title {
  579. display: flex;
  580. justify-content: space-between;
  581. align-items: center;
  582. margin-top: 20px;
  583. height: 60px;
  584. border-bottom: 1px solid #DCDFE6;
  585. margin-bottom: 20px;
  586. .title {
  587. font-size: 16px;
  588. font-weight: 600;
  589. padding-left: 10px;
  590. }
  591. }
  592. .progress-container {
  593. display: flex;
  594. .el-progress {
  595. width: 500px;
  596. }
  597. }
  598. </style>