retail_detail.vue 27 KB

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