retail_detail.vue 26 KB

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