home_detail.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  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.refProjectNo }}</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="返利比例" min-width="100" prop="rebateRate" show-overflow-tooltip />
  285. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  286. <template slot-scope="scope">
  287. {{ scope.row.discAmount | numToFixed }}
  288. </template>
  289. </el-table-column>
  290. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  291. <template slot-scope="scope">
  292. {{ scope.row.payAmount | numToFixed }}
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. align="right"
  297. label="退订数量"
  298. prop="retiredQty"
  299. min-width="100"
  300. show-overflow-tooltip
  301. />
  302. <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
  303. <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
  304. <el-table-column
  305. align="left"
  306. label="是否直调"
  307. prop="isDirectTransfer"
  308. min-width="100"
  309. show-overflow-tooltip
  310. >
  311. <template slot-scope="scope">
  312. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  313. </template>
  314. </el-table-column>
  315. <el-table-column
  316. align="right"
  317. label="直调数量"
  318. prop="directTransferQty"
  319. min-width="100"
  320. show-overflow-tooltip
  321. />
  322. <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  323. <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column> -->
  324. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  325. <el-table-column
  326. align="left"
  327. label="实装物料编号"
  328. prop="realMaterialNumber"
  329. min-width="150"
  330. show-overflow-tooltip
  331. >
  332. <template slot-scope="scope">
  333. <div :style="scope.row.realMaterialNumber != scope.row.materialNumber ? { color: 'blue' } : ''">
  334. {{ scope.row.realMaterialNumber }}
  335. </div>
  336. </template>
  337. </el-table-column>
  338. <el-table-column
  339. align="left"
  340. label="实装厂产品编码"
  341. prop="realMaterialOldNumber"
  342. min-width="200"
  343. show-overflow-tooltip
  344. >
  345. <template slot-scope="scope">
  346. <div :style="scope.row.realMaterialOldNumber != scope.row.materialOldNumber ? { color: 'blue' } : ''">
  347. {{ scope.row.realMaterialOldNumber }}
  348. </div>
  349. </template>
  350. </el-table-column>
  351. <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
  352. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  353. </el-table>
  354. </div>
  355. <div v-if="detailData.examineStatus == 'OK'" class="table" style="margin-top: 20px">
  356. <el-table
  357. :data="detailData.refundNoteList"
  358. element-loading-text="Loading"
  359. border
  360. fit
  361. highlight-current-row
  362. stripe
  363. max-height="400"
  364. show-summary
  365. :summary-method="$getSummaries"
  366. >
  367. <el-table-column align="center" label="序号" type="index" width="50" />
  368. <el-table-column align="left" label="创建人" prop="createBy" show-overflow-tooltip />
  369. <el-table-column align="left" label="创建时间" prop="createTime" show-overflow-tooltip />
  370. <el-table-column align="left" label="退订说明" prop="refundNote" show-overflow-tooltip />
  371. </el-table>
  372. </div>
  373. </div>
  374. <div class="page-footer">
  375. <div class="footer">
  376. <el-button type="success" @click="toCheckOrder">联查单据</el-button>
  377. <el-button
  378. v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')"
  379. type="danger"
  380. @click="closeData"
  381. >关闭订单</el-button>
  382. <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
  383. <el-button
  384. v-if="!isDealer"
  385. type="primary"
  386. :disabled="detailData.directTransferStatus"
  387. @click="overData"
  388. >直调完结</el-button>
  389. <el-button
  390. v-if="!isDealer"
  391. type="primary"
  392. :disabled="detailData.directTransferStatus"
  393. @click="openDeliverDialog"
  394. >直调发货</el-button>
  395. <el-button @click="goBack">返回列表</el-button>
  396. </div>
  397. </div>
  398. </div>
  399. <el-dialog title="直调发货" append-to-body :visible.sync="isShowDeliverDialog" width="80%">
  400. <el-form
  401. ref="deliverForm"
  402. :model="deliverForm"
  403. :rules="deliverFormRules"
  404. label-width="120px"
  405. size="small"
  406. label-position="left"
  407. >
  408. <el-row :gutter="20">
  409. <!-- <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">-->
  410. <!-- <el-form-item label="发货日期" prop="date">-->
  411. <!-- <el-date-picker-->
  412. <!-- v-model="deliverForm.date"-->
  413. <!-- type="date"-->
  414. <!-- value-format="yyyy-MM-dd"-->
  415. <!-- style="width: 100%"-->
  416. <!-- placeholder="选择日期"-->
  417. <!-- >-->
  418. <!-- </el-date-picker>-->
  419. <!-- </el-form-item>-->
  420. <!-- </el-col>-->
  421. <el-col :xs="8" :sm="8" :lg="8">
  422. <el-form-item label="选择仓位" prop="position">
  423. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  424. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id" />
  425. </el-select>
  426. </el-form-item>
  427. </el-col>
  428. <el-col :xs="8" :sm="8" :lg="8">
  429. <el-form-item label="发货申请备注" prop="remark">
  430. <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable />
  431. </el-form-item>
  432. </el-col>
  433. </el-row>
  434. </el-form>
  435. <div class="table" style="margin-top: 20px">
  436. <el-table
  437. :data="deliverGoodsList"
  438. element-loading-text="Loading"
  439. border
  440. fit
  441. highlight-current-row
  442. stripe
  443. max-height="400"
  444. >
  445. <el-table-column align="center" label="序号" type="index" width="50" />
  446. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  447. <el-table-column
  448. align="center"
  449. label="物料编码"
  450. prop="materialNumber"
  451. min-width="160"
  452. show-overflow-tooltip
  453. />
  454. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  455. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
  456. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  457. <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip />
  458. <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  459. <el-table-column
  460. align="right"
  461. label="直调数量"
  462. prop="directTransferQty"
  463. min-width="100"
  464. show-overflow-tooltip
  465. >
  466. <template slot-scope="scope">
  467. <el-input
  468. v-model="scope.row.realDirectTransferQty"
  469. :disabled="!scope.row.isDirectTransfer"
  470. size="small"
  471. type="number"
  472. @mousewheel.native.prevent
  473. />
  474. </template>
  475. </el-table-column>
  476. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip />
  477. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip />
  478. <el-table-column
  479. align="right"
  480. label="实际返利金额"
  481. prop="payRebateAmount"
  482. min-width="110"
  483. show-overflow-tooltip
  484. />
  485. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  486. </el-table>
  487. </div>
  488. <span slot="footer" class="dialog-footer">
  489. <el-button @click="closeDeliverDialog">取 消</el-button>
  490. <el-button type="primary" :loading="formLoading" @click="submitDeliverForm">确 定</el-button>
  491. </span>
  492. </el-dialog>
  493. <el-dialog title="直接调拨单(提前开票)" append-to-body :visible.sync="isShowDirectDialog" width="80%">
  494. <el-form
  495. ref="directForm"
  496. :model="directForm"
  497. :rules="directFormRules"
  498. label-width="80px"
  499. size="small"
  500. label-position="left"
  501. >
  502. <el-row :gutter="20">
  503. <el-col :xs="12" :sm="6" :lg="6">
  504. <el-form-item label="调出仓库" prop="warehouse1">
  505. <el-select
  506. v-model="directForm.warehouse1"
  507. placeholder="请选择调出仓库"
  508. style="width: 100%"
  509. filterable
  510. @change="changeWarehouse1"
  511. >
  512. <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id" />
  513. </el-select>
  514. </el-form-item>
  515. </el-col>
  516. <el-col :xs="12" :sm="6" :lg="6">
  517. <el-form-item label="调出仓位" prop="position1">
  518. <el-select
  519. v-model="directForm.position1"
  520. placeholder="请调出仓位"
  521. style="width: 100%"
  522. filterable
  523. @change="changePosition1"
  524. >
  525. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id" />
  526. </el-select>
  527. </el-form-item>
  528. </el-col>
  529. <el-col :xs="12" :sm="6" :lg="6">
  530. <el-form-item label="调入仓库" prop="warehouse2">
  531. <el-select
  532. v-model="directForm.warehouse2"
  533. placeholder="请选择调入仓库"
  534. style="width: 100%"
  535. filterable
  536. @change="changeWarehouse2"
  537. >
  538. <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id" />
  539. </el-select>
  540. </el-form-item>
  541. </el-col>
  542. <el-col :xs="12" :sm="6" :lg="6">
  543. <el-form-item label="调入仓位" prop="position2">
  544. <el-select
  545. v-model="directForm.position2"
  546. placeholder="请调入仓位"
  547. style="width: 100%"
  548. filterable
  549. @change="changePosition2"
  550. >
  551. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id" />
  552. </el-select>
  553. </el-form-item>
  554. </el-col>
  555. </el-row>
  556. </el-form>
  557. <div class="table" style="margin-top: 20px">
  558. <el-table
  559. :data="directGoodsList"
  560. element-loading-text="Loading"
  561. border
  562. fit
  563. highlight-current-row
  564. stripe
  565. max-height="400"
  566. >
  567. <el-table-column align="center" label="序号" type="index" width="50" />
  568. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  569. <el-table-column
  570. align="center"
  571. label="物料代码"
  572. prop="materialNumber"
  573. min-width="160"
  574. show-overflow-tooltip
  575. />
  576. <el-table-column
  577. align="center"
  578. label="产品编码"
  579. prop="materialOldNumber"
  580. min-width="160"
  581. show-overflow-tooltip
  582. />
  583. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  584. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
  585. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  586. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
  587. <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip />
  588. <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip />
  589. <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip />
  590. <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip />
  591. <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip />
  592. <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip />
  593. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  594. <template slot-scope="">弘格</template>
  595. </el-table-column>
  596. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  597. <template slot-="scope">弘格</template>
  598. </el-table-column>
  599. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  600. </el-table>
  601. </div>
  602. <span slot="footer" class="dialog-footer">
  603. <el-button @click="closeDirectDialog">取 消</el-button>
  604. <el-button type="primary" :loading="formLoading" @click="submitDirectForm">确 定</el-button>
  605. </span>
  606. </el-dialog>
  607. <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
  608. </div>
  609. </template>
  610. <script>
  611. import {
  612. getOrderDetail,
  613. closeHome,
  614. overOrder,
  615. getWarehouseList,
  616. deliverOrder,
  617. directOrder,
  618. getPositionList,
  619. editRemarkHome
  620. } from '@/api/supply/engin'
  621. import CheckOrder from '@/components/Common/check-order'
  622. export default {
  623. name: 'HomeDetail',
  624. componentName: 'HomeDetail',
  625. components: {
  626. CheckOrder
  627. },
  628. filters: {
  629. statusFilter(val) {
  630. const statusList = [
  631. { label: '已保存', value: 'SAVE' },
  632. { label: '待审核', value: 'WAIT' },
  633. { label: '审核通过', value: 'OK' },
  634. // { label: '审核驳回', value: 'FAIL' },,
  635. { label: '已关闭', value: 'CLOSE' }
  636. ]
  637. const obj = statusList.find(o => o.value == val)
  638. return obj ? obj.label : ''
  639. }
  640. },
  641. props: ['listItem'],
  642. data() {
  643. return {
  644. detailData: {},
  645. isShowDeliverDialog: false,
  646. deliverForm: {
  647. date: '',
  648. position: '',
  649. remark: ''
  650. },
  651. deliverFormRules: {
  652. // date: [
  653. // { required: true, message: "请选择发货日期", trigger: "change" },
  654. // ],
  655. position: [{ required: true, message: '请选择仓位', trigger: 'change' }]
  656. },
  657. positionList: [],
  658. deliverGoodsList: [],
  659. isShowDirectDialog: false,
  660. directForm: {
  661. warehouse1: '',
  662. position1: '',
  663. warehouse2: '',
  664. position2: ''
  665. },
  666. directFormRules: {
  667. warehouse1: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
  668. position1: [{ required: true, message: '请选择调出仓位', trigger: 'change' }],
  669. warehouse2: [{ required: true, message: '请选择调入仓库', trigger: 'change' }],
  670. position2: [{ required: true, message: '请选择调入仓位', trigger: 'change' }]
  671. },
  672. warehouseList1: [],
  673. warehouseList2: [],
  674. positionList1: [],
  675. positionList2: [],
  676. directGoodsList: [],
  677. formLoading: false,
  678. checkOrderId: {},
  679. isShowCheckOrder: false
  680. }
  681. },
  682. computed: {
  683. isExamine() {
  684. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  685. },
  686. isDealer() {
  687. console.log(JSON.parse(localStorage.getItem('supply_user')).isCustomer, '898')
  688. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  689. }
  690. },
  691. created() {
  692. this.getDetail()
  693. },
  694. methods: {
  695. // 返回列表
  696. goBack() {
  697. this.$emit('backListFormDetail')
  698. },
  699. // 获取仓库列表
  700. getWarehouseList() {
  701. getWarehouseList({
  702. pageNum: 1,
  703. pageSize: -1
  704. }).then(res => {
  705. this.warehouseList1 = res.data.records
  706. this.warehouseList2 = res.data.records
  707. })
  708. },
  709. // 获取虚拟仓位列表
  710. getPositionList() {
  711. getPositionList({
  712. pageNum: 1,
  713. pageSize: -1,
  714. type: 2
  715. }).then(res => {
  716. this.positionList = res.data.records
  717. })
  718. },
  719. // 获取详情
  720. getDetail() {
  721. getOrderDetail({ id: this.listItem.parentId }).then(res => {
  722. if (res.data.items) {
  723. res.data.items.forEach(item => {
  724. item.number = (item.qty * 100 - item.retiredQty * 100) / 100
  725. item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
  726. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
  727. })
  728. }
  729. this.detailData = res.data
  730. })
  731. },
  732. // 关闭订单
  733. closeData() {
  734. this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
  735. confirmButtonText: '确定',
  736. cancelButtonText: '取消',
  737. type: 'warning'
  738. })
  739. .then(() => {
  740. closeHome({
  741. id: this.listItem.parentId,
  742. refEnginRecordNo: this.detailData.refEnginRecordNo
  743. }).then(res => {
  744. this.$successMsg()
  745. this.getDetail()
  746. })
  747. })
  748. .catch(() => {})
  749. },
  750. // 直调完结
  751. overData() {
  752. this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
  753. confirmButtonText: '确定',
  754. cancelButtonText: '取消',
  755. type: 'warning'
  756. })
  757. .then(() => {
  758. overOrder({
  759. id: this.listItem.parentId,
  760. refEnginRecordNo: this.detailData.refEnginRecordNo
  761. }).then(res => {
  762. this.$successMsg()
  763. this.getDetail()
  764. })
  765. })
  766. .catch(() => {})
  767. },
  768. // 更改仓库
  769. changeWarehouse() {
  770. this.deliverForm.position = ''
  771. const obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
  772. this.positionList = obj.kingDeeStocks
  773. },
  774. // 打开 直调发货
  775. openDeliverDialog() {
  776. this.isShowDeliverDialog = true
  777. this.deliverGoodsList = this.detailData.items
  778. this.deliverGoodsList.forEach(item => {
  779. item.warehouse1 = ''
  780. item.warehouse2 = ''
  781. item.position1 = ''
  782. item.position2 = ''
  783. item.status1 = ''
  784. item.status2 = ''
  785. this.$set(item, 'realDirectTransferQty', item.refundableQty)
  786. })
  787. this.getPositionList()
  788. },
  789. // 关闭 直调发货
  790. closeDeliverDialog() {
  791. this.isShowDeliverDialog = false
  792. },
  793. // 提交 直调发货
  794. submitDeliverForm() {
  795. this.$refs.deliverForm.validate(valid => {
  796. if (valid) {
  797. for (let i = 0; i < this.deliverGoodsList.length; i++) {
  798. if (!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
  799. this.$errorMsg('请输入直调数量')
  800. return
  801. }
  802. }
  803. const params = {
  804. enginOrderId: this.detailData.enginOrderId,
  805. enginOrderType: 'HOME', // TRADE=商用 HOME=家用
  806. deliverDate: '',
  807. correspondId: this.deliverForm.position,
  808. remark: this.deliverForm.remark,
  809. refEnginRecordNo: this.detailData.refEnginRecordNo,
  810. items: this.deliverGoodsList
  811. }
  812. this.formLoading = true
  813. deliverOrder(params)
  814. .then(res => {
  815. this.$successMsg()
  816. this.isShowDeliverDialog = false
  817. this.getDetail()
  818. })
  819. .finally(res => {
  820. this.formLoading = false
  821. })
  822. }
  823. })
  824. },
  825. // 更改调出仓库
  826. changeWarehouse1() {
  827. this.directForm.position1 = ''
  828. const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  829. this.positionList1 = obj.kingDeeStocks
  830. this.directGoodsList.forEach(item => {
  831. item.warehouse1 = obj.name
  832. })
  833. },
  834. // 更改调入仓库
  835. changeWarehouse2() {
  836. this.directForm.position2 = ''
  837. const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  838. this.positionList2 = obj.kingDeeStocks
  839. this.directGoodsList.forEach(item => {
  840. item.warehouse2 = obj.name
  841. })
  842. },
  843. // 更改调出仓位
  844. changePosition1() {
  845. const obj = this.positionList1.find(o => o.id == this.directForm.position1)
  846. this.directGoodsList.forEach(item => {
  847. item.position1 = obj.name
  848. item.status1 = obj.defStockStatusName
  849. })
  850. },
  851. // 更改调入仓位
  852. changePosition2() {
  853. const obj = this.positionList2.find(o => o.id == this.directForm.position2)
  854. this.directGoodsList.forEach(item => {
  855. item.position2 = obj.name
  856. item.status2 = obj.defStockStatusName
  857. })
  858. },
  859. // 打开 提前开票
  860. openDirectDialog() {
  861. this.isShowDirectDialog = true
  862. this.directGoodsList = this.detailData.items
  863. this.getWarehouseList()
  864. },
  865. // 关闭 提前开票
  866. closeDirectDialog() {
  867. this.isShowDirectDialog = false
  868. },
  869. // 提交 提前开票
  870. submitDirectForm() {
  871. this.$refs.directForm.validate(valid => {
  872. if (valid) {
  873. const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
  874. const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
  875. const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
  876. const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
  877. const params = {
  878. orderNo: this.detailData.enginOrderId,
  879. orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  880. correspondId: this.directForm.warehouse1,
  881. correspondName: warehouseItem1.name,
  882. stockId: this.directForm.position1,
  883. stockName: positionItem1.name,
  884. inCorrespondId: this.directForm.warehouse2,
  885. inCorrespondName: warehouseItem2.name,
  886. inStockId: this.directForm.position2,
  887. inStockName: positionItem2.name,
  888. refEnginRecordNo: this.detailData.refEnginRecordNo || ''
  889. }
  890. this.formLoading = true
  891. directOrder(params)
  892. .then(res => {
  893. this.$successMsg()
  894. this.isShowDirectDialog = false
  895. this.getDetail()
  896. })
  897. .finally(res => {
  898. this.formLoading = false
  899. })
  900. }
  901. })
  902. },
  903. // 联查单据
  904. toCheckOrder() {
  905. this.checkOrderId = this.detailData.enginOrderId
  906. this.isShowCheckOrder = true
  907. },
  908. // 保存备注
  909. saveRemark() {
  910. editRemarkHome({
  911. enginOrderId: this.detailData.enginOrderId,
  912. geLiInerNote: this.detailData.geLiInerNote,
  913. refEnginRecordNo: this.detailData.refEnginRecordNo
  914. }).then(res => {
  915. this.$successMsg('编辑成功')
  916. this.getDetail()
  917. })
  918. },
  919. backDetail() {
  920. this.isShowCheckOrder = false
  921. }
  922. }
  923. }
  924. </script>
  925. <style scoped lang="scss">
  926. .detail-container {
  927. width: 100%;
  928. height: 100%;
  929. }
  930. .main-title {
  931. display: flex;
  932. justify-content: space-between;
  933. align-items: center;
  934. margin-top: 20px;
  935. height: 60px;
  936. border-bottom: 1px solid #dcdfe6;
  937. margin-bottom: 20px;
  938. .title {
  939. font-size: 16px;
  940. font-weight: 600;
  941. padding-left: 10px;
  942. }
  943. }
  944. </style>