home_list.vue 39 KB

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