home_examine.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header content="审批" @back="goBack" />
  4. <div class="main-title">
  5. <div class="title">
  6. 工程订单 <span style="margin-left: 20px">经销商名称:{{ detailData.customerName }}</span>
  7. </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">{{ detailData.examineStatus | statusFilter }}</div>
  22. </el-col>
  23. <el-col :span="8" class="item">
  24. <div class="label">经销商编码</div>
  25. <div class="value">{{ detailData.customerNumber }}</div>
  26. </el-col>
  27. <el-col :span="16" class="item">
  28. <div class="label">经销商名称</div>
  29. <div class="value">{{ detailData.customerName }}</div>
  30. </el-col>
  31. <el-col :span="8" class="item">
  32. <div class="label">工程登录编号</div>
  33. <div class="value">{{ detailData.refEnginRecordNo }}</div>
  34. </el-col>
  35. <el-col :span="8" class="item">
  36. <div class="label">项目类别</div>
  37. <div class="value">
  38. <el-input v-model="detailData.refProjectCategory" placeholder="请输入项目类别" />
  39. </div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">行业类别</div>
  43. <div class="value">
  44. <el-input v-model="detailData.refTradeCategory" :disabled="isDealer" placeholder="请输入行业类别" />
  45. </div>
  46. </el-col>
  47. <el-col :span="8" class="item">
  48. <div class="label">跨区厂编号</div>
  49. <div class="value">
  50. <el-input v-model="detailData.refFactoryNo" placeholder="请输入跨区厂编号" />
  51. </div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">使用单位</div>
  55. <div class="value">
  56. <el-input v-model="detailData.refUseUnit" placeholder="请输入使用单位" />
  57. </div>
  58. </el-col>
  59. <el-col :span="8" class="item">
  60. <div class="label">购买单位</div>
  61. <div class="value">
  62. <el-input v-model="detailData.refBuyUnitName" placeholder="请输入购买单位" />
  63. </div>
  64. </el-col>
  65. <el-col :span="8" class="item">
  66. <div class="label">区域</div>
  67. <div class="value">{{ detailData.refRegionWork }}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">销售类型</div>
  71. <div class="value">
  72. <el-select
  73. v-model="detailData.saleTypeId"
  74. placeholder="选择销售类型"
  75. size="small"
  76. style="width: 100%"
  77. :disabled="detailData.examineStatus == 'OK' && isDealer"
  78. clearable
  79. >
  80. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id">
  81. <span>{{ item.saleName }}</span> <span style="color: #f00">{{ item.saleCode }}</span>
  82. </el-option>
  83. </el-select>
  84. </div>
  85. </el-col>
  86. <el-col :span="8" class="item">
  87. <div class="label">第几申报</div>
  88. <div class="value">
  89. <el-input v-model="detailData.refDeclareNo" placeholder="请输入第几申报" />
  90. </div>
  91. </el-col>
  92. <el-col :span="8" class="item">
  93. <div class="label">联系人</div>
  94. <div class="value">
  95. <el-input v-model="detailData.refLinkman" placeholder="请输入联系人" />
  96. </div>
  97. </el-col>
  98. <el-col :span="8" class="item">
  99. <div class="label">固定电话</div>
  100. <div class="value">
  101. <el-input v-model="detailData.refTel" placeholder="请输入固定电话" />
  102. </div>
  103. </el-col>
  104. <el-col :span="8" class="item">
  105. <div class="label">移动电话</div>
  106. <div class="value">
  107. <el-input v-model="detailData.refPhone" placeholder="请输入移动电话" />
  108. </div>
  109. </el-col>
  110. <el-col :span="16" class="item">
  111. <div class="label">安装地址</div>
  112. <div class="value">
  113. <el-input v-model="detailData.refInstallAddress" placeholder="请输入安装地址" />
  114. </div>
  115. </el-col>
  116. <el-col :span="8" class="item">
  117. <div class="label">保证函</div>
  118. <div class="value">
  119. <el-select
  120. v-model="detailData.refPromiseProvide"
  121. placeholder="选择保证函状态"
  122. size="small"
  123. clearable
  124. style="width: 100%"
  125. >
  126. <el-option label="未保证" value="未保证" />
  127. <el-option label="已保证" value="已保证" />
  128. </el-select>
  129. </div>
  130. </el-col>
  131. <el-col :span="8" class="item">
  132. <div class="label">不扣押金</div>
  133. <div class="value">
  134. <!-- {{detailData.takeDeposit ? '是':'否'}} -->
  135. <el-checkbox v-model="detailData.takeDeposit">{{ detailData.takeDeposit ? '是' : '否' }}</el-checkbox>
  136. </div>
  137. </el-col>
  138. <el-col :span="8" class="item">
  139. <div class="label">文件编号</div>
  140. <div class="value">
  141. <el-input v-model="detailData.fileNo" placeholder="请输入文件编号" />
  142. </div>
  143. </el-col>
  144. <el-col :span="8" class="item">
  145. <div class="label">业务员</div>
  146. <div class="value">
  147. <el-select
  148. v-model="detailData.serviceId"
  149. placeholder="选择业务员"
  150. size="small"
  151. filterable
  152. clearable
  153. style="width: 100%"
  154. >
  155. <el-option
  156. v-for="item in salesmanList"
  157. :key="item.adminUserId"
  158. :label="item.nickName"
  159. :value="item.adminUserId"
  160. />
  161. </el-select>
  162. </div>
  163. </el-col>
  164. <!-- <el-col :span="24" class="item">
  165. <div class="label">格力回复</div>
  166. <div class="value">
  167. <el-input v-model="detailData.note1" placeholder="请输入格力回复"></el-input>
  168. </div>
  169. </el-col>
  170. <el-col :span="24" class="item">
  171. <div class="label">格力内部备注</div>
  172. <div class="value">
  173. <el-input v-model="detailData.note2" placeholder="请输入格力内部备注"></el-input>
  174. </div>
  175. </el-col> -->
  176. <el-col :span="8" class="item">
  177. <div class="label">登录有效期</div>
  178. <div class="value">{{ detailData.refBillsExpireDate }}</div>
  179. </el-col>
  180. <el-col :span="8" class="item">
  181. <div class="label">项目编号</div>
  182. <div class="value">{{ detailData.refProjectNo }}</div>
  183. </el-col>
  184. <el-col :span="16" class="item">
  185. <div class="label">项目说明</div>
  186. <div class="value">
  187. <el-input v-model="detailData.refProjectNote" placeholder="请输入项目说明" />
  188. </div>
  189. </el-col>
  190. <el-col :span="8" class="item">
  191. <div class="label">项目类型</div>
  192. <div class="value">
  193. <el-input v-model="detailData.refProjectType" placeholder="请输入项目类型" />
  194. </div>
  195. </el-col>
  196. <el-col :span="24" class="item">
  197. <div class="label">工程机转零售批复意见</div>
  198. <div class="value">{{ detailData.refToRetailIdea }}</div>
  199. </el-col>
  200. <el-col :span="24" class="item">
  201. <div class="label">合同变更批复意见</div>
  202. <div class="value">{{ detailData.refContractIdea }}</div>
  203. </el-col>
  204. <el-col :span="24" class="item">
  205. <div class="label">资料延期批复意见</div>
  206. <div class="value">{{ detailData.refDataDelayIdea }}</div>
  207. </el-col>
  208. <el-col :span="24" class="item">
  209. <div class="label">其他附件审批意见</div>
  210. <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
  211. </el-col>
  212. <el-col :span="24" class="item">
  213. <div class="label">格力内部备注</div>
  214. <div class="value">
  215. <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注" />
  216. </div>
  217. </el-col>
  218. <el-col :span="24" class="item">
  219. <div class="label">备注</div>
  220. <div class="value">
  221. <el-input v-model="detailData.remark" placeholder="请输入备注" />
  222. </div>
  223. </el-col>
  224. <el-col :span="6" class="item">
  225. <div class="label">制单人</div>
  226. <div class="value">{{ detailData.createName }}</div>
  227. </el-col>
  228. <el-col :span="6" class="item">
  229. <div class="label">制单日期</div>
  230. <div class="value">{{ detailData.createTime }}</div>
  231. </el-col>
  232. <el-col :span="6" class="item">
  233. <div class="label">关闭人</div>
  234. <div class="value">{{ detailData.closeName }}</div>
  235. </el-col>
  236. <el-col :span="6" class="item">
  237. <div class="label">关闭日期</div>
  238. <div class="value">{{ detailData.closeTime }}</div>
  239. </el-col>
  240. <el-col v-if="!isDealer" :span="24" class="item">
  241. <div class="label">引用记录</div>
  242. <div class="value">{{ goodsList[0] && goodsList[0].useRefCount }}</div>
  243. </el-col>
  244. </el-row>
  245. </div>
  246. <div class="main-title">
  247. <div class="title">货品信息</div>
  248. </div>
  249. <div class="table" style="margin-top: 20px">
  250. <el-table
  251. :data="goodsList"
  252. element-loading-text="Loading"
  253. border
  254. fit
  255. highlight-current-row
  256. stripe
  257. max-height="400"
  258. show-summary
  259. :summary-method="$getSummaries"
  260. >
  261. <el-table-column align="center" label="序号" type="index" width="50" />
  262. <!-- <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column> -->
  263. <el-table-column
  264. align="left"
  265. label="销售类型"
  266. prop="saleTypeName"
  267. min-width="100"
  268. show-overflow-tooltip
  269. />
  270. <el-table-column
  271. align="left"
  272. label="物料编码"
  273. prop="materialNumber"
  274. min-width="120"
  275. show-overflow-tooltip
  276. />
  277. <el-table-column
  278. align="left"
  279. label="产品编码"
  280. prop="materialOldNumber"
  281. min-width="120"
  282. show-overflow-tooltip
  283. />
  284. <el-table-column
  285. align="left"
  286. label="产品名称"
  287. prop="materialName"
  288. min-width="160"
  289. show-overflow-tooltip
  290. />
  291. <el-table-column
  292. align="left"
  293. label="规格型号"
  294. prop="specification"
  295. min-width="350"
  296. show-overflow-tooltip
  297. />
  298. <el-table-column
  299. align="left"
  300. label="实装规格型号"
  301. prop="realSpecification"
  302. min-width="300"
  303. show-overflow-tooltip
  304. >
  305. <template slot-scope="scope">
  306. <div :style="scope.row.realSpecification != scope.row.specification ? { color: 'blue' } : ''">
  307. {{ scope.row.realSpecification }}
  308. </div>
  309. </template>
  310. </el-table-column>
  311. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  312. <template slot-scope="scope">
  313. <!-- {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }} -->
  314. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
  315. </template>
  316. </el-table-column>
  317. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  318. <template slot-scope="scope">
  319. <!-- {{ scope.row.price | numToFixed }} -->
  320. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent />
  321. </template>
  322. </el-table-column>
  323. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  324. <template slot-scope="scope">
  325. {{ scope.row.totalAmount | numToFixed }}
  326. </template>
  327. </el-table-column>
  328. <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="100" show-overflow-tooltip />
  329. <!-- <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="140" show-overflow-tooltip></el-table-column>
  330. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  331. <template slot-scope="scope">
  332. {{ scope.row.payAmount | numToFixed }}
  333. </template>
  334. </el-table-column> -->
  335. <el-table-column align="left" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
  336. <template slot-scope="scope">
  337. <el-select
  338. v-model="scope.row.customerWalletId"
  339. placeholder="选择现金钱包"
  340. size="small"
  341. clearable
  342. @change="changeXjWallet(scope.$index)"
  343. >
  344. <el-option
  345. v-for="item in scope.row.wallets"
  346. :key="item.customerWalletId"
  347. :label="item.customerWalletName"
  348. :value="item.customerWalletId"
  349. />
  350. </el-select>
  351. </template>
  352. </el-table-column>
  353. <!-- <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="140" show-overflow-tooltip></el-table-column>
  354. <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip>
  355. <template slot-scope="scope">
  356. {{ scope.row.rebateAmount | numToFixed }}
  357. </template>
  358. </el-table-column> -->
  359. <el-table-column align="left" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
  360. <template slot-scope="scope">
  361. <el-select
  362. v-model="scope.row.customerWalletId2"
  363. placeholder="选择返利类型"
  364. size="small"
  365. clearable
  366. @change="changeFlWallet(scope.$index)"
  367. >
  368. <el-option
  369. v-for="item in scope.row.rebateWallets"
  370. :key="item.customerWalletId"
  371. :label="item.customerWalletName"
  372. :value="item.customerWalletId"
  373. />
  374. </el-select>
  375. </template>
  376. </el-table-column>
  377. <el-table-column align="right" label="返利金额" prop="compute_flAmount" min-width="100" show-overflow-tooltip>
  378. <template slot-scope="scope">
  379. {{ ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) | numToFixed }}
  380. </template>
  381. </el-table-column>
  382. <el-table-column align="right" label="返利比例" min-width="100" prop="rebateRate" show-overflow-tooltip />
  383. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  384. <template slot-scope="scope">
  385. {{ scope.row.discAmount | numToFixed }}
  386. </template>
  387. </el-table-column>
  388. <el-table-column align="right" label="实付金额" prop="compute_sfAmount" min-width="100" show-overflow-tooltip>
  389. <template slot-scope="scope">
  390. {{
  391. ((scope.row.price * scope.row.qty * 100 -
  392. ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 -
  393. ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) /
  394. 100)
  395. | numToFixed
  396. }}
  397. </template>
  398. </el-table-column>
  399. <el-table-column align="right" label="退订数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
  400. <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
  401. <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
  402. <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  403. <template slot-scope="scope">
  404. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  405. </template>
  406. </el-table-column>
  407. <el-table-column
  408. align="right"
  409. label="直调数量"
  410. prop="directTransferQty"
  411. min-width="100"
  412. show-overflow-tooltip
  413. />
  414. <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  415. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  416. <el-table-column
  417. align="left"
  418. label="实装物料编号"
  419. prop="realMaterialNumber"
  420. min-width="150"
  421. show-overflow-tooltip
  422. >
  423. <template slot-scope="scope">
  424. <div :style="scope.row.realMaterialNumber != scope.row.materialNumber ? { color: 'blue' } : ''">
  425. {{ scope.row.realMaterialNumber }}
  426. </div>
  427. </template>
  428. </el-table-column>
  429. <el-table-column
  430. align="left"
  431. label="实装厂产品编码"
  432. prop="realMaterialOldNumber"
  433. min-width="200"
  434. show-overflow-tooltip
  435. >
  436. <template slot-scope="scope">
  437. <div :style="scope.row.realMaterialOldNumber != scope.row.materialOldNumber ? { color: 'blue' } : ''">
  438. {{ scope.row.realMaterialOldNumber }}
  439. </div>
  440. </template>
  441. </el-table-column>
  442. <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
  443. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  444. </el-table>
  445. </div>
  446. <div class="main-title">
  447. <div class="title">审批信息</div>
  448. </div>
  449. <div class="diy-table-1">
  450. <el-row :gutter="0">
  451. <el-col :span="12" class="item">
  452. <div class="label">审批人</div>
  453. <div class="value">{{ userName }}</div>
  454. </el-col>
  455. <el-col :span="12" class="item">
  456. <div class="label">审批日期</div>
  457. <div class="value">{{ getDate() }}</div>
  458. </el-col>
  459. <el-col :span="24" class="item">
  460. <div class="label">审批说明</div>
  461. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明" /></div>
  462. </el-col>
  463. </el-row>
  464. </div>
  465. <div class="page-footer">
  466. <div class="footer">
  467. <el-button type="primary" :loading="formLoading" @click="clickSubmitForm(1)">审批通过</el-button>
  468. <el-button type="warning" :loading="formLoading" @click="clickSubmitForm(0)">审批驳回</el-button>
  469. <el-popconfirm v-if="!isCustomer" title="确定关闭吗?" style="margin-left: 10px" @confirm="goBack">
  470. <el-button slot="reference">返回列表</el-button>
  471. </el-popconfirm>
  472. </div>
  473. </div>
  474. </div>
  475. </template>
  476. <script>
  477. import { getOrderDetail, examineHome } from '@/api/supply/engin'
  478. import { getTypeList, getSalesmanList, getHomeTypeList } from '@/api/common'
  479. import { mapGetters } from 'vuex'
  480. export default {
  481. name: 'HomeExamine',
  482. componentName: 'HomeExamine',
  483. filters: {
  484. statusFilter(val) {
  485. const statusList = [
  486. { label: '已保存', value: 'SAVE' },
  487. { label: '待审核', value: 'WAIT' },
  488. { label: '审核通过', value: 'OK' },
  489. // { label: '审核驳回', value: 'FAIL' },,
  490. { label: '已关闭', value: 'CLOSE' }
  491. ]
  492. const obj = statusList.find(o => o.value == val)
  493. return obj ? obj.label : ''
  494. }
  495. },
  496. props: ['listItem'],
  497. data() {
  498. return {
  499. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  500. detailData: {},
  501. goodsList: [],
  502. examineForm: {
  503. remark: ''
  504. },
  505. salesTypeList: [],
  506. salesmanList: [],
  507. formLoading: false
  508. }
  509. },
  510. computed: {
  511. ...mapGetters(['isCustomer']),
  512. isDealer() {
  513. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  514. }
  515. },
  516. watch: {
  517. goodsList: {
  518. handler(newValue, oldValue) {
  519. if (newValue && newValue.length) {
  520. newValue.forEach((item, index) => {
  521. this.goodsList[index].compute_sfAmount =
  522. (item.price * item.qty * 100 -
  523. ((item.price * item.qty * (item.rebateRate * 100)) / 100) * 100 -
  524. ((item.qty * (item.discAmount * 100)) / 100) * 100) /
  525. 100
  526. this.goodsList[index].compute_flAmount = (item.price * item.qty * (item.rebateRate * 100)) / 100
  527. })
  528. }
  529. },
  530. immediate: true,
  531. deep: true
  532. }
  533. },
  534. async created() {
  535. await this.getSalesmanList()
  536. this.getSalesTypeList()
  537. this.getDetail()
  538. },
  539. methods: {
  540. getDate() {
  541. var date = new Date()
  542. var seperator1 = '-'
  543. var year = date.getFullYear()
  544. var month = date.getMonth() + 1
  545. var strDate = date.getDate()
  546. if (month >= 1 && month <= 9) {
  547. month = '0' + month
  548. }
  549. if (strDate >= 0 && strDate <= 9) {
  550. strDate = '0' + strDate
  551. }
  552. var currentdate = year + seperator1 + month + seperator1 + strDate
  553. return currentdate
  554. },
  555. // 获取销售类型列表
  556. getSalesTypeList() {
  557. getHomeTypeList().then(res => {
  558. this.salesTypeList = res.data
  559. console.log(res.data)
  560. })
  561. },
  562. async getSalesmanList() {
  563. const res = await getSalesmanList({
  564. pageNum: 1,
  565. pageSize: -1,
  566. isCustomer: 0,
  567. status: true
  568. })
  569. this.salesmanList = res.data.records
  570. },
  571. // 返回列表
  572. goBack() {
  573. this.$emit('backListFormDetail')
  574. },
  575. // 获取详情
  576. getDetail() {
  577. getOrderDetail({ id: this.listItem.parentId }).then(res => {
  578. if (res.data.items) {
  579. res.data.items.forEach(item => {
  580. item.sums1 = [
  581. 'directTransferQty',
  582. 'qty',
  583. 'enginNum',
  584. 'salesQty',
  585. 'retiredQty',
  586. 'refundableQty',
  587. 'tdQty',
  588. 'hasSendQty'
  589. ]
  590. item.sums2 = [
  591. 'totalAmount',
  592. 'payAmount',
  593. 'discAmount',
  594. 'payRebateAmount',
  595. 'compute_sfAmount',
  596. 'compute_flAmount',
  597. 'salesAmount'
  598. ]
  599. })
  600. }
  601. res.data.items.forEach(item => {
  602. item.rebateWallets = item.customerWalletList.filter(item => {
  603. return item.type === 'REBATE'
  604. })
  605. item.wallets = item.customerWalletList.filter(item => {
  606. return item.type === 'COMMONLY'
  607. })
  608. })
  609. // // 不扣押金状态默认false
  610. // res.data.takeDeposit = false
  611. this.detailData = res.data
  612. this.goodsList = res.data.items
  613. this.examineForm.remark = res.data.examineNote
  614. })
  615. },
  616. // 修改返利钱包
  617. changeFlWallet(index) {
  618. if (this.goodsList[index].customerWalletId2) {
  619. const obj = this.goodsList[index].rebateWallets.find(
  620. o => o.customerWalletId == this.goodsList[index].customerWalletId2
  621. )
  622. this.goodsList[index].rebateRate = obj.rebateRate
  623. this.goodsList[index].customerWalletName2 = obj.customerWalletName
  624. } else {
  625. this.goodsList[index].rebateRate = ''
  626. this.goodsList[index].customerWalletName2 = ''
  627. }
  628. },
  629. // 修改现金钱包
  630. changeXjWallet(index) {
  631. if (this.goodsList[index].customerWalletId) {
  632. const obj = this.goodsList[index].wallets.find(
  633. o => o.customerWalletId == this.goodsList[index].customerWalletId
  634. )
  635. this.goodsList[index].customerWalletName = obj.customerWalletName
  636. } else {
  637. this.goodsList[index].customerWalletName = ''
  638. }
  639. },
  640. // 审批
  641. clickSubmitForm(val) {
  642. if (!this.detailData.saleTypeId) {
  643. return this.$errorMsg('请选择销售类型')
  644. }
  645. if (!this.detailData.serviceId) {
  646. return this.$errorMsg('请选择业务员')
  647. }
  648. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  649. confirmButtonText: '确定',
  650. cancelButtonText: '取消',
  651. type: 'warning'
  652. })
  653. .then(() => {
  654. const saleTypeItem = this.salesTypeList.find(o => o.id == this.detailData.saleTypeId)
  655. const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  656. const params = JSON.parse(JSON.stringify(this.detailData))
  657. params.examineNote = this.examineForm.remark
  658. params.examineResult = val
  659. ;(params.refEnginRecordNo = this.detailData.refEnginRecordNo),
  660. (params.saleTypeId = this.detailData.saleTypeId)
  661. params.saleTypeCode = saleTypeItem.saleCode
  662. params.saleTypeName = saleTypeItem.saleName
  663. params.serviceName = saleManItem.nickName
  664. this.formLoading = true
  665. examineHome(params)
  666. .then(res => {
  667. if (!res.data) {
  668. this.$successMsg()
  669. this.goBack()
  670. } else {
  671. this.$confirm('审批成功!是否跳转下一张待审批订单?', '提示', {
  672. confirmButtonText: '跳转',
  673. cancelButtonText: '取消',
  674. type: 'warning'
  675. })
  676. .then(() => {
  677. this.$successMsg('进入下一张待审批订单')
  678. this.detailData = res.data
  679. this.goodsList = res.data.items
  680. this.examineForm.remark = ''
  681. })
  682. .catch(() => {
  683. this.goBack()
  684. })
  685. }
  686. })
  687. .finally(res => {
  688. this.formLoading = false
  689. })
  690. })
  691. .catch(() => {})
  692. }
  693. }
  694. }
  695. </script>
  696. <style scoped lang="scss">
  697. .detail-container {
  698. width: 100%;
  699. height: 100%;
  700. }
  701. .main-title {
  702. display: flex;
  703. justify-content: space-between;
  704. align-items: center;
  705. margin-top: 20px;
  706. height: 60px;
  707. border-bottom: 1px solid #dcdfe6;
  708. margin-bottom: 20px;
  709. .title {
  710. font-size: 16px;
  711. font-weight: 600;
  712. padding-left: 10px;
  713. }
  714. }
  715. </style>