retail_detail.vue 25 KB

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