commerce_detail.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="详情"></el-page-header>
  4. <div id="printData">
  5. <div class="main-title">
  6. <div class="title">工程订单</div>
  7. </div>
  8. <div class="diy-table-1">
  9. <el-row>
  10. <el-col :span="8" class="item">
  11. <div class="label">工程订单号</div>
  12. <div class="value">{{detailData.enginOrderId}}</div>
  13. </el-col>
  14. <el-col :span="8" class="item">
  15. <div class="label">订单日期</div>
  16. <div class="value">{{detailData.orderDate}}</div>
  17. </el-col>
  18. <el-col :span="8" class="item">
  19. <div class="label">单据状态</div>
  20. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  21. </el-col>
  22. <el-col :span="8" class="item">
  23. <div class="label">经销商编码</div>
  24. <div class="value">{{detailData.customerId}}</div>
  25. </el-col>
  26. <el-col :span="16" class="item">
  27. <div class="label">经销商名称</div>
  28. <div class="value">{{detailData.customerName}}</div>
  29. </el-col>
  30. <el-col :span="8" class="item">
  31. <div class="label">工程信息编号</div>
  32. <div class="value">{{detailData.refEnginRecordNo}}</div>
  33. </el-col>
  34. <el-col :span="8" class="item">
  35. <div class="label">工程项目名称</div>
  36. <div class="value">{{detailData.refProjectName}}</div>
  37. </el-col>
  38. <el-col :span="8" class="item">
  39. <div class="label">工程登录类型</div>
  40. <div class="value">{{detailData.refPromiseStatus}}</div>
  41. </el-col>
  42. <el-col :span="8" class="item">
  43. <div class="label">厂工程编码</div>
  44. <div class="value">{{detailData.refFactoryNo}}</div>
  45. </el-col>
  46. <el-col :span="8" class="item">
  47. <div class="label">使用单位</div>
  48. <div class="value">{{detailData.refUseUnit}}</div>
  49. </el-col>
  50. <el-col :span="8" class="item">
  51. <div class="label">销售类型</div>
  52. <div class="value">{{detailData.saleTypeName}}</div>
  53. </el-col>
  54. <el-col :span="8" class="item">
  55. <div class="label">联系人</div>
  56. <div class="value">{{detailData.aaa}}</div>
  57. </el-col>
  58. <el-col :span="8" class="item">
  59. <div class="label">固定电话</div>
  60. <div class="value">{{detailData.aaa}}</div>
  61. </el-col>
  62. <el-col :span="8" class="item">
  63. <div class="label">移动电话</div>
  64. <div class="value">{{detailData.aaa}}</div>
  65. </el-col>
  66. <el-col :span="8" class="item">
  67. <div class="label">不扣押金</div>
  68. <div class="value">{{detailData.takeDeposit ? '是':'否'}}</div>
  69. </el-col>
  70. <el-col :span="8" class="item">
  71. <div class="label">文件编码</div>
  72. <div class="value">{{detailData.fileNo}}</div>
  73. </el-col>
  74. <el-col :span="8" class="item">
  75. <div class="label">业务员</div>
  76. <div class="value">{{detailData.serviceName}}</div>
  77. </el-col>
  78. <el-col :span="24" class="item">
  79. <div class="label">格力回复</div>
  80. <div class="value">{{detailData.note1}}</div>
  81. </el-col>
  82. <el-col :span="24" class="item">
  83. <div class="label">格力内部备注</div>
  84. <div class="value">{{detailData.note2}}</div>
  85. </el-col>
  86. <el-col :span="24" class="item">
  87. <div class="label">备注</div>
  88. <div class="value">{{detailData.remark}}</div>
  89. </el-col>
  90. <el-col :span="6" class="item">
  91. <div class="label">制单人</div>
  92. <div class="value">{{detailData.createName}}</div>
  93. </el-col>
  94. <el-col :span="6" class="item">
  95. <div class="label">制单日期</div>
  96. <div class="value">{{detailData.createTime}}</div>
  97. </el-col>
  98. <el-col :span="6" class="item">
  99. <div class="label">审核人</div>
  100. <div class="value">{{detailData.confirmName}}</div>
  101. </el-col>
  102. <el-col :span="6" class="item">
  103. <div class="label">审核日期</div>
  104. <div class="value">{{detailData.confirmTime}}</div>
  105. </el-col>
  106. <el-col :span="6" class="item">
  107. <div class="label">最后更新人</div>
  108. <div class="value">{{detailData.updateName}}</div>
  109. </el-col>
  110. <el-col :span="6" class="item">
  111. <div class="label">最后更新日期</div>
  112. <div class="value">{{detailData.updateTime}}</div>
  113. </el-col>
  114. <el-col :span="6" class="item">
  115. <div class="label">关闭人</div>
  116. <div class="value">{{detailData.closeName}}</div>
  117. </el-col>
  118. <el-col :span="6" class="item">
  119. <div class="label">关闭日期</div>
  120. <div class="value">{{detailData.closeTime}}</div>
  121. </el-col>
  122. <el-col :span="24" class="item" v-if="isExamine">
  123. <div class="label">审批说明</div>
  124. <div class="value">{{detailData.examineNote}}</div>
  125. </el-col>
  126. </el-row>
  127. </div>
  128. <div class="main-title">
  129. <div class="title">货品信息</div>
  130. </div>
  131. <div class="table" style="margin-top: 20px">
  132. <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  133. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  134. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
  135. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  136. <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  137. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  138. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  139. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  140. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  141. <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
  142. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  143. <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  144. <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  145. <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
  146. <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
  147. <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
  148. <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  149. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  150. <template slot-scope="scope">
  151. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  155. <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  156. <el-table-column align="center" label="已退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  157. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  158. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  159. </el-table>
  160. </div>
  161. </div>
  162. <div class="page-footer">
  163. <div class="footer" :class="classObj">
  164. <el-button type="danger" @click="closeData">关闭订单</el-button>
  165. <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
  166. <el-button type="primary" @click="overData">直调完结</el-button>
  167. <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
  168. <el-button @click="goBack">返回</el-button>
  169. </div>
  170. </div>
  171. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  172. <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="80px" size="small" label-position="left">
  173. <el-row :gutter="20">
  174. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
  175. <el-form-item label="发货日期" prop="date">
  176. <el-date-picker
  177. v-model="deliverForm.date"
  178. type="date"
  179. value-format="yyyy-MM-dd"
  180. style="width: 100%;"
  181. placeholder="选择日期">
  182. </el-date-picker>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :xs="8" :sm="8" :lg="8">
  186. <el-form-item label="发货仓库" prop="warehouse">
  187. <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库" style="width: 100%" filterable @change="changeWarehouse">
  188. <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  189. </el-select>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :xs="8" :sm="8" :lg="8">
  193. <el-form-item label="选择仓位" prop="position">
  194. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  195. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  196. </el-select>
  197. </el-form-item>
  198. </el-col>
  199. </el-row>
  200. </el-form>
  201. <div class="table" style="margin-top: 20px">
  202. <el-table :data="deliverGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  203. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  204. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  205. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  206. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  207. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  208. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  209. <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  210. <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  211. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
  212. <template slot-scope="scope">
  213. <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number"></el-input>
  214. </template>
  215. </el-table-column>
  216. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  217. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  218. <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></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. </div>
  291. </template>
  292. <script>
  293. import { getOrderDetail, closeCom, overOrder, getWarehouseList, deliverOrder, directOrder } from "@/api/supply/engin";
  294. export default {
  295. name: 'CommerceDetail',
  296. componentName: 'CommerceDetail',
  297. props: ['listItem'],
  298. filters: {
  299. statusFilter(val) {
  300. const statusList = [
  301. { label: '已保存', value: 'SAVE' },
  302. { label: '待审核', value: 'WAIT' },
  303. { label: '审核通过', value: 'OK' },
  304. { label: '审核驳回', value: 'FAIL' },
  305. { label: '已关闭', value: 'CLOSE' },
  306. ];
  307. let obj = statusList.find(o => o.value == val);
  308. return obj ? obj.label : ''
  309. }
  310. },
  311. data() {
  312. return {
  313. detailData: {},
  314. isShowDeliverDialog: false,
  315. deliverForm: {
  316. date: '',
  317. warehouse: '',
  318. position: '',
  319. },
  320. deliverFormRules: {
  321. date: [
  322. { required: true, message: '请选择发货日期', trigger: 'change' }
  323. ],
  324. warehouse: [
  325. { required: true, message: '请选择发货仓库', trigger: 'change' }
  326. ],
  327. position: [
  328. { required: true, message: '请选择仓位', trigger: 'change' }
  329. ],
  330. },
  331. warehouseList: [],
  332. positionList: [],
  333. deliverGoodsList: [],
  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. }
  361. },
  362. computed: {
  363. sidebar() {
  364. return this.$store.state.app.sidebar
  365. },
  366. classObj() {
  367. return {
  368. hideSidebar: !this.sidebar.opened,
  369. openSidebar: this.sidebar.opened
  370. }
  371. },
  372. isExamine() {
  373. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  374. },
  375. },
  376. created() {
  377. this.getDetail();
  378. },
  379. methods: {
  380. // 返回列表
  381. goBack() {
  382. this.$emit('backListFormDetail');
  383. },
  384. // 获取仓库列表
  385. getWarehouseList() {
  386. getWarehouseList({
  387. pageNum: 1,
  388. pageSize: -1,
  389. }).then(res => {
  390. this.warehouseList = res.data.records;
  391. this.warehouseList1 = res.data.records;
  392. this.warehouseList2 = res.data.records;
  393. })
  394. },
  395. // 获取详情
  396. getDetail() {
  397. getOrderDetail({id: this.listItem.parentId}).then(res => {
  398. this.detailData = res.data;
  399. })
  400. },
  401. // 关闭订单
  402. closeData() {
  403. this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
  404. confirmButtonText: '确定',
  405. cancelButtonText: '取消',
  406. type: 'warning'
  407. }).then(() => {
  408. closeCom({id: this.listItem.parentId}).then(res => {
  409. this.$successMsg();
  410. this.getDetail();
  411. })
  412. }).catch(() => {});
  413. },
  414. // 直调完结
  415. overData() {
  416. this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
  417. confirmButtonText: '确定',
  418. cancelButtonText: '取消',
  419. type: 'warning'
  420. }).then(() => {
  421. overOrder({id: this.listItem.parentId}).then(res => {
  422. this.$successMsg();
  423. this.getDetail();
  424. })
  425. }).catch(() => {});
  426. },
  427. // 更改仓库
  428. changeWarehouse() {
  429. this.deliverForm.position = '';
  430. let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
  431. this.positionList = obj.kingDeeStocks;
  432. },
  433. // 打开 直调发货
  434. openDeliverDialog() {
  435. this.isShowDeliverDialog = true;
  436. this.deliverGoodsList = this.detailData.items;
  437. this.deliverGoodsList.forEach(item => {
  438. item.warehouse1 = '';
  439. item.warehouse2 = '';
  440. item.position1 = '';
  441. item.position2 = '';
  442. item.status1 = '';
  443. item.status2 = '';
  444. })
  445. this.getWarehouseList();
  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.deliverGoodsList.length; i++) {
  456. if(!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
  457. this.$errorMsg('请输入直调数量');
  458. return;
  459. }
  460. }
  461. let params = {
  462. enginOrderId: this.detailData.enginOrderId,
  463. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  464. deliverDate: this.deliverForm.date + ' 00:00:00',
  465. correspondId: this.deliverForm.warehouse,
  466. stockId: this.deliverForm.position,
  467. items: this.deliverGoodsList
  468. }
  469. deliverOrder(params).then(res => {
  470. this.$successMsg();
  471. this.isShowDeliverDialog = false;
  472. this.getDetail();
  473. })
  474. }
  475. })
  476. },
  477. // 更改调出仓库
  478. changeWarehouse1() {
  479. this.directForm.position1 = '';
  480. let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  481. this.positionList1 = obj.kingDeeStocks;
  482. this.directGoodsList.forEach(item => {
  483. item.warehouse1 = obj.name;
  484. });
  485. },
  486. // 更改调入仓库
  487. changeWarehouse2() {
  488. this.directForm.position2 = '';
  489. let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  490. this.positionList2 = obj.kingDeeStocks;
  491. this.directGoodsList.forEach(item => {
  492. item.warehouse2 = obj.name;
  493. });
  494. },
  495. // 更改调出仓位
  496. changePosition1() {
  497. let obj = this.positionList1.find(o => o.id == this.directForm.position1);
  498. this.directGoodsList.forEach(item => {
  499. item.position1 = obj.name;
  500. item.status1 = obj.defStockStatusName;
  501. });
  502. },
  503. // 更改调入仓位
  504. changePosition2() {
  505. let obj = this.positionList2.find(o => o.id == this.directForm.position2);
  506. this.directGoodsList.forEach(item => {
  507. item.position2 = obj.name;
  508. item.status2 = obj.defStockStatusName;
  509. });
  510. },
  511. // 打开 提前开票
  512. openDirectDialog() {
  513. this.isShowDirectDialog = true;
  514. this.directGoodsList = this.detailData.items;
  515. this.getWarehouseList();
  516. },
  517. // 关闭 提前开票
  518. closeDirectDialog() {
  519. this.isShowDirectDialog = false;
  520. },
  521. // 提交 提前开票
  522. submitDirectForm() {
  523. this.$refs.directForm.validate((valid) => {
  524. if (valid) {
  525. let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  526. let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
  527. let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  528. let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
  529. let params = {
  530. orderNo: this.detailData.enginOrderId,
  531. orderType: 'TRADE', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  532. correspondId: this.directForm.warehouse1,
  533. correspondName: warehouseItem1.name,
  534. stockId: this.directForm.position1,
  535. stockName: positionItem1.name,
  536. inCorrespondId: this.directForm.warehouse2,
  537. inCorrespondName: warehouseItem2.name,
  538. inStockId: this.directForm.position2,
  539. inStockName: positionItem2.name,
  540. }
  541. directOrder(params).then(res => {
  542. this.$successMsg();
  543. this.isShowDirectDialog = false;
  544. this.getDetail();
  545. })
  546. }
  547. })
  548. },
  549. }
  550. }
  551. </script>
  552. <style scoped lang="scss">
  553. .detail-container {
  554. width: 100%;
  555. height: 100%;
  556. }
  557. .main-title {
  558. display: flex;
  559. justify-content: space-between;
  560. align-items: center;
  561. margin-top: 20px;
  562. height: 60px;
  563. border-bottom: 1px solid #DCDFE6;
  564. margin-bottom: 20px;
  565. .title {
  566. font-size: 16px;
  567. font-weight: 600;
  568. padding-left: 10px;
  569. }
  570. }
  571. </style>