home_detail.vue 37 KB

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