home_list.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  9. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  10. </template>
  11. <template #left_btn>
  12. <el-checkbox-group
  13. v-model="screenForm.status"
  14. @change="
  15. currentPage = 1
  16. getList()
  17. "
  18. size="mini"
  19. >
  20. <el-checkbox-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{
  21. item.label
  22. }}</el-checkbox-button>
  23. </el-checkbox-group>
  24. </template>
  25. <template #search>
  26. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  27. <el-row :gutter="20">
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="工程订单号" prop="orderNum">
  30. <el-input v-model="screenForm.orderNum" placeholder="请输入工程订单号" />
  31. </el-form-item>
  32. </el-col>
  33. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  34. <!-- <el-form-item label="工程编码" prop="enginNum">-->
  35. <!-- <el-input-->
  36. <!-- v-model="screenForm.enginNum"-->
  37. <!-- placeholder="请输入工程编码"-->
  38. <!-- />-->
  39. <!-- </el-form-item>-->
  40. <!-- </el-col>-->
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="工程登录编号" prop="loginNum">
  43. <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录编号" />
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="行业类别" prop="refTradeCategory">
  48. <el-input v-model="screenForm.refTradeCategory" placeholder="请输入项目名称" />
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="制单日期" prop="date">
  53. <el-date-picker
  54. v-model="screenForm.date"
  55. type="datetimerange"
  56. :default-time="['00:00:00', '23:59:59']"
  57. range-separator="至"
  58. style="width: 100%"
  59. value-format="yyyy-MM-dd HH:mm:ss"
  60. start-placeholder="开始日期"
  61. end-placeholder="结束日期"
  62. />
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="6">
  66. <el-form-item label="销售类型" prop="saleType">
  67. <el-select v-model="screenForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
  68. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id" />
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :xs="24" :sm="12" :lg="6">
  73. <el-form-item label="制单人" prop="createMan">
  74. <el-input v-model="screenForm.createMan" placeholder="请输入制单人" />
  75. </el-form-item>
  76. </el-col>
  77. <el-col :xs="24" :sm="12" :lg="6">
  78. <el-form-item label="审核人" prop="examineMan">
  79. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人" />
  80. </el-form-item>
  81. </el-col>
  82. <el-col :xs="24" :sm="12" :lg="6">
  83. <el-form-item label="表头业务员" prop="salesMan">
  84. <el-select
  85. v-model="screenForm.salesMan"
  86. placeholder="选择表头业务员"
  87. clearable
  88. filterable
  89. style="width: 100%"
  90. >
  91. <el-option
  92. v-for="item in salesmanList"
  93. :key="item.adminUserId"
  94. :label="item.nickName"
  95. :value="item.adminUserId"
  96. />
  97. </el-select>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :xs="24" :sm="12" :lg="6">
  101. <el-form-item label="使用单位" prop="refUseUnit">
  102. <el-input v-model="screenForm.refUseUnit" placeholder="请输入使用单位" />
  103. </el-form-item>
  104. </el-col>
  105. <el-col :xs="24" :sm="12" :lg="6">
  106. <el-form-item label="产品编码" prop="materialOldNumber">
  107. <el-input v-model="screenForm.materialOldNumber" placeholder="请输入产品编码" />
  108. </el-form-item>
  109. </el-col>
  110. <el-col :xs="24" :sm="12" :lg="6">
  111. <el-form-item label="规格型号" prop="specification">
  112. <el-input v-model="screenForm.specification" placeholder="请输入规格型号" />
  113. </el-form-item>
  114. </el-col>
  115. <el-col :xs="24" :sm="12" :lg="6">
  116. <el-form-item label="经销商" prop="customerKeyword">
  117. <el-input v-model="screenForm.customerKeyword" placeholder="请输入经销商" />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :xs="24" :sm="12" :lg="6">
  121. <el-form-item label="区域" prop="refRegionWork">
  122. <el-input v-model="screenForm.refRegionWork" placeholder="请输入区域" />
  123. </el-form-item>
  124. </el-col>
  125. <el-col :xs="24" :sm="12" :lg="6">
  126. <el-form-item label="备注" prop="remark">
  127. <el-input v-model="screenForm.remark" placeholder="备注" />
  128. </el-form-item>
  129. </el-col>
  130. <el-col v-if="!isCustomer" :xs="24" :sm="12" :lg="6">
  131. <el-form-item label="格力内部备注" prop="geLiInerNote">
  132. <el-input v-model="screenForm.geLiInerNote" placeholder="格力内部备注" />
  133. </el-form-item>
  134. </el-col>
  135. <el-col :xs="24" :sm="12" :lg="6">
  136. <el-form-item label="跨区厂编号" prop="refFactoryNo">
  137. <el-input v-model="screenForm.refFactoryNo" placeholder="跨区厂编号" />
  138. </el-form-item>
  139. </el-col>
  140. <el-col :xs="24" :sm="12" :lg="6">
  141. <el-form-item label="购买单位" prop="refBuyUnitName">
  142. <el-input v-model="screenForm.refBuyUnitName" placeholder="购买单位" />
  143. </el-form-item>
  144. </el-col>
  145. <el-col :xs="24" :sm="12" :lg="6">
  146. <el-form-item label="保证函" prop="refPromiseProvide">
  147. <el-select
  148. v-model="screenForm.refPromiseProvide"
  149. placeholder="保证函"
  150. filterable
  151. style="width: 100%"
  152. >
  153. <el-option label="全部" value="" />
  154. <el-option label="未保证" value="未保证" />
  155. <el-option label="已保证" value="已保证" />
  156. </el-select>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :xs="24" :sm="12" :lg="6">
  160. <el-form-item label="是否直调" prop="isDirectTransfer">
  161. <el-select v-model="screenForm.isDirectTransfer" placeholder="选择是否直" style="width: 100%">
  162. <el-option :value="null" label="默认" />
  163. <el-option v-for="item in transfer" :key="item.value" :label="item.label" :value="item.value" />
  164. </el-select>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :xs="24" :sm="12" :lg="6">
  168. <el-form-item label="订单日期" prop="orderTime">
  169. <el-date-picker
  170. v-model="screenForm.orderTime"
  171. type="datetimerange"
  172. :default-time="['00:00:00', '23:59:59']"
  173. range-separator="至"
  174. style="width: 100%"
  175. value-format="yyyy-MM-dd HH:mm:ss"
  176. start-placeholder="开始日期"
  177. end-placeholder="结束日期"
  178. />
  179. </el-form-item>
  180. </el-col>
  181. <el-col :xs="24" :sm="12" :lg="6">
  182. <el-form-item label="钱包" prop="customerWalletId">
  183. <el-select
  184. v-model="screenForm.customerWalletId"
  185. placeholder="选择钱包"
  186. clearable
  187. filterable
  188. style="width: 100%"
  189. >
  190. <el-option v-for="item in NoRebateWalletList" :key="item.id" :label="item.name" :value="item.id">
  191. </el-option>
  192. </el-select>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :xs="24" :sm="12" :lg="6">
  196. <el-form-item label="销售类型" prop="saleTypeId">
  197. <el-select
  198. v-model="screenForm.saleTypeId"
  199. placeholder="选择销售类型"
  200. clearable
  201. filterable
  202. style="width: 100%"
  203. >
  204. <el-option v-for="item in typeList" :key="item.id" :label="item.saleName" :value="item.id">
  205. </el-option>
  206. </el-select>
  207. </el-form-item>
  208. </el-col>
  209. </el-row>
  210. </el-form>
  211. </template>
  212. </Collapse>
  213. </div>
  214. <ul class="ulStyle">
  215. <li class="title">
  216. 金额:<span class="num">{{ (Number(numSum.amountC) || 0) | numToFixed }}</span>
  217. </li>
  218. <li class="title">
  219. 数量:<span class="num">{{ Number(numSum.totalC) || 0 | numToFixed }}</span>
  220. </li>
  221. </ul>
  222. <div class="mymain-container">
  223. <div class="btn-group clearfix">
  224. <div class="fl">
  225. <el-button
  226. v-if="$checkBtnRole('add', $route.meta.roles)"
  227. size="mini"
  228. type="primary"
  229. icon="el-icon-plus"
  230. @click="toForm()"
  231. >新增</el-button
  232. >
  233. <el-button
  234. v-if="$checkBtnRole('del', $route.meta.roles)"
  235. size="mini"
  236. type="danger"
  237. icon="el-icon-minus"
  238. :disabled="multipleSelection.length < 1"
  239. @click="batchDelete()"
  240. >批量删除</el-button
  241. >
  242. </div>
  243. <div class="fr">
  244. <ExportButton :ex-url="'engin-order/export'" :ex-params="exParams" />
  245. </div>
  246. </div>
  247. <div class="table">
  248. <el-table
  249. v-loading="listLoading"
  250. :data="dataList"
  251. element-loading-text="Loading"
  252. border
  253. fit
  254. highlight-current-row
  255. stripe
  256. show-summary
  257. :summary-method="$getSummaries"
  258. @selection-change="handleSelectionChange"
  259. >
  260. <el-table-column align="center" type="selection" width="55" />
  261. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  262. <template slot-scope="scope">
  263. {{ scope.row.examineStatus | statusFilter }}
  264. </template>
  265. </el-table-column>
  266. <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  267. <template slot-scope="scope">
  268. <CopyButton :copy-text="scope.row.enginOrderNo" />
  269. <span>{{ scope.row.enginOrderNo }}</span>
  270. </template>
  271. </el-table-column>
  272. <el-table-column align="left" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip>
  273. <template slot-scope="scope">
  274. <div>
  275. <span>{{ scope.row.orderDate }}</span>
  276. <el-button
  277. v-if="$checkBtnRole('date', $route.meta.roles) && !isCustomer && scope.row.examineStatus !== 'SAVE'"
  278. type="text"
  279. icon="el-icon-edit"
  280. style="padding: 0; margin-left: 4px"
  281. @click="editDate(scope.row)"
  282. />
  283. </div>
  284. </template>
  285. </el-table-column>
  286. <el-table-column align="left" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip />
  287. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  288. <template slot-scope="scope">
  289. <CopyButton :copy-text="scope.row.customerName" />
  290. <span>{{ scope.row.customerName }}</span>
  291. </template>
  292. </el-table-column>
  293. <el-table-column
  294. align="left"
  295. label="工程登录编号"
  296. prop="refEnginRecordNo"
  297. min-width="160"
  298. show-overflow-tooltip
  299. >
  300. <template slot-scope="scope">
  301. <CopyButton :copy-text="scope.row.refEnginRecordNo" />
  302. <span>{{ scope.row.refEnginRecordNo }}</span>
  303. </template>
  304. </el-table-column>
  305. <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip />
  306. <el-table-column
  307. align="left"
  308. label="购买单位"
  309. prop="refBuyUnitName"
  310. min-width="160"
  311. show-overflow-tooltip
  312. />
  313. <el-table-column
  314. align="left"
  315. label="产品编号"
  316. prop="materialOldNumber"
  317. min-width="140"
  318. show-overflow-tooltip
  319. >
  320. <template slot-scope="scope">
  321. <CopyButton :copy-text="scope.row.materialOldNumber" />
  322. <span>{{ scope.row.materialOldNumber }}</span>
  323. </template>
  324. </el-table-column>
  325. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  326. <template slot-scope="scope">
  327. <CopyButton :copy-text="scope.row.materialName" />
  328. <span>{{ scope.row.materialName }}</span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  332. <template slot-scope="scope">
  333. <CopyButton :copy-text="scope.row.specification" />
  334. <span>{{ scope.row.specification }}</span>
  335. </template>
  336. </el-table-column>
  337. <el-table-column align="right" label="总数量" prop="qty" min-width="100" sortable show-overflow-tooltip />
  338. <el-table-column align="right" label="单价" prop="price" min-width="100" sortable show-overflow-tooltip>
  339. <template slot-scope="scope">
  340. {{ scope.row.price | numToFixed }}
  341. </template>
  342. </el-table-column>
  343. <el-table-column
  344. align="right"
  345. label="订单金额"
  346. prop="totalAmount"
  347. min-width="110"
  348. sortable
  349. show-overflow-tooltip
  350. >
  351. <template slot-scope="scope">
  352. {{ scope.row.totalAmount | numToFixed }}
  353. </template>
  354. </el-table-column>
  355. <el-table-column
  356. align="right"
  357. label="发货数量"
  358. prop="retiredQty"
  359. min-width="110"
  360. sortable
  361. show-overflow-tooltip
  362. >
  363. <template slot-scope="scope">
  364. {{ scope.row.applySendQty }}
  365. </template> </el-table-column
  366. ><el-table-column
  367. align="right"
  368. label="退货数量"
  369. prop="refundProductQty"
  370. min-width="110"
  371. sortable
  372. show-overflow-tooltip
  373. >
  374. <template slot-scope="scope">
  375. {{ scope.row.refundProductQty }}
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. align="left"
  380. label="是否直调"
  381. prop="isDirectTransfer"
  382. min-width="100"
  383. show-overflow-tooltip
  384. >
  385. <template slot-scope="scope">
  386. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  387. </template>
  388. </el-table-column>
  389. <el-table-column
  390. align="right"
  391. label="出库数量"
  392. prop="hasSendQty"
  393. min-width="110"
  394. sortable
  395. show-overflow-tooltip
  396. />
  397. <el-table-column
  398. align="left"
  399. label="项目类型"
  400. prop="refProjectCategory"
  401. min-width="160"
  402. show-overflow-tooltip
  403. />
  404. <el-table-column
  405. align="left"
  406. label="行业类别"
  407. prop="refTradeCategory"
  408. min-width="160"
  409. show-overflow-tooltip
  410. />
  411. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  412. <el-table-column
  413. v-if="!isCustomer"
  414. align="left"
  415. label="格力内部备注"
  416. prop="geLiInerNote"
  417. min-width="160"
  418. show-overflow-tooltip
  419. />
  420. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip />
  421. <el-table-column align="left" label="制单人" prop="createName" min-width="100" show-overflow-tooltip />
  422. <el-table-column
  423. align="left"
  424. label="保证函"
  425. prop="refPromiseProvide"
  426. min-width="100"
  427. show-overflow-tooltip
  428. />
  429. <el-table-column
  430. align="left"
  431. label="跨区厂编号"
  432. prop="refFactoryNo"
  433. min-width="160"
  434. show-overflow-tooltip
  435. />
  436. <el-table-column align="left" label="区域" prop="refRegionWork" min-width="160" show-overflow-tooltip />
  437. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip />
  438. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  439. <template slot-scope="scope">
  440. <CopyButton :copy-text="scope.row.materialNumber" />
  441. <span>{{ scope.row.materialNumber }}</span>
  442. </template>
  443. </el-table-column>
  444. <el-table-column
  445. align="right"
  446. label="实付金额"
  447. prop="payAmount"
  448. min-width="110"
  449. sortable
  450. show-overflow-tooltip
  451. >
  452. <template slot-scope="scope">
  453. {{ scope.row.payAmount | numToFixed }}
  454. </template>
  455. </el-table-column>
  456. <el-table-column
  457. align="left"
  458. label="经销商编码"
  459. prop="customerNumber"
  460. min-width="100"
  461. show-overflow-tooltip
  462. >
  463. <template slot-scope="scope">
  464. <CopyButton :copy-text="scope.row.customerNumber" />
  465. <span>{{ scope.row.customerNumber }}</span>
  466. </template>
  467. </el-table-column>
  468. <el-table-column
  469. align="right"
  470. label="直调数量"
  471. prop="directTransferQty"
  472. min-width="110"
  473. sortable
  474. show-overflow-tooltip
  475. />
  476. <el-table-column
  477. align="left"
  478. label="返利钱包"
  479. prop="customerWalletName2"
  480. min-width="100"
  481. show-overflow-tooltip
  482. />
  483. <el-table-column
  484. align="right"
  485. label="使用返利金额"
  486. prop="rebateAmount"
  487. min-width="120"
  488. show-overflow-tooltip
  489. >
  490. <template slot-scope="scope">
  491. <div v-if="scope.row.examineStatus === 'OK'">
  492. {{ scope.row.payRebateAmount | numToFixed }}
  493. </div>
  494. <div v-else>{{ scope.row.rebateAmount | numToFixed }}</div>
  495. </template>
  496. </el-table-column>
  497. <el-table-column
  498. align="right"
  499. label="格力折扣"
  500. prop="discAmount"
  501. min-width="110"
  502. sortable
  503. show-overflow-tooltip
  504. >
  505. <template slot-scope="scope">
  506. {{ scope.row.discAmount | numToFixed }}
  507. </template>
  508. </el-table-column>
  509. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  510. <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  511. <el-table-column
  512. align="left"
  513. label="表体业务员"
  514. prop="itemServiceName"
  515. min-width="100"
  516. show-overflow-tooltip
  517. />
  518. <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip />
  519. <el-table-column align="left" label="订单类型" prop="enginOrderType" min-width="100" show-overflow-tooltip>
  520. <template slot-scope="scope">
  521. {{ scope.row.enginOrderType | typeFilter }}
  522. </template>
  523. </el-table-column>
  524. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  525. <el-table-column align="center" label="操作" width="220" fixed="right">
  526. <template slot-scope="scope">
  527. <el-popconfirm
  528. v-if="scope.row.examineStatus === 'SAVE'"
  529. style="margin-right: 10px"
  530. title="确定申请吗?"
  531. @onConfirm="handleSubmit(scope.row.parentId, scope.row)"
  532. >
  533. <el-button slot="reference" type="text">申请</el-button>
  534. </el-popconfirm>
  535. <el-popconfirm
  536. v-if="scope.row.examineStatus === 'WAIT'"
  537. style="margin-right: 10px"
  538. title="确定撤回吗?"
  539. @onConfirm="handleWithdraw(scope.row.parentId, scope.row)"
  540. >
  541. <el-button slot="reference" type="text">撤回</el-button>
  542. </el-popconfirm>
  543. <el-popconfirm
  544. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
  545. style="margin-right: 10px"
  546. title="确定弃审吗?"
  547. @onConfirm="handleAbandon(scope.row.parentId, scope.row)"
  548. >
  549. <el-button slot="reference" type="text">弃审</el-button>
  550. </el-popconfirm>
  551. <el-button
  552. v-if="
  553. $checkBtnRole('edit', $route.meta.roles) &&
  554. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')
  555. "
  556. type="text"
  557. @click="toForm(scope.row)"
  558. >
  559. 编辑
  560. </el-button>
  561. <el-button
  562. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  563. type="text"
  564. @click="toExamine(scope.row)"
  565. >
  566. 审批
  567. </el-button>
  568. <el-button
  569. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'"
  570. type="text"
  571. @click="toReturn(scope.row)"
  572. >
  573. 退订
  574. </el-button>
  575. <el-button type="text" @click="toDetail(scope.row)"> 详情 </el-button>
  576. <el-popconfirm
  577. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'"
  578. style="margin-left: 10px"
  579. title="确定删除吗?"
  580. @onConfirm="handleDelete(scope.row.parentId, scope.row)"
  581. >
  582. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  583. </el-popconfirm>
  584. </template>
  585. </el-table-column>
  586. </el-table>
  587. </div>
  588. </div>
  589. <div class="pagination clearfix">
  590. <div class="fr">
  591. <el-pagination
  592. :current-page="currentPage"
  593. :page-sizes="[10, 20, 30, 50, 500]"
  594. :page-size="10"
  595. layout="total, sizes, prev, pager, next, jumper"
  596. :total="listTotal"
  597. @size-change="handleSizeChange"
  598. @current-change="handleCurrentChange"
  599. />
  600. </div>
  601. </div>
  602. </div>
  603. <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
  604. <HomeDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
  605. <HomeForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
  606. <HomeExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
  607. <HomeReturn v-if="isShowReturn" :list-item="queryItem" @backListFormDetail="backList" />
  608. </div>
  609. </template>
  610. <script>
  611. import {
  612. getOrderList,
  613. applyHome,
  614. withdrawHome,
  615. deleteHome,
  616. editDateHome,
  617. abandonHome,
  618. getEnginCountList
  619. } from '@/api/supply/engin'
  620. import { getSalesmanList, getTypeList } from '@/api/common'
  621. import HomeDetail from '@/views/supply/engin/components/home_detail'
  622. import HomeForm from '@/views/supply/engin/components/home_form'
  623. import HomeExamine from '@/views/supply/engin/components/home_examine'
  624. import HomeReturn from '@/views/supply/engin/components/home_return'
  625. import EditDateDialog from '@/components/Common/edit-date-dialog'
  626. import { getNoRebateWalletList } from '@/api/policy_list'
  627. let that
  628. export default {
  629. components: {
  630. HomeDetail,
  631. HomeForm,
  632. HomeExamine,
  633. HomeReturn,
  634. EditDateDialog
  635. },
  636. filters: {
  637. statusFilter(val) {
  638. const obj = that.statusList.find(o => o.value === val)
  639. return obj ? obj.label : ''
  640. },
  641. typeFilter(val) {
  642. const MAP = {
  643. TRADE: '商用',
  644. HOME: '家用'
  645. }
  646. return MAP[val]
  647. }
  648. },
  649. data() {
  650. return {
  651. currentPage: 1, // 当前页码
  652. pageSize: 10, // 每页数量
  653. listTotal: 0, // 列表总数
  654. dataList: null, // 列表数据
  655. listLoading: false, // 列表加载loading
  656. screenForm: {
  657. // 筛选表单数据
  658. status: [],
  659. orderNum: '',
  660. enginNum: '',
  661. loginNum: '',
  662. refTradeCategory: '',
  663. date: [],
  664. saleType: '',
  665. createMan: '',
  666. examineMan: '',
  667. salesMan: '',
  668. refUseUnit: '',
  669. materialOldNumber: '',
  670. specification: '',
  671. customerKeyword: '',
  672. refRegionWork: '',
  673. remark: '',
  674. geLiInerNote: '',
  675. refFactoryNo: '',
  676. refBuyUnitName: '',
  677. refPromiseProvide: '',
  678. isDirectTransfer: null,
  679. orderTime: [],
  680. saleTypeId: '',
  681. customerWalletId: ''
  682. },
  683. statusList: [
  684. { label: '已保存', value: 'SAVE' },
  685. { label: '待审核', value: 'WAIT' },
  686. { label: '审核通过', value: 'OK' }
  687. // // { label: '审核驳回', value: 'FAIL' },,
  688. // { label: '已关闭', value: 'CLOSE' },
  689. ],
  690. salesmanList: [],
  691. transfer: [
  692. { label: '是', value: true },
  693. { label: '否', value: false }
  694. ],
  695. multipleSelection: [],
  696. queryItem: {},
  697. isShowDetail: false,
  698. isShowForm: false,
  699. isShowExamine: false,
  700. isShowReturn: false,
  701. editId: null,
  702. isShowEditDateDialog: false,
  703. dateForm: {
  704. date: ''
  705. },
  706. isCollapse: true,
  707. salesTypeList: [],
  708. NoRebateWalletList: [],
  709. typeList: [],
  710. numSum: {
  711. totalC: 0,
  712. amountC: 0
  713. }
  714. }
  715. },
  716. computed: {
  717. exParams() {
  718. const ids = this.multipleSelection.map(item => {
  719. return item.enginOrderNo
  720. })
  721. return {
  722. examineStatus: this.screenForm.status.join(','),
  723. enginOrderNo: ids && ids.length ? ids.join(',') : this.screenForm.orderNum,
  724. refProjectNo: this.screenForm.enginNum,
  725. refEnginRecordNo: this.screenForm.loginNum,
  726. refTradeCategory: this.screenForm.refTradeCategory,
  727. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  728. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  729. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  730. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  731. saleTypeId: this.screenForm.saleType,
  732. createName: this.screenForm.createMan,
  733. confirmName: this.screenForm.examineMan,
  734. serviceId: this.screenForm.salesMan,
  735. refUseUnit: this.screenForm.refUseUnit,
  736. materialOldNumber: this.screenForm.materialOldNumber,
  737. specification: this.screenForm.specification,
  738. customerKeyword: this.screenForm.customerKeyword,
  739. refRegionWork: this.screenForm.refRegionWork,
  740. remark: this.screenForm.remark,
  741. geLiInerNote: this.screenForm.geLiInerNote,
  742. refFactoryNo: this.screenForm.refFactoryNo,
  743. refBuyUnitName: this.screenForm.refBuyUnitName,
  744. refPromiseProvide: this.screenForm.refPromiseProvide,
  745. isDirectTransfer: this.screenForm.isDirectTransfer,
  746. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  747. }
  748. },
  749. isCustomer() {
  750. return this.$store.getters.customerId && this.$store.getters.customerNumber
  751. }
  752. },
  753. beforeCreate() {
  754. that = this
  755. },
  756. created() {
  757. this.getSalesTypeList()
  758. this.getSalesmanList()
  759. this.getList()
  760. },
  761. methods: {
  762. // 获取业务员列表
  763. getSalesmanList() {
  764. getSalesmanList({
  765. pageNum: 1,
  766. pageSize: -1,
  767. isCustomer: 0,
  768. status: true
  769. }).then(res => {
  770. this.salesmanList = res.data.records
  771. })
  772. getNoRebateWalletList({
  773. walletName: ''
  774. }).then(res => {
  775. console.log(res)
  776. this.NoRebateWalletList = res.data
  777. console.log(this.NoRebateWalletList)
  778. })
  779. getTypeList({ pageNum: 1, pageSize: -1 }).then(res => {
  780. this.typeList = res.data.records
  781. console.log(this.typeList)
  782. })
  783. },
  784. // 获取销售类型列表
  785. getSalesTypeList() {
  786. getTypeList({
  787. pageNum: 1,
  788. pageSize: -1
  789. }).then(res => {
  790. this.salesTypeList = res.data.records
  791. })
  792. },
  793. // 查询列表
  794. getList() {
  795. this.listLoading = true
  796. const params = {
  797. pageNum: this.currentPage,
  798. pageSize: this.pageSize,
  799. examineStatus: this.screenForm.status.join(','),
  800. enginOrderNo: this.screenForm.orderNum,
  801. refProjectNo: this.screenForm.enginNum,
  802. refEnginRecordNo: this.screenForm.loginNum,
  803. refTradeCategory: this.screenForm.refTradeCategory,
  804. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  805. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  806. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  807. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  808. createName: this.screenForm.createMan,
  809. confirmName: this.screenForm.examineMan,
  810. serviceId: this.screenForm.salesMan,
  811. refUseUnit: this.screenForm.refUseUnit,
  812. materialOldNumber: this.screenForm.materialOldNumber,
  813. specification: this.screenForm.specification,
  814. customerKeyword: this.screenForm.customerKeyword,
  815. refRegionWork: this.screenForm.refRegionWork,
  816. remark: this.screenForm.remark,
  817. geLiInerNote: this.screenForm.geLiInerNote,
  818. saleTypeId: this.screenForm.saleTypeId,
  819. customerWalletId: this.screenForm.customerWalletId,
  820. refFactoryNo: this.screenForm.refFactoryNo,
  821. refBuyUnitName: this.screenForm.refBuyUnitName,
  822. isDirectTransfer: this.screenForm.isDirectTransfer,
  823. refPromiseProvide: this.screenForm.refPromiseProvide,
  824. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  825. }
  826. getOrderList(params).then(res => {
  827. res.data.records.forEach(item => {
  828. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty']
  829. item.sums2 = ['price', 'totalAmount', 'payAmount', 'discAmount']
  830. })
  831. this.dataList = res.data.records
  832. this.listTotal = res.data.total
  833. this.listLoading = false
  834. })
  835. getEnginCountList({
  836. examineStatus: this.screenForm.status.join(','),
  837. enginOrderNo: this.screenForm.orderNum,
  838. refProjectNo: this.screenForm.enginNum,
  839. refEnginRecordNo: this.screenForm.loginNum,
  840. refTradeCategory: this.screenForm.refTradeCategory,
  841. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  842. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  843. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  844. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  845. createName: this.screenForm.createMan,
  846. confirmName: this.screenForm.examineMan,
  847. serviceId: this.screenForm.salesMan,
  848. refUseUnit: this.screenForm.refUseUnit,
  849. materialOldNumber: this.screenForm.materialOldNumber,
  850. specification: this.screenForm.specification,
  851. customerKeyword: this.screenForm.customerKeyword,
  852. refRegionWork: this.screenForm.refRegionWork,
  853. remark: this.screenForm.remark,
  854. geLiInerNote: this.screenForm.geLiInerNote,
  855. saleTypeId: this.screenForm.saleTypeId,
  856. customerWalletId: this.screenForm.customerWalletId,
  857. refFactoryNo: this.screenForm.refFactoryNo,
  858. refBuyUnitName: this.screenForm.refBuyUnitName,
  859. isDirectTransfer: this.screenForm.isDirectTransfer,
  860. refPromiseProvide: this.screenForm.refPromiseProvide,
  861. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  862. }).then(res => {
  863. if (res.data) {
  864. this.numSum = res.data
  865. }
  866. })
  867. },
  868. // 提交筛选表单
  869. submitScreenForm() {
  870. this.currentPage = 1
  871. this.getList()
  872. },
  873. // 重置筛选表单
  874. resetScreenForm() {
  875. this.$refs.screenForm.resetFields()
  876. this.currentPage = 1
  877. this.getList()
  878. },
  879. // 更改每页数量
  880. handleSizeChange(val) {
  881. this.pageSize = val
  882. this.currentPage = 1
  883. this.getList()
  884. },
  885. // 更改当前页
  886. handleCurrentChange(val) {
  887. this.currentPage = val
  888. this.getList()
  889. },
  890. // 进入表单
  891. toForm(item) {
  892. this.queryItem = item
  893. this.isShowForm = true
  894. },
  895. // 进入审批
  896. toExamine(item) {
  897. this.queryItem = item
  898. this.isShowExamine = true
  899. },
  900. // 进入详情
  901. toDetail(item) {
  902. this.queryItem = item
  903. this.isShowDetail = true
  904. },
  905. // 进入退订
  906. toReturn(item) {
  907. if (item.refundableQty <= 0) {
  908. return this.$errorMsg('可退数量为0')
  909. }
  910. this.queryItem = item
  911. this.isShowReturn = true
  912. },
  913. backList() {
  914. this.queryItem = {}
  915. this.isShowDetail = false
  916. this.isShowForm = false
  917. this.isShowExamine = false
  918. this.isShowReturn = false
  919. },
  920. // 申请
  921. handleSubmit(id, row) {
  922. this.$confirm('发货时将暂扣工程押金,请确保钱包余额充足', '温馨提示').then(() => {
  923. applyHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  924. this.$successMsg()
  925. this.getList()
  926. })
  927. })
  928. },
  929. // 撤回
  930. handleWithdraw(id, row) {
  931. withdrawHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  932. this.$successMsg()
  933. this.getList()
  934. })
  935. },
  936. // 弃审
  937. handleAbandon(id, row) {
  938. abandonHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  939. this.$successMsg()
  940. this.getList()
  941. })
  942. },
  943. // 删除
  944. handleDelete(id, row) {
  945. deleteHome({ ids: id }).then(res => {
  946. this.$successMsg()
  947. this.getList()
  948. })
  949. },
  950. // 批量删除
  951. batchDelete() {
  952. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  953. confirmButtonText: '确定',
  954. cancelButtonText: '取消',
  955. type: 'warning'
  956. })
  957. .then(() => {
  958. const ids = this.multipleSelection.map(item => {
  959. return item.parentId
  960. })
  961. deleteHome({ ids: ids.join(',') }).then(res => {
  962. this.$successMsg()
  963. this.getList()
  964. })
  965. })
  966. .catch(() => {})
  967. },
  968. handleSelectionChange(val) {
  969. this.multipleSelection = val
  970. },
  971. // 打开 修改订单日期
  972. editDate(item) {
  973. this.editId = item.parentId
  974. this.dateForm.date = item.orderDate.slice(0, 10)
  975. this.isShowEditDateDialog = true
  976. },
  977. // 提交 修改订单日期
  978. submitDateForm() {
  979. editDateHome({
  980. enginOrderId: this.editId,
  981. orderDate: this.dateForm.date + ' 00:00:00',
  982. refEnginRecordNo: this.screenForm.loginNum
  983. }).then(res => {
  984. this.isShowEditDateDialog = false
  985. this.getList()
  986. this.$successMsg('修改成功')
  987. })
  988. }
  989. }
  990. }
  991. </script>
  992. <style lang="scss" scoped>
  993. .ulStyle {
  994. list-style: none;
  995. margin: 0;
  996. padding: 10px 0;
  997. background-color: #ffffff;
  998. z-index: 1;
  999. }
  1000. .title {
  1001. display: inline-block;
  1002. font-weight: 700;
  1003. margin-right: 20px;
  1004. }
  1005. .num {
  1006. padding-left: 6px;
  1007. font-weight: 400;
  1008. }
  1009. </style>