home_detail.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowCheckOrder">
  4. <el-page-header @back="goBack" content="详情"></el-page-header>
  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.refProjectCategory }}</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.refFactoryNo }}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">使用单位</div>
  55. <div class="value">{{ detailData.refUseUnit }}</div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">购买单位</div>
  59. <div class="value">{{ detailData.refBuyUnitName }}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">区域</div>
  63. <div class="value">{{ detailData.refRegionWork }}</div>
  64. </el-col>
  65. <el-col :span="8" class="item">
  66. <div class="label">销售类型</div>
  67. <div class="value">{{ detailData.saleTypeName }}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">第几次申报</div>
  71. <div class="value">{{ detailData.refDeclareNo }}</div>
  72. </el-col>
  73. <el-col :span="8" class="item">
  74. <div class="label">联系人</div>
  75. <div class="value">{{ detailData.refLinkman }}</div>
  76. </el-col>
  77. <el-col :span="8" class="item">
  78. <div class="label">固定电话</div>
  79. <div class="value">{{ detailData.refTel }}</div>
  80. </el-col>
  81. <el-col :span="8" class="item">
  82. <div class="label">移动电话</div>
  83. <div class="value">{{ detailData.refPhone }}</div>
  84. </el-col>
  85. <el-col :span="16" 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">{{ detailData.refPromiseProvide }}</div>
  92. </el-col>
  93. <el-col :span="8" class="item">
  94. <div class="label">不扣押金</div>
  95. <div class="value">
  96. {{ detailData.takeDeposit ? '是' : '否' }}
  97. </div>
  98. </el-col>
  99. <el-col :span="8" class="item">
  100. <div class="label">文件编号</div>
  101. <div class="value">{{ detailData.fileNo }}</div>
  102. </el-col>
  103. <el-col :span="8" class="item">
  104. <div class="label">业务员</div>
  105. <div class="value">{{ detailData.serviceName }}</div>
  106. </el-col>
  107. <!-- <el-col :span="24" class="item">
  108. <div class="label">格力回复</div>
  109. <div class="value">{{detailData.note1}}</div>
  110. </el-col> -->
  111. <el-col :span="16" class="item">
  112. <div class="label">项目说明</div>
  113. <div class="value">{{ detailData.refProjectNote }}</div>
  114. </el-col>
  115. <el-col :span="8" class="item">
  116. <div class="label">项目类型</div>
  117. <div class="value">{{ detailData.refProjectType }}</div>
  118. </el-col>
  119. <el-col :span="24" class="item">
  120. <div class="label">其他附件审批意见</div>
  121. <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
  122. </el-col>
  123. <el-col :span="24" class="item" v-if="!isDealer">
  124. <div class="label">格力内部备注</div>
  125. <div class="value">
  126. <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
  127. <el-divider direction="vertical"></el-divider>
  128. <el-button type="text" @click="saveRemark">保存备注</el-button>
  129. </div>
  130. </el-col>
  131. <el-col :span="24" class="item">
  132. <div class="label">备注</div>
  133. <div class="value">{{ detailData.remark }}</div>
  134. </el-col>
  135. <el-col :span="6" class="item">
  136. <div class="label">制单人</div>
  137. <div class="value">{{ detailData.createName }}</div>
  138. </el-col>
  139. <el-col :span="6" class="item">
  140. <div class="label">制单日期</div>
  141. <div class="value">{{ detailData.createTime }}</div>
  142. </el-col>
  143. <el-col :span="6" class="item">
  144. <div class="label">审核人</div>
  145. <div class="value">{{ detailData.confirmName }}</div>
  146. </el-col>
  147. <el-col :span="6" class="item">
  148. <div class="label">审核日期</div>
  149. <div class="value">{{ detailData.confirmTime }}</div>
  150. </el-col>
  151. <el-col :span="6" class="item">
  152. <div class="label">最后更新人</div>
  153. <div class="value">{{ detailData.updateName }}</div>
  154. </el-col>
  155. <el-col :span="6" class="item">
  156. <div class="label">最后更新日期</div>
  157. <div class="value">{{ detailData.updateTime }}</div>
  158. </el-col>
  159. <el-col :span="6" class="item">
  160. <div class="label">关闭人</div>
  161. <div class="value">{{ detailData.closeName }}</div>
  162. </el-col>
  163. <el-col :span="6" class="item">
  164. <div class="label">关闭日期</div>
  165. <div class="value">{{ detailData.closeTime }}</div>
  166. </el-col>
  167. <el-col :span="24" class="item">
  168. <div class="label">审批说明</div>
  169. <div class="value">{{ detailData.examineNote }}</div>
  170. </el-col>
  171. <el-col :span="24" class="item" v-if="!isDealer">
  172. <div class="label">引用记录</div>
  173. <div class="value">
  174. {{ detailData.items[0] && detailData.items[0].useRefCount }}
  175. </div>
  176. </el-col>
  177. </el-row>
  178. </div>
  179. <div class="main-title">
  180. <div class="title">货品信息</div>
  181. </div>
  182. <div class="table" style="margin-top: 20px">
  183. <el-table
  184. :data="detailData.items"
  185. element-loading-text="Loading"
  186. border
  187. fit
  188. highlight-current-row
  189. stripe
  190. max-height="400"
  191. show-summary
  192. :summary-method="$getSummaries"
  193. >
  194. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  195. <el-table-column
  196. align="left"
  197. label="销售类型"
  198. prop="saleTypeName"
  199. min-width="100"
  200. show-overflow-tooltip
  201. ></el-table-column>
  202. <el-table-column
  203. align="left"
  204. label="物料编码"
  205. prop="materialNumber"
  206. min-width="120"
  207. show-overflow-tooltip
  208. ></el-table-column>
  209. <el-table-column
  210. align="left"
  211. label="产品编码"
  212. prop="materialOldNumber"
  213. min-width="120"
  214. show-overflow-tooltip
  215. ></el-table-column>
  216. <el-table-column
  217. align="left"
  218. label="产品名称"
  219. prop="materialName"
  220. min-width="160"
  221. show-overflow-tooltip
  222. ></el-table-column>
  223. <el-table-column
  224. align="left"
  225. label="规格型号"
  226. prop="specification"
  227. min-width="350"
  228. show-overflow-tooltip
  229. ></el-table-column>
  230. <el-table-column
  231. align="left"
  232. label="实装规格型号"
  233. prop="realSpecification"
  234. min-width="300"
  235. show-overflow-tooltip
  236. >
  237. <template slot-scope="scope">
  238. <div :style="scope.row.realSpecification != scope.row.specification ? { color: 'blue' } : ''">
  239. {{ scope.row.realSpecification }}
  240. </div>
  241. </template>
  242. </el-table-column>
  243. <el-table-column
  244. align="right"
  245. label="数量"
  246. prop="qty"
  247. min-width="100"
  248. show-overflow-tooltip
  249. ></el-table-column>
  250. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  251. <template slot-scope="scope">
  252. {{ scope.row.price | numToFixed }}
  253. </template>
  254. </el-table-column>
  255. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  256. <template slot-scope="scope">
  257. {{ scope.row.totalAmount | numToFixed }}
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. align="right"
  262. label="工程登录数量"
  263. prop="enginNum"
  264. min-width="120"
  265. show-overflow-tooltip
  266. ></el-table-column>
  267. <el-table-column
  268. align="left"
  269. label="现金钱包"
  270. prop="customerWalletName"
  271. min-width="100"
  272. show-overflow-tooltip
  273. ></el-table-column>
  274. <el-table-column
  275. align="right"
  276. label="返利类型"
  277. prop="customerWalletName2"
  278. min-width="100"
  279. show-overflow-tooltip
  280. ></el-table-column>
  281. <el-table-column
  282. align="right"
  283. label="实付返利金额"
  284. prop="payRebateAmount"
  285. min-width="100"
  286. show-overflow-tooltip
  287. >
  288. <template slot-scope="scope">
  289. {{ scope.row.payRebateAmount | numToFixed }}
  290. </template>
  291. </el-table-column>
  292. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  293. <template slot-scope="scope">
  294. {{ scope.row.discAmount | numToFixed }}
  295. </template>
  296. </el-table-column>
  297. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  298. <template slot-scope="scope">
  299. {{ scope.row.payAmount | numToFixed }}
  300. </template>
  301. </el-table-column>
  302. <el-table-column
  303. align="left"
  304. label="是否直调"
  305. prop="isDirectTransfer"
  306. min-width="100"
  307. show-overflow-tooltip
  308. >
  309. <template slot-scope="scope">
  310. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  311. </template>
  312. </el-table-column>
  313. <el-table-column
  314. align="right"
  315. label="直调数量"
  316. prop="directTransferQty"
  317. min-width="100"
  318. show-overflow-tooltip
  319. ></el-table-column>
  320. <el-table-column
  321. align="right"
  322. label="已发货数量"
  323. prop="hasSendQty"
  324. min-width="100"
  325. show-overflow-tooltip
  326. ></el-table-column>
  327. <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column> -->
  328. <el-table-column
  329. align="left"
  330. label="备注"
  331. prop="remark"
  332. min-width="160"
  333. show-overflow-tooltip
  334. ></el-table-column>
  335. <el-table-column
  336. align="left"
  337. label="实装物料编号"
  338. prop="realMaterialNumber"
  339. min-width="150"
  340. show-overflow-tooltip
  341. >
  342. <template slot-scope="scope">
  343. <div :style="scope.row.realMaterialNumber != scope.row.materialNumber ? { color: 'blue' } : ''">
  344. {{ scope.row.realMaterialNumber }}
  345. </div>
  346. </template>
  347. </el-table-column>
  348. <el-table-column
  349. align="left"
  350. label="实装厂产品编码"
  351. prop="realMaterialOldNumber"
  352. min-width="200"
  353. show-overflow-tooltip
  354. >
  355. <template slot-scope="scope">
  356. <div :style="scope.row.realMaterialOldNumber != scope.row.materialOldNumber ? { color: 'blue' } : ''">
  357. {{ scope.row.realMaterialOldNumber }}
  358. </div>
  359. </template>
  360. </el-table-column>
  361. <el-table-column
  362. align="left"
  363. label="税率"
  364. prop="tax"
  365. min-width="100"
  366. show-overflow-tooltip
  367. ></el-table-column>
  368. <el-table-column
  369. align="left"
  370. label="单位"
  371. prop="unit"
  372. min-width="100"
  373. show-overflow-tooltip
  374. ></el-table-column>
  375. </el-table>
  376. </div>
  377. </div>
  378. <div class="page-footer">
  379. <div class="footer">
  380. <el-button type="success" @click="toCheckOrder">联查单据</el-button>
  381. <el-button
  382. type="danger"
  383. @click="closeData"
  384. v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')"
  385. >关闭订单</el-button
  386. >
  387. <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
  388. <el-button type="primary" @click="overData" :disabled="detailData.directTransferStatus" v-if="!isDealer"
  389. >直调完结</el-button
  390. >
  391. <el-button
  392. type="primary"
  393. @click="openDeliverDialog"
  394. :disabled="detailData.directTransferStatus"
  395. v-if="!isDealer"
  396. >直调发货</el-button
  397. >
  398. <el-button @click="goBack">返回列表</el-button>
  399. </div>
  400. </div>
  401. </div>
  402. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  403. <el-form
  404. ref="deliverForm"
  405. :model="deliverForm"
  406. :rules="deliverFormRules"
  407. label-width="120px"
  408. size="small"
  409. label-position="left"
  410. >
  411. <el-row :gutter="20">
  412. <!-- <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">-->
  413. <!-- <el-form-item label="发货日期" prop="date">-->
  414. <!-- <el-date-picker-->
  415. <!-- v-model="deliverForm.date"-->
  416. <!-- type="date"-->
  417. <!-- value-format="yyyy-MM-dd"-->
  418. <!-- style="width: 100%"-->
  419. <!-- placeholder="选择日期"-->
  420. <!-- >-->
  421. <!-- </el-date-picker>-->
  422. <!-- </el-form-item>-->
  423. <!-- </el-col>-->
  424. <el-col :xs="8" :sm="8" :lg="8">
  425. <el-form-item label="选择仓位" prop="position">
  426. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  427. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  428. </el-select>
  429. </el-form-item>
  430. </el-col>
  431. <el-col :xs="8" :sm="8" :lg="8">
  432. <el-form-item label="发货申请备注" prop="remark">
  433. <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable></el-input>
  434. </el-form-item>
  435. </el-col>
  436. </el-row>
  437. </el-form>
  438. <div class="table" style="margin-top: 20px">
  439. <el-table
  440. :data="deliverGoodsList"
  441. element-loading-text="Loading"
  442. border
  443. fit
  444. highlight-current-row
  445. stripe
  446. max-height="400"
  447. >
  448. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  449. <el-table-column
  450. align="center"
  451. label="销售类型"
  452. prop="saleTypeName"
  453. min-width="100"
  454. show-overflow-tooltip
  455. ></el-table-column>
  456. <el-table-column
  457. align="center"
  458. label="物料编码"
  459. prop="materialNumber"
  460. min-width="160"
  461. show-overflow-tooltip
  462. ></el-table-column>
  463. <el-table-column
  464. align="center"
  465. label="产品名称"
  466. prop="materialName"
  467. min-width="160"
  468. show-overflow-tooltip
  469. ></el-table-column>
  470. <el-table-column
  471. align="center"
  472. label="规格型号"
  473. prop="specification"
  474. min-width="160"
  475. show-overflow-tooltip
  476. ></el-table-column>
  477. <el-table-column
  478. align="center"
  479. label="单位"
  480. prop="unit"
  481. min-width="100"
  482. show-overflow-tooltip
  483. ></el-table-column>
  484. <el-table-column
  485. align="right"
  486. label="订单数量"
  487. prop="qty"
  488. min-width="100"
  489. show-overflow-tooltip
  490. ></el-table-column>
  491. <el-table-column
  492. align="right"
  493. label="发货数量"
  494. prop="hasSendQty"
  495. min-width="100"
  496. show-overflow-tooltip
  497. ></el-table-column>
  498. <el-table-column
  499. align="right"
  500. label="直调数量"
  501. prop="directTransferQty"
  502. min-width="100"
  503. show-overflow-tooltip
  504. >
  505. <template slot-scope="scope">
  506. <el-input
  507. v-model="scope.row.realDirectTransferQty"
  508. :disabled="!scope.row.isDirectTransfer"
  509. size="small"
  510. type="number"
  511. @mousewheel.native.prevent
  512. ></el-input>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. align="right"
  517. label="单价"
  518. prop="price"
  519. min-width="100"
  520. show-overflow-tooltip
  521. ></el-table-column>
  522. <el-table-column
  523. align="right"
  524. label="金额"
  525. prop="totalAmount"
  526. min-width="100"
  527. show-overflow-tooltip
  528. ></el-table-column>
  529. <el-table-column
  530. align="right"
  531. label="实际返利金额"
  532. prop="payRebateAmount"
  533. min-width="110"
  534. show-overflow-tooltip
  535. ></el-table-column>
  536. <el-table-column
  537. align="center"
  538. label="备注"
  539. prop="remark"
  540. min-width="160"
  541. show-overflow-tooltip
  542. ></el-table-column>
  543. </el-table>
  544. </div>
  545. <span slot="footer" class="dialog-footer">
  546. <el-button @click="closeDeliverDialog">取 消</el-button>
  547. <el-button type="primary" @click="submitDeliverForm" :loading="formLoading">确 定</el-button>
  548. </span>
  549. </el-dialog>
  550. <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
  551. <el-form
  552. ref="directForm"
  553. :model="directForm"
  554. :rules="directFormRules"
  555. label-width="80px"
  556. size="small"
  557. label-position="left"
  558. >
  559. <el-row :gutter="20">
  560. <el-col :xs="12" :sm="6" :lg="6">
  561. <el-form-item label="调出仓库" prop="warehouse1">
  562. <el-select
  563. v-model="directForm.warehouse1"
  564. placeholder="请选择调出仓库"
  565. style="width: 100%"
  566. filterable
  567. @change="changeWarehouse1"
  568. >
  569. <el-option
  570. v-for="item in warehouseList1"
  571. :key="item.id"
  572. :label="item.name"
  573. :value="item.id"
  574. ></el-option>
  575. </el-select>
  576. </el-form-item>
  577. </el-col>
  578. <el-col :xs="12" :sm="6" :lg="6">
  579. <el-form-item label="调出仓位" prop="position1">
  580. <el-select
  581. v-model="directForm.position1"
  582. placeholder="请调出仓位"
  583. style="width: 100%"
  584. filterable
  585. @change="changePosition1"
  586. >
  587. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  588. </el-select>
  589. </el-form-item>
  590. </el-col>
  591. <el-col :xs="12" :sm="6" :lg="6">
  592. <el-form-item label="调入仓库" prop="warehouse2">
  593. <el-select
  594. v-model="directForm.warehouse2"
  595. placeholder="请选择调入仓库"
  596. style="width: 100%"
  597. filterable
  598. @change="changeWarehouse2"
  599. >
  600. <el-option
  601. v-for="item in warehouseList2"
  602. :key="item.id"
  603. :label="item.name"
  604. :value="item.id"
  605. ></el-option>
  606. </el-select>
  607. </el-form-item>
  608. </el-col>
  609. <el-col :xs="12" :sm="6" :lg="6">
  610. <el-form-item label="调入仓位" prop="position2">
  611. <el-select
  612. v-model="directForm.position2"
  613. placeholder="请调入仓位"
  614. style="width: 100%"
  615. filterable
  616. @change="changePosition2"
  617. >
  618. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  619. </el-select>
  620. </el-form-item>
  621. </el-col>
  622. </el-row>
  623. </el-form>
  624. <div class="table" style="margin-top: 20px">
  625. <el-table
  626. :data="directGoodsList"
  627. element-loading-text="Loading"
  628. border
  629. fit
  630. highlight-current-row
  631. stripe
  632. max-height="400"
  633. >
  634. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  635. <el-table-column
  636. align="center"
  637. label="销售类型"
  638. prop="saleTypeName"
  639. min-width="100"
  640. show-overflow-tooltip
  641. ></el-table-column>
  642. <el-table-column
  643. align="center"
  644. label="物料代码"
  645. prop="materialNumber"
  646. min-width="160"
  647. show-overflow-tooltip
  648. ></el-table-column>
  649. <el-table-column
  650. align="center"
  651. label="产品编码"
  652. prop="materialOldNumber"
  653. min-width="160"
  654. show-overflow-tooltip
  655. ></el-table-column>
  656. <el-table-column
  657. align="center"
  658. label="产品名称"
  659. prop="materialName"
  660. min-width="160"
  661. show-overflow-tooltip
  662. ></el-table-column>
  663. <el-table-column
  664. align="center"
  665. label="规格型号"
  666. prop="specification"
  667. min-width="160"
  668. show-overflow-tooltip
  669. ></el-table-column>
  670. <el-table-column
  671. align="center"
  672. label="单位"
  673. prop="unit"
  674. min-width="100"
  675. show-overflow-tooltip
  676. ></el-table-column>
  677. <el-table-column
  678. align="center"
  679. label="数量"
  680. prop="qty"
  681. min-width="100"
  682. show-overflow-tooltip
  683. ></el-table-column>
  684. <el-table-column
  685. align="center"
  686. label="调出仓库"
  687. prop="warehouse1"
  688. min-width="100"
  689. show-overflow-tooltip
  690. ></el-table-column>
  691. <el-table-column
  692. align="center"
  693. label="调出仓位"
  694. prop="position1"
  695. min-width="100"
  696. show-overflow-tooltip
  697. ></el-table-column>
  698. <el-table-column
  699. align="center"
  700. label="调入仓库"
  701. prop="warehouse2"
  702. min-width="100"
  703. show-overflow-tooltip
  704. ></el-table-column>
  705. <el-table-column
  706. align="center"
  707. label="调入仓位"
  708. prop="position2"
  709. min-width="100"
  710. show-overflow-tooltip
  711. ></el-table-column>
  712. <el-table-column
  713. align="center"
  714. label="调出库存状态"
  715. prop="status1"
  716. min-width="110"
  717. show-overflow-tooltip
  718. ></el-table-column>
  719. <el-table-column
  720. align="center"
  721. label="调入库存状态"
  722. prop="status2"
  723. min-width="110"
  724. show-overflow-tooltip
  725. ></el-table-column>
  726. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  727. <template slot-scope="">弘格</template>
  728. </el-table-column>
  729. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  730. <template slot-="scope">弘格</template>
  731. </el-table-column>
  732. <el-table-column
  733. align="center"
  734. label="备注"
  735. prop="remark"
  736. min-width="160"
  737. show-overflow-tooltip
  738. ></el-table-column>
  739. </el-table>
  740. </div>
  741. <span slot="footer" class="dialog-footer">
  742. <el-button @click="closeDirectDialog">取 消</el-button>
  743. <el-button type="primary" @click="submitDirectForm" :loading="formLoading">确 定</el-button>
  744. </span>
  745. </el-dialog>
  746. <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
  747. </div>
  748. </template>
  749. <script>
  750. import {
  751. getOrderDetail,
  752. closeHome,
  753. overOrder,
  754. getWarehouseList,
  755. deliverOrder,
  756. directOrder,
  757. getPositionList,
  758. editRemarkHome
  759. } from '@/api/supply/engin'
  760. import CheckOrder from '@/components/Common/check-order'
  761. export default {
  762. name: 'HomeDetail',
  763. componentName: 'HomeDetail',
  764. components: {
  765. CheckOrder
  766. },
  767. props: ['listItem'],
  768. filters: {
  769. statusFilter(val) {
  770. const statusList = [
  771. { label: '已保存', value: 'SAVE' },
  772. { label: '待审核', value: 'WAIT' },
  773. { label: '审核通过', value: 'OK' },
  774. // { label: '审核驳回', value: 'FAIL' },,
  775. { label: '已关闭', value: 'CLOSE' }
  776. ]
  777. let obj = statusList.find(o => o.value == val)
  778. return obj ? obj.label : ''
  779. }
  780. },
  781. data() {
  782. return {
  783. detailData: {},
  784. isShowDeliverDialog: false,
  785. deliverForm: {
  786. date: '',
  787. position: '',
  788. remark: ''
  789. },
  790. deliverFormRules: {
  791. // date: [
  792. // { required: true, message: "请选择发货日期", trigger: "change" },
  793. // ],
  794. position: [{ required: true, message: '请选择仓位', trigger: 'change' }]
  795. },
  796. positionList: [],
  797. deliverGoodsList: [],
  798. isShowDirectDialog: false,
  799. directForm: {
  800. warehouse1: '',
  801. position1: '',
  802. warehouse2: '',
  803. position2: ''
  804. },
  805. directFormRules: {
  806. warehouse1: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
  807. position1: [{ required: true, message: '请选择调出仓位', trigger: 'change' }],
  808. warehouse2: [{ required: true, message: '请选择调入仓库', trigger: 'change' }],
  809. position2: [{ required: true, message: '请选择调入仓位', trigger: 'change' }]
  810. },
  811. warehouseList1: [],
  812. warehouseList2: [],
  813. positionList1: [],
  814. positionList2: [],
  815. directGoodsList: [],
  816. formLoading: false,
  817. checkOrderId: {},
  818. isShowCheckOrder: false
  819. }
  820. },
  821. computed: {
  822. isExamine() {
  823. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  824. },
  825. isDealer() {
  826. console.log(JSON.parse(localStorage.getItem('supply_user')).isCustomer, '898')
  827. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  828. }
  829. },
  830. created() {
  831. this.getDetail()
  832. },
  833. methods: {
  834. // 返回列表
  835. goBack() {
  836. this.$emit('backListFormDetail')
  837. },
  838. // 获取仓库列表
  839. getWarehouseList() {
  840. getWarehouseList({
  841. pageNum: 1,
  842. pageSize: -1
  843. }).then(res => {
  844. this.warehouseList1 = res.data.records
  845. this.warehouseList2 = res.data.records
  846. })
  847. },
  848. // 获取虚拟仓位列表
  849. getPositionList() {
  850. getPositionList({
  851. pageNum: 1,
  852. pageSize: -1,
  853. type: 2
  854. }).then(res => {
  855. this.positionList = res.data.records
  856. })
  857. },
  858. // 获取详情
  859. getDetail() {
  860. getOrderDetail({ id: this.listItem.parentId }).then(res => {
  861. if (res.data.items) {
  862. res.data.items.forEach(item => {
  863. item.number = (item.qty * 100 - item.retiredQty * 100) / 100
  864. item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
  865. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
  866. })
  867. }
  868. this.detailData = res.data
  869. })
  870. },
  871. // 关闭订单
  872. closeData() {
  873. this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
  874. confirmButtonText: '确定',
  875. cancelButtonText: '取消',
  876. type: 'warning'
  877. })
  878. .then(() => {
  879. closeHome({
  880. id: this.listItem.parentId,
  881. refEnginRecordNo: this.detailData.refEnginRecordNo
  882. }).then(res => {
  883. this.$successMsg()
  884. this.getDetail()
  885. })
  886. })
  887. .catch(() => {})
  888. },
  889. // 直调完结
  890. overData() {
  891. this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
  892. confirmButtonText: '确定',
  893. cancelButtonText: '取消',
  894. type: 'warning'
  895. })
  896. .then(() => {
  897. overOrder({
  898. id: this.listItem.parentId,
  899. refEnginRecordNo: this.detailData.refEnginRecordNo
  900. }).then(res => {
  901. this.$successMsg()
  902. this.getDetail()
  903. })
  904. })
  905. .catch(() => {})
  906. },
  907. // 更改仓库
  908. changeWarehouse() {
  909. this.deliverForm.position = ''
  910. let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
  911. this.positionList = obj.kingDeeStocks
  912. },
  913. // 打开 直调发货
  914. openDeliverDialog() {
  915. this.isShowDeliverDialog = true
  916. this.deliverGoodsList = this.detailData.items
  917. this.deliverGoodsList.forEach(item => {
  918. item.warehouse1 = ''
  919. item.warehouse2 = ''
  920. item.position1 = ''
  921. item.position2 = ''
  922. item.status1 = ''
  923. item.status2 = ''
  924. this.$set(item, 'realDirectTransferQty', item.refundableQty)
  925. })
  926. this.getPositionList()
  927. },
  928. // 关闭 直调发货
  929. closeDeliverDialog() {
  930. this.isShowDeliverDialog = false
  931. },
  932. // 提交 直调发货
  933. submitDeliverForm() {
  934. this.$refs.deliverForm.validate(valid => {
  935. if (valid) {
  936. for (let i = 0; i < this.deliverGoodsList.length; i++) {
  937. if (!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
  938. this.$errorMsg('请输入直调数量')
  939. return
  940. }
  941. }
  942. let params = {
  943. enginOrderId: this.detailData.enginOrderId,
  944. enginOrderType: 'HOME', // TRADE=商用 HOME=家用
  945. deliverDate: '',
  946. correspondId: this.deliverForm.position,
  947. remark: this.deliverForm.remark,
  948. refEnginRecordNo: this.detailData.refEnginRecordNo,
  949. items: this.deliverGoodsList
  950. }
  951. this.formLoading = true
  952. deliverOrder(params)
  953. .then(res => {
  954. this.$successMsg()
  955. this.isShowDeliverDialog = false
  956. this.getDetail()
  957. })
  958. .finally(res => {
  959. this.formLoading = false
  960. })
  961. }
  962. })
  963. },
  964. // 更改调出仓库
  965. changeWarehouse1() {
  966. this.directForm.position1 = ''
  967. let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  968. this.positionList1 = obj.kingDeeStocks
  969. this.directGoodsList.forEach(item => {
  970. item.warehouse1 = obj.name
  971. })
  972. },
  973. // 更改调入仓库
  974. changeWarehouse2() {
  975. this.directForm.position2 = ''
  976. let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  977. this.positionList2 = obj.kingDeeStocks
  978. this.directGoodsList.forEach(item => {
  979. item.warehouse2 = obj.name
  980. })
  981. },
  982. // 更改调出仓位
  983. changePosition1() {
  984. let obj = this.positionList1.find(o => o.id == this.directForm.position1)
  985. this.directGoodsList.forEach(item => {
  986. item.position1 = obj.name
  987. item.status1 = obj.defStockStatusName
  988. })
  989. },
  990. // 更改调入仓位
  991. changePosition2() {
  992. let obj = this.positionList2.find(o => o.id == this.directForm.position2)
  993. this.directGoodsList.forEach(item => {
  994. item.position2 = obj.name
  995. item.status2 = obj.defStockStatusName
  996. })
  997. },
  998. // 打开 提前开票
  999. openDirectDialog() {
  1000. this.isShowDirectDialog = true
  1001. this.directGoodsList = this.detailData.items
  1002. this.getWarehouseList()
  1003. },
  1004. // 关闭 提前开票
  1005. closeDirectDialog() {
  1006. this.isShowDirectDialog = false
  1007. },
  1008. // 提交 提前开票
  1009. submitDirectForm() {
  1010. this.$refs.directForm.validate(valid => {
  1011. if (valid) {
  1012. let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  1013. let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
  1014. let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  1015. let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
  1016. let params = {
  1017. orderNo: this.detailData.enginOrderId,
  1018. orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  1019. correspondId: this.directForm.warehouse1,
  1020. correspondName: warehouseItem1.name,
  1021. stockId: this.directForm.position1,
  1022. stockName: positionItem1.name,
  1023. inCorrespondId: this.directForm.warehouse2,
  1024. inCorrespondName: warehouseItem2.name,
  1025. inStockId: this.directForm.position2,
  1026. inStockName: positionItem2.name,
  1027. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  1028. }
  1029. this.formLoading = true
  1030. directOrder(params)
  1031. .then(res => {
  1032. this.$successMsg()
  1033. this.isShowDirectDialog = false
  1034. this.getDetail()
  1035. })
  1036. .finally(res => {
  1037. this.formLoading = false
  1038. })
  1039. }
  1040. })
  1041. },
  1042. // 联查单据
  1043. toCheckOrder() {
  1044. this.checkOrderId = this.detailData.enginOrderId
  1045. this.isShowCheckOrder = true
  1046. },
  1047. // 保存备注
  1048. saveRemark() {
  1049. editRemarkHome({
  1050. enginOrderId: this.detailData.enginOrderId,
  1051. geLiInerNote: this.detailData.geLiInerNote,
  1052. refEnginRecordNo: this.detailData.refEnginRecordNo
  1053. }).then(res => {
  1054. this.$successMsg('编辑成功')
  1055. this.getDetail()
  1056. })
  1057. },
  1058. backDetail() {
  1059. this.isShowCheckOrder = false
  1060. }
  1061. }
  1062. }
  1063. </script>
  1064. <style scoped lang="scss">
  1065. .detail-container {
  1066. width: 100%;
  1067. height: 100%;
  1068. }
  1069. .main-title {
  1070. display: flex;
  1071. justify-content: space-between;
  1072. align-items: center;
  1073. margin-top: 20px;
  1074. height: 60px;
  1075. border-bottom: 1px solid #dcdfe6;
  1076. margin-bottom: 20px;
  1077. .title {
  1078. font-size: 16px;
  1079. font-weight: 600;
  1080. padding-left: 10px;
  1081. }
  1082. }
  1083. </style>