home_detail.vue 26 KB

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