commerce_detail.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowCheckOrder">
  4. <el-page-header content="详情" @back="goBack" />
  5. <div id="printData">
  6. <div class="main-title">
  7. <div class="title">工程订单</div>
  8. </div>
  9. <div class="diy-table-1">
  10. <el-row>
  11. <el-col :span="8" class="item">
  12. <div class="label">工程订单号</div>
  13. <div class="value">{{ detailData.enginOrderNo }}</div>
  14. </el-col>
  15. <el-col :span="8" class="item">
  16. <div class="label">订单日期</div>
  17. <div class="value">{{ detailData.orderDate }}</div>
  18. </el-col>
  19. <el-col :span="8" class="item">
  20. <div class="label">单据状态</div>
  21. <div class="value">
  22. {{ detailData.examineStatus | statusFilter }}
  23. </div>
  24. </el-col>
  25. <el-col :span="8" class="item">
  26. <div class="label">经销商编码</div>
  27. <div class="value">{{ detailData.customerNumber }}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">经销商名称</div>
  31. <div class="value">{{ detailData.customerName }}</div>
  32. </el-col>
  33. <el-col :span="8" class="item">
  34. <div class="label">机型类别</div>
  35. <div class="value">{{ detailData.refMachineType }}</div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">工程登录编号</div>
  39. <div class="value">{{ detailData.refEnginRecordNo }}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">项目名称</div>
  43. <div class="value">{{ detailData.refProjectName }}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">行业类别</div>
  47. <div class="value">{{ detailData.refTradeCategory }}</div>
  48. </el-col>
  49. <el-col :span="8" class="item">
  50. <div class="label">工程编号</div>
  51. <div class="value">{{ detailData.refProjectNo }}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">跨区厂编号</div>
  55. <div class="value">{{ detailData.refFactoryNo }}</div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">使用单位</div>
  59. <div class="value">{{ detailData.refUseUnit }}</div>
  60. </el-col>
  61. <!-- <el-col :span="8" class="item">-->
  62. <!-- <div class="label">销售类型</div>-->
  63. <!-- <div class="value">{{detailData.saleTypeName}}</div>-->
  64. <!-- </el-col>-->
  65. <el-col :span="8" class="item">
  66. <div class="label">联系人</div>
  67. <div class="value">{{ detailData.refLinkman }}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">固定电话</div>
  71. <div class="value">{{ detailData.refTel }}</div>
  72. </el-col>
  73. <el-col :span="8" class="item">
  74. <div class="label">移动电话</div>
  75. <div class="value">{{ detailData.refPhone }}</div>
  76. </el-col>
  77. <el-col v-if="!isDealer" :span="8" class="item">
  78. <div class="label">权限分类</div>
  79. <div class="value">{{ detailData.refPowerCategory }}</div>
  80. </el-col>
  81. <el-col :span="8" class="item">
  82. <div class="label">工程登录类型</div>
  83. <div class="value">{{ detailData.refPromiseStatus }}</div>
  84. </el-col>
  85. <el-col :span="24" class="item">
  86. <div class="label">安装地址</div>
  87. <div class="value">{{ detailData.refInstallAddress }}</div>
  88. </el-col>
  89. <el-col :span="8" class="item">
  90. <div class="label">不扣押金</div>
  91. <div class="value">
  92. {{ detailData.takeDeposit ? '是' : '否' }}
  93. </div>
  94. </el-col>
  95. <el-col :span="8" class="item">
  96. <div class="label">文件编号</div>
  97. <div class="value">{{ detailData.fileNo }}</div>
  98. </el-col>
  99. <el-col :span="8" class="item">
  100. <div class="label">业务员</div>
  101. <div class="value">{{ detailData.serviceName }}</div>
  102. </el-col>
  103. <el-col :span="24" class="item">
  104. <div class="label">格力回复</div>
  105. <div class="value">{{ detailData.geLiNote }}</div>
  106. </el-col>
  107. <el-col v-if="!isDealer" :span="24" class="item">
  108. <div class="label">格力内部备注</div>
  109. <div class="value">{{ detailData.geLiInerNote }}</div>
  110. </el-col>
  111. <el-col :span="24" class="item">
  112. <div class="label">备注</div>
  113. <div class="value">{{ detailData.remark }}</div>
  114. </el-col>
  115. <el-col :span="6" class="item">
  116. <div class="label">制单人</div>
  117. <div class="value">{{ detailData.createName }}</div>
  118. </el-col>
  119. <el-col :span="6" class="item">
  120. <div class="label">制单日期</div>
  121. <div class="value">{{ detailData.createTime }}</div>
  122. </el-col>
  123. <el-col :span="6" class="item">
  124. <div class="label">审核人</div>
  125. <div class="value">{{ detailData.confirmName }}</div>
  126. </el-col>
  127. <el-col :span="6" class="item">
  128. <div class="label">审核日期</div>
  129. <div class="value">{{ detailData.confirmTime }}</div>
  130. </el-col>
  131. <el-col :span="6" class="item">
  132. <div class="label">最后更新人</div>
  133. <div class="value">{{ detailData.updateName }}</div>
  134. </el-col>
  135. <el-col :span="6" class="item">
  136. <div class="label">最后更新日期</div>
  137. <div class="value">{{ detailData.updateTime }}</div>
  138. </el-col>
  139. <el-col :span="6" class="item">
  140. <div class="label">关闭人</div>
  141. <div class="value">{{ detailData.closeName }}</div>
  142. </el-col>
  143. <el-col :span="6" class="item">
  144. <div class="label">关闭日期</div>
  145. <div class="value">{{ detailData.closeTime }}</div>
  146. </el-col>
  147. <el-col :span="24" class="item">
  148. <div class="label">审批说明</div>
  149. <div class="value">{{ detailData.examineNote }}</div>
  150. </el-col>
  151. <el-col :span="24" class="item">
  152. <div class="label">计划单</div>
  153. <div class="value">
  154. <el-radio-group v-model="detailData.isPlanOrder" disabled>
  155. <el-radio label="true">是</el-radio>
  156. <el-radio label="false">否</el-radio>
  157. </el-radio-group>
  158. </div>
  159. </el-col>
  160. </el-row>
  161. </div>
  162. <div class="main-title">
  163. <div class="title">货品信息</div>
  164. </div>
  165. <div class="table" style="margin-top: 20px">
  166. <el-table
  167. :data="detailData.items"
  168. element-loading-text="Loading"
  169. border
  170. fit
  171. highlight-current-row
  172. stripe
  173. max-height="400"
  174. show-summary
  175. :summary-method="$getSummaries"
  176. >
  177. <el-table-column align="center" label="序号" type="index" width="50" />
  178. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  179. <el-table-column
  180. align="left"
  181. label="物料编码"
  182. prop="materialNumber"
  183. min-width="120"
  184. show-overflow-tooltip
  185. />
  186. <el-table-column
  187. align="left"
  188. label="产品编码"
  189. prop="materialOldNumber"
  190. min-width="120"
  191. show-overflow-tooltip
  192. />
  193. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  194. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
  195. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  196. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  197. <template slot-scope="scope">
  198. {{ scope.row.price | numToFixed }}
  199. </template>
  200. </el-table-column>
  201. <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="100" show-overflow-tooltip />
  202. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
  203. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  204. <template slot-scope="scope">
  205. {{ scope.row.totalAmount | numToFixed }}
  206. </template>
  207. </el-table-column>
  208. <el-table-column
  209. align="left"
  210. label="返利类型"
  211. prop="customerWalletName2"
  212. min-width="100"
  213. show-overflow-tooltip
  214. />
  215. <el-table-column
  216. align="right"
  217. label="实付返利金额"
  218. prop="payRebateAmount"
  219. min-width="100"
  220. show-overflow-tooltip
  221. >
  222. <template slot-scope="scope">
  223. {{ scope.row.payRebateAmount | numToFixed }}
  224. </template>
  225. </el-table-column>
  226. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  227. <template slot-scope="scope">
  228. {{ scope.row.discAmount | numToFixed }}
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. align="left"
  233. label="现金钱包"
  234. prop="customerWalletName"
  235. min-width="100"
  236. show-overflow-tooltip
  237. />
  238. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  239. <template slot-scope="scope">
  240. {{ scope.row.payAmount | numToFixed }}
  241. </template>
  242. </el-table-column>
  243. <el-table-column
  244. align="left"
  245. label="是否直调"
  246. prop="isDirectTransfer"
  247. min-width="100"
  248. show-overflow-tooltip
  249. >
  250. <template slot-scope="scope">
  251. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. align="right"
  256. label="直调数量"
  257. prop="directTransferQty"
  258. min-width="100"
  259. show-overflow-tooltip
  260. />
  261. <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip />
  262. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  263. <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
  264. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip />
  265. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  266. </el-table>
  267. </div>
  268. </div>
  269. <div class="page-footer">
  270. <div class="footer">
  271. <el-button type="success" @click="toCheckOrder">联查单据</el-button>
  272. <el-button
  273. v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'"
  274. type="danger"
  275. @click="closeData"
  276. >关闭订单</el-button
  277. >
  278. <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
  279. <template v-if="detailData.isPlanOrder === 'true'">
  280. <el-button v-if="!isDealer" type="primary" :disabled="detailData.directTransferStatus" @click="overData"
  281. >直调完结</el-button
  282. >
  283. <el-button
  284. v-if="!isDealer"
  285. type="primary"
  286. :disabled="detailData.directTransferStatus"
  287. @click="openDeliverDialog"
  288. >直调发货</el-button
  289. >
  290. </template>
  291. <el-button @click="goBack">返回列表</el-button>
  292. </div>
  293. </div>
  294. </div>
  295. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  296. <el-form
  297. ref="deliverForm"
  298. :model="deliverForm"
  299. :rules="deliverFormRules"
  300. label-width="120px"
  301. size="small"
  302. label-position="left"
  303. >
  304. <el-row :gutter="20">
  305. <!-- <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">-->
  306. <!-- <el-form-item label="发货日期" prop="date">-->
  307. <!-- <el-date-picker-->
  308. <!-- v-model="deliverForm.date"-->
  309. <!-- type="date"-->
  310. <!-- value-format="yyyy-MM-dd"-->
  311. <!-- style="width: 100%"-->
  312. <!-- placeholder="选择日期"-->
  313. <!-- />-->
  314. <!-- </el-form-item>-->
  315. <!-- </el-col>-->
  316. <el-col :xs="8" :sm="8" :lg="8">
  317. <el-form-item label="选择仓位" prop="position">
  318. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  319. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id" />
  320. </el-select>
  321. </el-form-item>
  322. </el-col>
  323. <el-col :xs="8" :sm="8" :lg="8">
  324. <el-form-item label="发货申请备注" prop="remark">
  325. <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable />
  326. </el-form-item>
  327. </el-col>
  328. </el-row>
  329. </el-form>
  330. <div class="table" style="margin-top: 20px">
  331. <el-table
  332. :data="deliverGoodsList"
  333. element-loading-text="Loading"
  334. border
  335. fit
  336. highlight-current-row
  337. stripe
  338. max-height="400"
  339. >
  340. <el-table-column align="center" label="序号" type="index" width="50" />
  341. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  342. <el-table-column
  343. align="center"
  344. label="物料编码"
  345. prop="materialNumber"
  346. min-width="160"
  347. show-overflow-tooltip
  348. />
  349. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  350. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
  351. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  352. <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip />
  353. <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  354. <el-table-column
  355. align="right"
  356. label="直调数量"
  357. prop="directTransferQty"
  358. min-width="100"
  359. show-overflow-tooltip
  360. >
  361. <template slot-scope="scope">
  362. <el-input
  363. v-model="scope.row.realDirectTransferQty"
  364. size="small"
  365. type="number"
  366. @mousewheel.native.prevent
  367. />
  368. </template>
  369. </el-table-column>
  370. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  371. <template slot-scope="scope">
  372. {{ scope.row.price | numToFixed }}
  373. </template>
  374. </el-table-column>
  375. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  376. <template slot-scope="scope">
  377. {{ scope.row.totalAmount | numToFixed }}
  378. </template>
  379. </el-table-column>
  380. <el-table-column align="right" label="返利" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  381. <template slot-scope="scope">
  382. {{ scope.row.payRebateAmount | numToFixed }}
  383. </template>
  384. </el-table-column>
  385. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  386. </el-table>
  387. </div>
  388. <span slot="footer" class="dialog-footer">
  389. <el-button @click="closeDeliverDialog">取 消</el-button>
  390. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  391. </span>
  392. </el-dialog>
  393. <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
  394. <el-form
  395. ref="directForm"
  396. :model="directForm"
  397. :rules="directFormRules"
  398. label-width="80px"
  399. size="small"
  400. label-position="left"
  401. >
  402. <el-row :gutter="20">
  403. <el-col :xs="12" :sm="6" :lg="6">
  404. <el-form-item label="调出仓库" prop="warehouse1">
  405. <el-select
  406. v-model="directForm.warehouse1"
  407. placeholder="请选择调出仓库"
  408. style="width: 100%"
  409. filterable
  410. @change="changeWarehouse1"
  411. >
  412. <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id" />
  413. </el-select>
  414. </el-form-item>
  415. </el-col>
  416. <el-col :xs="12" :sm="6" :lg="6">
  417. <el-form-item label="调出仓位" prop="position1">
  418. <el-select
  419. v-model="directForm.position1"
  420. placeholder="请调出仓位"
  421. style="width: 100%"
  422. filterable
  423. @change="changePosition1"
  424. >
  425. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id" />
  426. </el-select>
  427. </el-form-item>
  428. </el-col>
  429. <el-col :xs="12" :sm="6" :lg="6">
  430. <el-form-item label="调入仓库" prop="warehouse2">
  431. <el-select
  432. v-model="directForm.warehouse2"
  433. placeholder="请选择调入仓库"
  434. style="width: 100%"
  435. filterable
  436. @change="changeWarehouse2"
  437. >
  438. <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id" />
  439. </el-select>
  440. </el-form-item>
  441. </el-col>
  442. <el-col :xs="12" :sm="6" :lg="6">
  443. <el-form-item label="调入仓位" prop="position2">
  444. <el-select
  445. v-model="directForm.position2"
  446. placeholder="请调入仓位"
  447. style="width: 100%"
  448. filterable
  449. @change="changePosition2"
  450. >
  451. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id" />
  452. </el-select>
  453. </el-form-item>
  454. </el-col>
  455. </el-row>
  456. </el-form>
  457. <div class="table" style="margin-top: 20px">
  458. <el-table
  459. :data="directGoodsList"
  460. element-loading-text="Loading"
  461. border
  462. fit
  463. highlight-current-row
  464. stripe
  465. max-height="400"
  466. >
  467. <el-table-column align="center" label="序号" type="index" width="50" />
  468. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  469. <el-table-column
  470. align="center"
  471. label="产品编码"
  472. prop="materialNumber"
  473. min-width="160"
  474. show-overflow-tooltip
  475. />
  476. <el-table-column
  477. align="center"
  478. label="物料代码"
  479. prop="materialOldNumber"
  480. min-width="160"
  481. show-overflow-tooltip
  482. />
  483. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  484. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
  485. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  486. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
  487. <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip />
  488. <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip />
  489. <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip />
  490. <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip />
  491. <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip />
  492. <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip />
  493. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  494. <template slot-scope="">弘格</template>
  495. </el-table-column>
  496. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  497. <template slot-="scope">弘格</template>
  498. </el-table-column>
  499. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  500. </el-table>
  501. </div>
  502. <span slot="footer" class="dialog-footer">
  503. <el-button @click="closeDirectDialog">取 消</el-button>
  504. <el-button type="primary" @click="submitDirectForm">确 定</el-button>
  505. </span>
  506. </el-dialog>
  507. <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
  508. </div>
  509. </template>
  510. <script>
  511. import {
  512. getOrderDetail,
  513. closeCom,
  514. overOrder,
  515. getWarehouseList,
  516. deliverOrder,
  517. directOrder,
  518. getPositionList
  519. } from '@/api/supply/engin'
  520. import CheckOrder from '@/components/Common/check-order'
  521. export default {
  522. name: 'CommerceDetail',
  523. componentName: 'CommerceDetail',
  524. components: {
  525. CheckOrder
  526. },
  527. filters: {
  528. statusFilter(val) {
  529. const statusList = [
  530. { label: '已保存', value: 'SAVE' },
  531. { label: '待审核', value: 'WAIT' },
  532. { label: '审核通过', value: 'OK' },
  533. // { label: '审核驳回', value: 'FAIL' },,
  534. { label: '已关闭', value: 'CLOSE' }
  535. ]
  536. const obj = statusList.find(o => o.value == val)
  537. return obj ? obj.label : ''
  538. }
  539. },
  540. props: ['listItem'],
  541. data() {
  542. return {
  543. detailData: {},
  544. isShowDeliverDialog: false,
  545. deliverForm: {
  546. date: '',
  547. position: '',
  548. remark: ''
  549. },
  550. deliverFormRules: {
  551. // date: [
  552. // { required: true, message: "请选择发货日期", trigger: "change" },
  553. // ],
  554. position: [{ required: true, message: '请选择仓位', trigger: 'change' }]
  555. },
  556. positionList: [],
  557. deliverGoodsList: [],
  558. isShowDirectDialog: false,
  559. directForm: {
  560. warehouse1: '',
  561. position1: '',
  562. warehouse2: '',
  563. position2: ''
  564. },
  565. directFormRules: {
  566. warehouse1: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
  567. position1: [{ required: true, message: '请选择调出仓位', trigger: 'change' }],
  568. warehouse2: [{ required: true, message: '请选择调入仓库', trigger: 'change' }],
  569. position2: [{ required: true, message: '请选择调入仓位', trigger: 'change' }]
  570. },
  571. warehouseList1: [],
  572. warehouseList2: [],
  573. positionList1: [],
  574. positionList2: [],
  575. directGoodsList: [],
  576. checkOrderId: {},
  577. isShowCheckOrder: false
  578. }
  579. },
  580. computed: {
  581. isExamine() {
  582. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  583. },
  584. isDealer() {
  585. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  586. }
  587. },
  588. created() {
  589. this.getDetail()
  590. },
  591. methods: {
  592. // 返回列表
  593. goBack() {
  594. this.$emit('backListFormDetail')
  595. },
  596. // 获取仓库列表
  597. getWarehouseList() {
  598. getWarehouseList({
  599. pageNum: 1,
  600. pageSize: -1
  601. }).then(res => {
  602. this.warehouseList1 = res.data.records
  603. this.warehouseList2 = res.data.records
  604. })
  605. },
  606. // 获取虚拟仓位列表
  607. getPositionList() {
  608. getPositionList({
  609. pageNum: 1,
  610. pageSize: -1,
  611. type: 2
  612. }).then(res => {
  613. this.positionList = res.data.records
  614. })
  615. },
  616. // 获取详情
  617. getDetail() {
  618. getOrderDetail({ id: this.listItem.parentId }).then(res => {
  619. if (res.data.items) {
  620. res.data.items.forEach(item => {
  621. item.number = (item.qty * 100 - item.retiredQty * 100) / 100
  622. item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty']
  623. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
  624. item.correspondName = res.data.correspondName
  625. })
  626. }
  627. res.data.isPlanOrder = String(res.data.isPlanOrder)
  628. this.detailData = res.data
  629. console.log(this.detailData.isPlanOrder)
  630. })
  631. },
  632. // 关闭订单
  633. closeData() {
  634. this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
  635. confirmButtonText: '确定',
  636. cancelButtonText: '取消',
  637. type: 'warning'
  638. })
  639. .then(() => {
  640. closeCom({
  641. id: this.listItem.parentId,
  642. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  643. }).then(res => {
  644. this.$successMsg()
  645. this.getDetail()
  646. })
  647. })
  648. .catch(() => {})
  649. },
  650. // 直调完结
  651. overData() {
  652. this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
  653. confirmButtonText: '确定',
  654. cancelButtonText: '取消',
  655. type: 'warning'
  656. })
  657. .then(() => {
  658. overOrder({
  659. id: this.listItem.parentId,
  660. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  661. }).then(res => {
  662. this.$successMsg()
  663. this.getDetail()
  664. })
  665. })
  666. .catch(() => {})
  667. },
  668. // 更改仓库
  669. changeWarehouse() {
  670. this.deliverForm.position = ''
  671. const obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
  672. this.positionList = obj.kingDeeStocks
  673. },
  674. // 打开 直调发货
  675. openDeliverDialog() {
  676. this.isShowDeliverDialog = true
  677. this.deliverGoodsList = this.detailData.items
  678. this.deliverGoodsList.forEach(item => {
  679. item.warehouse1 = ''
  680. item.warehouse2 = ''
  681. item.position1 = ''
  682. item.position2 = ''
  683. item.status1 = ''
  684. item.status2 = ''
  685. this.$set(item, 'realDirectTransferQty', item.refundableQty)
  686. })
  687. this.getPositionList()
  688. },
  689. // 关闭 直调发货
  690. closeDeliverDialog() {
  691. this.isShowDeliverDialog = false
  692. },
  693. // 提交 直调发货
  694. submitDeliverForm() {
  695. this.$refs.deliverForm.validate(valid => {
  696. if (valid) {
  697. for (let i = 0; i < this.deliverGoodsList.length; i++) {
  698. if (!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
  699. this.$errorMsg('请输入直调数量')
  700. return
  701. }
  702. }
  703. const params = {
  704. enginOrderId: this.detailData.enginOrderId,
  705. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  706. deliverDate: '',
  707. correspondId: this.deliverForm.position,
  708. remark: this.deliverForm.remark,
  709. items: this.deliverGoodsList,
  710. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  711. }
  712. deliverOrder(params).then(res => {
  713. this.$successMsg()
  714. this.isShowDeliverDialog = false
  715. this.getDetail()
  716. })
  717. }
  718. })
  719. },
  720. // 更改调出仓库
  721. changeWarehouse1() {
  722. this.directForm.position1 = ''
  723. const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  724. this.positionList1 = obj.kingDeeStocks
  725. this.directGoodsList.forEach(item => {
  726. item.warehouse1 = obj.name
  727. })
  728. },
  729. // 更改调入仓库
  730. changeWarehouse2() {
  731. this.directForm.position2 = ''
  732. const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  733. this.positionList2 = obj.kingDeeStocks
  734. this.directGoodsList.forEach(item => {
  735. item.warehouse2 = obj.name
  736. })
  737. },
  738. // 更改调出仓位
  739. changePosition1() {
  740. const obj = this.positionList1.find(o => o.id == this.directForm.position1)
  741. this.directGoodsList.forEach(item => {
  742. item.position1 = obj.name
  743. item.status1 = obj.defStockStatusName
  744. })
  745. },
  746. // 更改调入仓位
  747. changePosition2() {
  748. const obj = this.positionList2.find(o => o.id == this.directForm.position2)
  749. this.directGoodsList.forEach(item => {
  750. item.position2 = obj.name
  751. item.status2 = obj.defStockStatusName
  752. })
  753. },
  754. // 打开 提前开票
  755. openDirectDialog() {
  756. this.isShowDirectDialog = true
  757. this.directGoodsList = this.detailData.items
  758. this.getWarehouseList()
  759. },
  760. // 关闭 提前开票
  761. closeDirectDialog() {
  762. this.isShowDirectDialog = false
  763. },
  764. // 提交 提前开票
  765. submitDirectForm() {
  766. this.$refs.directForm.validate(valid => {
  767. if (valid) {
  768. const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  769. const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
  770. const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  771. const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
  772. const params = {
  773. orderNo: this.detailData.enginOrderId,
  774. orderType: 'TRADE', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  775. correspondId: this.directForm.warehouse1,
  776. correspondName: warehouseItem1.name,
  777. stockId: this.directForm.position1,
  778. stockName: positionItem1.name,
  779. inCorrespondId: this.directForm.warehouse2,
  780. inCorrespondName: warehouseItem2.name,
  781. inStockId: this.directForm.position2,
  782. inStockName: positionItem2.name,
  783. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  784. }
  785. directOrder(params).then(res => {
  786. this.$successMsg()
  787. this.isShowDirectDialog = false
  788. this.getDetail()
  789. })
  790. }
  791. })
  792. },
  793. // 联查单据
  794. toCheckOrder() {
  795. this.checkOrderId = this.detailData.enginOrderId
  796. this.isShowCheckOrder = true
  797. },
  798. backDetail() {
  799. this.isShowCheckOrder = false
  800. }
  801. }
  802. }
  803. </script>
  804. <style scoped lang="scss">
  805. .detail-container {
  806. width: 100%;
  807. height: 100%;
  808. }
  809. .main-title {
  810. display: flex;
  811. justify-content: space-between;
  812. align-items: center;
  813. margin-top: 20px;
  814. height: 60px;
  815. border-bottom: 1px solid #dcdfe6;
  816. margin-bottom: 20px;
  817. .title {
  818. font-size: 16px;
  819. font-weight: 600;
  820. padding-left: 10px;
  821. }
  822. }
  823. </style>