home_detail.vue 26 KB

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