home_examine.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  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 align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  264. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
  265. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
  266. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  267. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
  268. <el-table-column
  269. align="left"
  270. label="实装规格型号"
  271. prop="realSpecification"
  272. min-width="300"
  273. show-overflow-tooltip
  274. >
  275. <template slot-scope="scope">
  276. <div :style="scope.row.realSpecification != scope.row.specification ? { color: 'blue' } : ''">
  277. {{ scope.row.realSpecification }}
  278. </div>
  279. </template>
  280. </el-table-column>
  281. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  282. <template slot-scope="scope">
  283. <!-- {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }} -->
  284. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
  285. </template>
  286. </el-table-column>
  287. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  288. <template slot-scope="scope">
  289. <!-- {{ scope.row.price | numToFixed }} -->
  290. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent />
  291. </template>
  292. </el-table-column>
  293. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  294. <template slot-scope="scope">
  295. {{ scope.row.totalAmount | numToFixed }}
  296. </template>
  297. </el-table-column>
  298. <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="100" show-overflow-tooltip />
  299. <!-- <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="140" show-overflow-tooltip></el-table-column>
  300. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  301. <template slot-scope="scope">
  302. {{ scope.row.payAmount | numToFixed }}
  303. </template>
  304. </el-table-column> -->
  305. <el-table-column align="left" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
  306. <template slot-scope="scope">
  307. <el-select
  308. v-model="scope.row.customerWalletId"
  309. placeholder="选择现金钱包"
  310. size="small"
  311. clearable
  312. @change="changeXjWallet(scope.$index)"
  313. >
  314. <el-option
  315. v-for="item in scope.row.wallets"
  316. :key="item.customerWalletId"
  317. :label="item.customerWalletName"
  318. :value="item.customerWalletId"
  319. />
  320. </el-select>
  321. </template>
  322. </el-table-column>
  323. <!-- <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="140" show-overflow-tooltip></el-table-column>
  324. <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip>
  325. <template slot-scope="scope">
  326. {{ scope.row.rebateAmount | numToFixed }}
  327. </template>
  328. </el-table-column> -->
  329. <el-table-column align="left" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
  330. <template slot-scope="scope">
  331. <el-select
  332. v-model="scope.row.customerWalletId2"
  333. placeholder="选择返利类型"
  334. size="small"
  335. clearable
  336. @change="changeFlWallet(scope.$index)"
  337. >
  338. <el-option
  339. v-for="item in scope.row.rebateWallets"
  340. :key="item.customerWalletId"
  341. :label="item.customerWalletName"
  342. :value="item.customerWalletId"
  343. />
  344. </el-select>
  345. </template>
  346. </el-table-column>
  347. <el-table-column align="right" label="返利金额" prop="compute_flAmount" min-width="100" show-overflow-tooltip>
  348. <template slot-scope="scope">
  349. {{ ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) | numToFixed }}
  350. </template>
  351. </el-table-column>
  352. <el-table-column align="right" label="返利比例" min-width="100" prop="rebateRate" show-overflow-tooltip />
  353. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  354. <template slot-scope="scope">
  355. {{ scope.row.discAmount | numToFixed }}
  356. </template>
  357. </el-table-column>
  358. <el-table-column align="right" label="实付金额" prop="compute_sfAmount" min-width="100" show-overflow-tooltip>
  359. <template slot-scope="scope">
  360. {{
  361. ((scope.row.price * scope.row.qty * 100 -
  362. ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 -
  363. ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) /
  364. 100)
  365. | numToFixed
  366. }}
  367. </template>
  368. </el-table-column>
  369. <el-table-column
  370. align="right"
  371. label="退订数量"
  372. prop="retiredQty"
  373. min-width="100"
  374. show-overflow-tooltip
  375. />
  376. <el-table-column align="right" label="销售数量" prop="salesQty" min-width="100" show-overflow-tooltip />
  377. <el-table-column align="right" label="销售金额" prop="salesAmount" min-width="100" show-overflow-tooltip />
  378. <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  379. <template slot-scope="scope">
  380. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  381. </template>
  382. </el-table-column>
  383. <el-table-column
  384. align="right"
  385. label="直调数量"
  386. prop="directTransferQty"
  387. min-width="100"
  388. show-overflow-tooltip
  389. />
  390. <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  391. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  392. <el-table-column
  393. align="left"
  394. label="实装物料编号"
  395. prop="realMaterialNumber"
  396. min-width="150"
  397. show-overflow-tooltip
  398. >
  399. <template slot-scope="scope">
  400. <div :style="scope.row.realMaterialNumber != scope.row.materialNumber ? { color: 'blue' } : ''">
  401. {{ scope.row.realMaterialNumber }}
  402. </div>
  403. </template>
  404. </el-table-column>
  405. <el-table-column
  406. align="left"
  407. label="实装厂产品编码"
  408. prop="realMaterialOldNumber"
  409. min-width="200"
  410. show-overflow-tooltip
  411. >
  412. <template slot-scope="scope">
  413. <div :style="scope.row.realMaterialOldNumber != scope.row.materialOldNumber ? { color: 'blue' } : ''">
  414. {{ scope.row.realMaterialOldNumber }}
  415. </div>
  416. </template>
  417. </el-table-column>
  418. <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
  419. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  420. </el-table>
  421. </div>
  422. <div class="main-title">
  423. <div class="title">审批信息</div>
  424. </div>
  425. <div class="diy-table-1">
  426. <el-row :gutter="0">
  427. <el-col :span="12" class="item">
  428. <div class="label">审批人</div>
  429. <div class="value">{{ userName }}</div>
  430. </el-col>
  431. <el-col :span="12" class="item">
  432. <div class="label">审批日期</div>
  433. <div class="value">{{ getDate() }}</div>
  434. </el-col>
  435. <el-col :span="24" class="item">
  436. <div class="label">审批说明</div>
  437. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明" /></div>
  438. </el-col>
  439. </el-row>
  440. </div>
  441. <div class="page-footer">
  442. <div class="footer">
  443. <el-button type="primary" :loading="formLoading" @click="clickSubmitForm(1)">审批通过</el-button>
  444. <el-button type="warning" :loading="formLoading" @click="clickSubmitForm(0)">审批驳回</el-button>
  445. <el-popconfirm v-if="!isCustomer" title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
  446. <el-button slot="reference">返回列表</el-button>
  447. </el-popconfirm>
  448. </div>
  449. </div>
  450. </div>
  451. </template>
  452. <script>
  453. import { getOrderDetail, examineHome } from '@/api/supply/engin'
  454. import { getTypeList, getSalesmanList, getHomeTypeList } from '@/api/common'
  455. import { mapGetters } from 'vuex'
  456. export default {
  457. name: 'HomeExamine',
  458. componentName: 'HomeExamine',
  459. filters: {
  460. statusFilter(val) {
  461. const statusList = [
  462. { label: '已保存', value: 'SAVE' },
  463. { label: '待审核', value: 'WAIT' },
  464. { label: '审核通过', value: 'OK' },
  465. // { label: '审核驳回', value: 'FAIL' },,
  466. { label: '已关闭', value: 'CLOSE' }
  467. ]
  468. const obj = statusList.find(o => o.value == val)
  469. return obj ? obj.label : ''
  470. }
  471. },
  472. props: ['listItem'],
  473. data() {
  474. return {
  475. userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
  476. detailData: {},
  477. goodsList: [],
  478. examineForm: {
  479. remark: ''
  480. },
  481. salesTypeList: [],
  482. salesmanList: [],
  483. formLoading: false
  484. }
  485. },
  486. computed: {
  487. ...mapGetters(['isCustomer']),
  488. isDealer() {
  489. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  490. }
  491. },
  492. watch: {
  493. goodsList: {
  494. handler(newValue, oldValue) {
  495. if (newValue && newValue.length) {
  496. newValue.forEach((item, index) => {
  497. this.goodsList[index].compute_sfAmount =
  498. (item.price * item.qty * 100 -
  499. ((item.price * item.qty * (item.rebateRate * 100)) / 100) * 100 -
  500. ((item.qty * (item.discAmount * 100)) / 100) * 100) /
  501. 100
  502. this.goodsList[index].compute_flAmount = (item.price * item.qty * (item.rebateRate * 100)) / 100
  503. })
  504. }
  505. },
  506. immediate: true,
  507. deep: true
  508. }
  509. },
  510. async created() {
  511. await this.getSalesmanList()
  512. this.getSalesTypeList()
  513. this.getDetail()
  514. },
  515. methods: {
  516. getDate() {
  517. var date = new Date()
  518. var seperator1 = '-'
  519. var year = date.getFullYear()
  520. var month = date.getMonth() + 1
  521. var strDate = date.getDate()
  522. if (month >= 1 && month <= 9) {
  523. month = '0' + month
  524. }
  525. if (strDate >= 0 && strDate <= 9) {
  526. strDate = '0' + strDate
  527. }
  528. var currentdate = year + seperator1 + month + seperator1 + strDate
  529. return currentdate
  530. },
  531. // 获取销售类型列表
  532. getSalesTypeList() {
  533. getHomeTypeList().then(res => {
  534. this.salesTypeList = res.data
  535. console.log(res.data)
  536. })
  537. },
  538. async getSalesmanList() {
  539. const res = await getSalesmanList({
  540. pageNum: 1,
  541. pageSize: -1,
  542. isCustomer: 0,
  543. status: true
  544. })
  545. this.salesmanList = res.data.records
  546. },
  547. // 返回列表
  548. goBack() {
  549. this.$emit('backListFormDetail')
  550. },
  551. // 获取详情
  552. getDetail() {
  553. getOrderDetail({ id: this.listItem.parentId }).then(res => {
  554. if (res.data.items) {
  555. res.data.items.forEach(item => {
  556. item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'salesQty', 'retiredQty','refundableQty', 'tdQty', 'hasSendQty']
  557. item.sums2 = [
  558. 'totalAmount',
  559. 'payAmount',
  560. 'discAmount',
  561. 'payRebateAmount',
  562. 'compute_sfAmount',
  563. 'compute_flAmount',
  564. 'salesAmount'
  565. ]
  566. })
  567. }
  568. res.data.items.forEach(item => {
  569. item.rebateWallets = item.customerWalletList.filter(item => {
  570. return item.type === 'REBATE'
  571. })
  572. item.wallets = item.customerWalletList.filter(item => {
  573. return item.type === 'COMMONLY'
  574. })
  575. })
  576. // // 不扣押金状态默认false
  577. // res.data.takeDeposit = false
  578. this.detailData = res.data
  579. this.goodsList = res.data.items
  580. this.examineForm.remark = res.data.examineNote
  581. })
  582. },
  583. // 修改返利钱包
  584. changeFlWallet(index) {
  585. if (this.goodsList[index].customerWalletId2) {
  586. const obj = this.goodsList[index].rebateWallets.find(
  587. o => o.customerWalletId == this.goodsList[index].customerWalletId2
  588. )
  589. this.goodsList[index].rebateRate = obj.rebateRate
  590. this.goodsList[index].customerWalletName2 = obj.customerWalletName
  591. } else {
  592. this.goodsList[index].rebateRate = ''
  593. this.goodsList[index].customerWalletName2 = ''
  594. }
  595. },
  596. // 修改现金钱包
  597. changeXjWallet(index) {
  598. if (this.goodsList[index].customerWalletId) {
  599. const obj = this.goodsList[index].wallets.find(
  600. o => o.customerWalletId == this.goodsList[index].customerWalletId
  601. )
  602. this.goodsList[index].customerWalletName = obj.customerWalletName
  603. } else {
  604. this.goodsList[index].customerWalletName = ''
  605. }
  606. },
  607. // 审批
  608. clickSubmitForm(val) {
  609. if (!this.detailData.saleTypeId) {
  610. return this.$errorMsg('请选择销售类型')
  611. }
  612. if (!this.detailData.serviceId) {
  613. return this.$errorMsg('请选择业务员')
  614. }
  615. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  616. confirmButtonText: '确定',
  617. cancelButtonText: '取消',
  618. type: 'warning'
  619. })
  620. .then(() => {
  621. const saleTypeItem = this.salesTypeList.find(o => o.id == this.detailData.saleTypeId)
  622. const saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId)
  623. const params = JSON.parse(JSON.stringify(this.detailData))
  624. params.examineNote = this.examineForm.remark
  625. params.examineResult = val
  626. ;(params.refEnginRecordNo = this.detailData.refEnginRecordNo),
  627. (params.saleTypeId = this.detailData.saleTypeId)
  628. params.saleTypeCode = saleTypeItem.saleCode
  629. params.saleTypeName = saleTypeItem.saleName
  630. params.serviceName = saleManItem.nickName
  631. this.formLoading = true
  632. examineHome(params)
  633. .then(res => {
  634. if (!res.data) {
  635. this.$successMsg()
  636. this.goBack()
  637. } else {
  638. this.$confirm('审批成功!是否跳转下一张待审批订单?', '提示', {
  639. confirmButtonText: '跳转',
  640. cancelButtonText: '取消',
  641. type: 'warning'
  642. })
  643. .then(() => {
  644. this.$successMsg('进入下一张待审批订单')
  645. this.detailData = res.data
  646. this.goodsList = res.data.items
  647. this.examineForm.remark = ''
  648. })
  649. .catch(() => {
  650. this.goBack()
  651. })
  652. }
  653. })
  654. .finally(res => {
  655. this.formLoading = false
  656. })
  657. })
  658. .catch(() => {})
  659. }
  660. }
  661. }
  662. </script>
  663. <style scoped lang="scss">
  664. .detail-container {
  665. width: 100%;
  666. height: 100%;
  667. }
  668. .main-title {
  669. display: flex;
  670. justify-content: space-between;
  671. align-items: center;
  672. margin-top: 20px;
  673. height: 60px;
  674. border-bottom: 1px solid #dcdfe6;
  675. margin-bottom: 20px;
  676. .title {
  677. font-size: 16px;
  678. font-weight: 600;
  679. padding-left: 10px;
  680. }
  681. }
  682. </style>