home_list.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024
  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="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="createTime" min-width="160" show-overflow-tooltip />
  276. <el-table-column align="left" label="制单人" prop="createName" min-width="100" show-overflow-tooltip />
  277. <el-table-column
  278. align="left"
  279. label="工程登录编号"
  280. prop="refEnginRecordNo"
  281. min-width="160"
  282. show-overflow-tooltip
  283. >
  284. <template slot-scope="scope">
  285. <CopyButton :copy-text="scope.row.refEnginRecordNo" />
  286. <span>{{ scope.row.refEnginRecordNo }}</span>
  287. </template>
  288. </el-table-column>
  289. <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip />
  290. <el-table-column
  291. align="left"
  292. label="购买单位"
  293. prop="refBuyUnitName"
  294. min-width="160"
  295. show-overflow-tooltip
  296. />
  297. <el-table-column
  298. align="left"
  299. label="保证函"
  300. prop="refPromiseProvide"
  301. min-width="100"
  302. show-overflow-tooltip
  303. />
  304. <el-table-column
  305. align="left"
  306. label="跨区厂编号"
  307. prop="refFactoryNo"
  308. min-width="160"
  309. show-overflow-tooltip
  310. />
  311. <el-table-column align="left" label="区域" prop="refRegionWork" min-width="160" show-overflow-tooltip />
  312. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip />
  313. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  314. <template slot-scope="scope">
  315. <CopyButton :copy-text="scope.row.materialNumber" />
  316. <span>{{ scope.row.materialNumber }}</span>
  317. </template>
  318. </el-table-column>
  319. <el-table-column
  320. align="left"
  321. label="产品编码"
  322. prop="materialOldNumber"
  323. min-width="140"
  324. show-overflow-tooltip
  325. >
  326. <template slot-scope="scope">
  327. <CopyButton :copy-text="scope.row.materialOldNumber" />
  328. <span>{{ scope.row.materialOldNumber }}</span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  332. <template slot-scope="scope">
  333. <CopyButton :copy-text="scope.row.materialName" />
  334. <span>{{ scope.row.materialName }}</span>
  335. </template>
  336. </el-table-column>
  337. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  338. <template slot-scope="scope">
  339. <CopyButton :copy-text="scope.row.specification" />
  340. <span>{{ scope.row.specification }}</span>
  341. </template>
  342. </el-table-column>
  343. <el-table-column align="right" label="总数量" prop="qty" min-width="100" sortable show-overflow-tooltip />
  344. <el-table-column align="right" label="单价" prop="price" min-width="100" sortable show-overflow-tooltip>
  345. <template slot-scope="scope">
  346. {{ scope.row.price | numToFixed }}
  347. </template>
  348. </el-table-column>
  349. <el-table-column
  350. align="right"
  351. label="订单金额"
  352. prop="totalAmount"
  353. min-width="110"
  354. sortable
  355. show-overflow-tooltip
  356. >
  357. <template slot-scope="scope">
  358. {{ scope.row.totalAmount | numToFixed }}
  359. </template>
  360. </el-table-column>
  361. <el-table-column
  362. align="right"
  363. label="实付金额"
  364. prop="payAmount"
  365. min-width="110"
  366. sortable
  367. show-overflow-tooltip
  368. >
  369. <template slot-scope="scope">
  370. {{ scope.row.payAmount | numToFixed }}
  371. </template>
  372. </el-table-column>
  373. <el-table-column
  374. align="left"
  375. label="经销商编码"
  376. prop="customerNumber"
  377. min-width="100"
  378. show-overflow-tooltip
  379. >
  380. <template slot-scope="scope">
  381. <CopyButton :copy-text="scope.row.customerNumber" />
  382. <span>{{ scope.row.customerNumber }}</span>
  383. </template>
  384. </el-table-column>
  385. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  386. <template slot-scope="scope">
  387. <CopyButton :copy-text="scope.row.customerName" />
  388. <span>{{ scope.row.customerName }}</span>
  389. </template>
  390. </el-table-column>
  391. <el-table-column
  392. align="right"
  393. label="发货数量"
  394. prop="retiredQty"
  395. min-width="110"
  396. sortable
  397. show-overflow-tooltip
  398. >
  399. <template slot-scope="scope">
  400. {{ scope.row.applySendQty }}
  401. </template> </el-table-column
  402. ><el-table-column
  403. align="right"
  404. label="退货数量"
  405. prop="refundProductQty"
  406. min-width="110"
  407. sortable
  408. show-overflow-tooltip
  409. >
  410. <template slot-scope="scope">
  411. {{ scope.row.refundProductQty }}
  412. </template>
  413. </el-table-column>
  414. <el-table-column
  415. align="left"
  416. label="是否直调"
  417. prop="isDirectTransfer"
  418. min-width="100"
  419. show-overflow-tooltip
  420. >
  421. <template slot-scope="scope">
  422. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  423. </template>
  424. </el-table-column>
  425. <el-table-column
  426. align="right"
  427. label="直调数量"
  428. prop="directTransferQty"
  429. min-width="110"
  430. sortable
  431. show-overflow-tooltip
  432. />
  433. <el-table-column
  434. align="right"
  435. label="出库数量"
  436. prop="hasSendQty"
  437. min-width="110"
  438. sortable
  439. show-overflow-tooltip
  440. />
  441. <el-table-column
  442. align="left"
  443. label="行业类别"
  444. prop="refTradeCategory"
  445. min-width="160"
  446. show-overflow-tooltip
  447. />
  448. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  449. <el-table-column
  450. v-if="!isCustomer"
  451. align="left"
  452. label="格力内部备注"
  453. prop="geLiInerNote"
  454. min-width="160"
  455. show-overflow-tooltip
  456. />
  457. <el-table-column
  458. align="left"
  459. label="返利钱包"
  460. prop="customerWalletName2"
  461. min-width="100"
  462. show-overflow-tooltip
  463. />
  464. <el-table-column
  465. align="right"
  466. label="使用返利金额"
  467. prop="rebateAmount"
  468. min-width="120"
  469. show-overflow-tooltip
  470. >
  471. <template slot-scope="scope">
  472. <div v-if="scope.row.examineStatus === 'OK'">
  473. {{ scope.row.payRebateAmount | numToFixed }}
  474. </div>
  475. <div v-else>{{ scope.row.rebateAmount | numToFixed }}</div>
  476. </template>
  477. </el-table-column>
  478. <el-table-column
  479. align="right"
  480. label="格力折扣"
  481. prop="discAmount"
  482. min-width="110"
  483. sortable
  484. show-overflow-tooltip
  485. >
  486. <template slot-scope="scope">
  487. {{ scope.row.discAmount | numToFixed }}
  488. </template>
  489. </el-table-column>
  490. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
  491. <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  492. <el-table-column
  493. align="left"
  494. label="表体业务员"
  495. prop="itemServiceName"
  496. min-width="100"
  497. show-overflow-tooltip
  498. />
  499. <el-table-column align="left" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip />
  500. <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip />
  501. <el-table-column align="left" label="订单类型" prop="enginOrderType" min-width="100" show-overflow-tooltip>
  502. <template slot-scope="scope">
  503. {{ scope.row.enginOrderType | typeFilter }}
  504. </template>
  505. </el-table-column>
  506. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  507. <el-table-column align="center" label="操作" width="220" fixed="right">
  508. <template slot-scope="scope">
  509. <el-popconfirm
  510. v-if="scope.row.examineStatus === 'SAVE'"
  511. style="margin-right: 10px"
  512. title="确定申请吗?"
  513. @onConfirm="handleSubmit(scope.row.parentId, scope.row)"
  514. >
  515. <el-button slot="reference" type="text">申请</el-button>
  516. </el-popconfirm>
  517. <el-popconfirm
  518. v-if="scope.row.examineStatus === 'WAIT'"
  519. style="margin-right: 10px"
  520. title="确定撤回吗?"
  521. @onConfirm="handleWithdraw(scope.row.parentId, scope.row)"
  522. >
  523. <el-button slot="reference" type="text">撤回</el-button>
  524. </el-popconfirm>
  525. <el-popconfirm
  526. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
  527. style="margin-right: 10px"
  528. title="确定弃审吗?"
  529. @onConfirm="handleAbandon(scope.row.parentId, scope.row)"
  530. >
  531. <el-button slot="reference" type="text">弃审</el-button>
  532. </el-popconfirm>
  533. <el-button
  534. v-if="
  535. $checkBtnRole('edit', $route.meta.roles) &&
  536. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')
  537. "
  538. type="text"
  539. @click="toForm(scope.row)"
  540. >
  541. 编辑
  542. </el-button>
  543. <el-button
  544. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  545. type="text"
  546. @click="toExamine(scope.row)"
  547. >
  548. 审批
  549. </el-button>
  550. <el-button
  551. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'"
  552. type="text"
  553. @click="toReturn(scope.row)"
  554. >
  555. 退订
  556. </el-button>
  557. <el-button type="text" @click="toDetail(scope.row)"> 详情 </el-button>
  558. <el-popconfirm
  559. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'"
  560. style="margin-left: 10px"
  561. title="确定删除吗?"
  562. @onConfirm="handleDelete(scope.row.parentId, scope.row)"
  563. >
  564. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  565. </el-popconfirm>
  566. </template>
  567. </el-table-column>
  568. </el-table>
  569. </div>
  570. </div>
  571. <div class="pagination clearfix">
  572. <div class="fr">
  573. <el-pagination
  574. :current-page="currentPage"
  575. :page-sizes="[10, 20, 30, 50, 500]"
  576. :page-size="10"
  577. layout="total, sizes, prev, pager, next, jumper"
  578. :total="listTotal"
  579. @size-change="handleSizeChange"
  580. @current-change="handleCurrentChange"
  581. />
  582. </div>
  583. </div>
  584. </div>
  585. <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
  586. <HomeDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
  587. <HomeForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
  588. <HomeExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
  589. <HomeReturn v-if="isShowReturn" :list-item="queryItem" @backListFormDetail="backList" />
  590. </div>
  591. </template>
  592. <script>
  593. import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome, abandonHome,getEnginCountList } from '@/api/supply/engin'
  594. import { getSalesmanList, getTypeList } from '@/api/common'
  595. import HomeDetail from '@/views/supply/engin/components/home_detail'
  596. import HomeForm from '@/views/supply/engin/components/home_form'
  597. import HomeExamine from '@/views/supply/engin/components/home_examine'
  598. import HomeReturn from '@/views/supply/engin/components/home_return'
  599. import EditDateDialog from '@/components/Common/edit-date-dialog'
  600. import { getNoRebateWalletList } from '@/api/policy_list'
  601. let that
  602. export default {
  603. components: {
  604. HomeDetail,
  605. HomeForm,
  606. HomeExamine,
  607. HomeReturn,
  608. EditDateDialog
  609. },
  610. filters: {
  611. statusFilter(val) {
  612. const obj = that.statusList.find(o => o.value === val)
  613. return obj ? obj.label : ''
  614. },
  615. typeFilter(val) {
  616. const MAP = {
  617. TRADE: '商用',
  618. HOME: '家用'
  619. }
  620. return MAP[val]
  621. }
  622. },
  623. data() {
  624. return {
  625. currentPage: 1, // 当前页码
  626. pageSize: 10, // 每页数量
  627. listTotal: 0, // 列表总数
  628. dataList: null, // 列表数据
  629. listLoading: false, // 列表加载loading
  630. screenForm: {
  631. // 筛选表单数据
  632. status: [],
  633. orderNum: '',
  634. enginNum: '',
  635. loginNum: '',
  636. refTradeCategory: '',
  637. date: '',
  638. saleType: '',
  639. createMan: '',
  640. examineMan: '',
  641. salesMan: '',
  642. refUseUnit: '',
  643. materialOldNumber: '',
  644. specification: '',
  645. customerKeyword: '',
  646. refRegionWork: '',
  647. remark: '',
  648. geLiInerNote: '',
  649. refFactoryNo: '',
  650. refBuyUnitName: '',
  651. refPromiseProvide: '',
  652. isDirectTransfer: null,
  653. orderTime: [],
  654. saleTypeId: '',
  655. customerWalletId: ''
  656. },
  657. statusList: [
  658. { label: '已保存', value: 'SAVE' },
  659. { label: '待审核', value: 'WAIT' },
  660. { label: '审核通过', value: 'OK' }
  661. // // { label: '审核驳回', value: 'FAIL' },,
  662. // { label: '已关闭', value: 'CLOSE' },
  663. ],
  664. salesmanList: [],
  665. transfer: [
  666. { label: '是', value: true },
  667. { label: '否', value: false }
  668. ],
  669. multipleSelection: [],
  670. queryItem: {},
  671. isShowDetail: false,
  672. isShowForm: false,
  673. isShowExamine: false,
  674. isShowReturn: false,
  675. editId: null,
  676. isShowEditDateDialog: false,
  677. dateForm: {
  678. date: ''
  679. },
  680. isCollapse: true,
  681. salesTypeList: [],
  682. NoRebateWalletList: [],
  683. typeList: [],
  684. numSum:{
  685. totalC:0,
  686. amountC:0
  687. }
  688. }
  689. },
  690. computed: {
  691. exParams() {
  692. const ids = this.multipleSelection.map(item => {
  693. return item.enginOrderNo
  694. })
  695. return {
  696. examineStatus: this.screenForm.status.join(','),
  697. enginOrderNo: ids && ids.length ? ids.join(',') : this.screenForm.orderNum,
  698. refProjectNo: this.screenForm.enginNum,
  699. refEnginRecordNo: this.screenForm.loginNum,
  700. refTradeCategory: this.screenForm.refTradeCategory,
  701. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  702. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  703. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  704. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  705. saleTypeId: this.screenForm.saleType,
  706. createName: this.screenForm.createMan,
  707. confirmName: this.screenForm.examineMan,
  708. serviceId: this.screenForm.salesMan,
  709. refUseUnit: this.screenForm.refUseUnit,
  710. materialOldNumber: this.screenForm.materialOldNumber,
  711. specification: this.screenForm.specification,
  712. customerKeyword: this.screenForm.customerKeyword,
  713. refRegionWork: this.screenForm.refRegionWork,
  714. remark: this.screenForm.remark,
  715. geLiInerNote: this.screenForm.geLiInerNote,
  716. refFactoryNo: this.screenForm.refFactoryNo,
  717. refBuyUnitName: this.screenForm.refBuyUnitName,
  718. refPromiseProvide: this.screenForm.refPromiseProvide,
  719. isDirectTransfer: this.screenForm.isDirectTransfer,
  720. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  721. }
  722. },
  723. isCustomer() {
  724. return this.$store.getters.customerId && this.$store.getters.customerNumber
  725. }
  726. },
  727. beforeCreate() {
  728. that = this
  729. },
  730. created() {
  731. this.getSalesTypeList()
  732. this.getSalesmanList()
  733. this.getList()
  734. },
  735. methods: {
  736. // 获取业务员列表
  737. getSalesmanList() {
  738. getSalesmanList({
  739. pageNum: 1,
  740. pageSize: -1,
  741. isCustomer: 0,
  742. status: true
  743. }).then(res => {
  744. this.salesmanList = res.data.records
  745. })
  746. getNoRebateWalletList({
  747. walletName: ''
  748. }).then(res => {
  749. console.log(res)
  750. this.NoRebateWalletList = res.data
  751. console.log(this.NoRebateWalletList)
  752. })
  753. getTypeList({ pageNum: 1, pageSize: -1 }).then(res => {
  754. this.typeList = res.data.records
  755. console.log(this.typeList)
  756. })
  757. },
  758. // 获取销售类型列表
  759. getSalesTypeList() {
  760. getTypeList({
  761. pageNum: 1,
  762. pageSize: -1
  763. }).then(res => {
  764. this.salesTypeList = res.data.records
  765. })
  766. },
  767. // 查询列表
  768. getList() {
  769. this.listLoading = true
  770. const params = {
  771. pageNum: this.currentPage,
  772. pageSize: this.pageSize,
  773. examineStatus: this.screenForm.status.join(','),
  774. enginOrderNo: this.screenForm.orderNum,
  775. refProjectNo: this.screenForm.enginNum,
  776. refEnginRecordNo: this.screenForm.loginNum,
  777. refTradeCategory: this.screenForm.refTradeCategory,
  778. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  779. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  780. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  781. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  782. createName: this.screenForm.createMan,
  783. confirmName: this.screenForm.examineMan,
  784. serviceId: this.screenForm.salesMan,
  785. refUseUnit: this.screenForm.refUseUnit,
  786. materialOldNumber: this.screenForm.materialOldNumber,
  787. specification: this.screenForm.specification,
  788. customerKeyword: this.screenForm.customerKeyword,
  789. refRegionWork: this.screenForm.refRegionWork,
  790. remark: this.screenForm.remark,
  791. geLiInerNote: this.screenForm.geLiInerNote,
  792. saleTypeId: this.screenForm.saleTypeId,
  793. customerWalletId: this.screenForm.customerWalletId,
  794. refFactoryNo: this.screenForm.refFactoryNo,
  795. refBuyUnitName: this.screenForm.refBuyUnitName,
  796. isDirectTransfer: this.screenForm.isDirectTransfer,
  797. refPromiseProvide: this.screenForm.refPromiseProvide,
  798. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  799. }
  800. getOrderList(params).then(res => {
  801. res.data.records.forEach(item => {
  802. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty']
  803. item.sums2 = ['price', 'totalAmount', 'payAmount', 'discAmount']
  804. })
  805. this.dataList = res.data.records
  806. this.listTotal = res.data.total
  807. this.listLoading = false
  808. })
  809. getEnginCountList({
  810. examineStatus: this.screenForm.status.join(','),
  811. enginOrderNo: this.screenForm.orderNum,
  812. refProjectNo: this.screenForm.enginNum,
  813. refEnginRecordNo: this.screenForm.loginNum,
  814. refTradeCategory: this.screenForm.refTradeCategory,
  815. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  816. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  817. startOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
  818. endOrderTime: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
  819. createName: this.screenForm.createMan,
  820. confirmName: this.screenForm.examineMan,
  821. serviceId: this.screenForm.salesMan,
  822. refUseUnit: this.screenForm.refUseUnit,
  823. materialOldNumber: this.screenForm.materialOldNumber,
  824. specification: this.screenForm.specification,
  825. customerKeyword: this.screenForm.customerKeyword,
  826. refRegionWork: this.screenForm.refRegionWork,
  827. remark: this.screenForm.remark,
  828. geLiInerNote: this.screenForm.geLiInerNote,
  829. saleTypeId: this.screenForm.saleTypeId,
  830. customerWalletId: this.screenForm.customerWalletId,
  831. refFactoryNo: this.screenForm.refFactoryNo,
  832. refBuyUnitName: this.screenForm.refBuyUnitName,
  833. isDirectTransfer: this.screenForm.isDirectTransfer,
  834. refPromiseProvide: this.screenForm.refPromiseProvide,
  835. enginOrderType: 'HOME' // TRADE=商用 HOME=家用
  836. }).then(res=>{
  837. if (res.data){
  838. this.numSum = res.data
  839. }
  840. })
  841. },
  842. // 提交筛选表单
  843. submitScreenForm() {
  844. this.currentPage = 1
  845. this.getList()
  846. },
  847. // 重置筛选表单
  848. resetScreenForm() {
  849. this.$refs.screenForm.resetFields()
  850. this.currentPage = 1
  851. this.getList()
  852. },
  853. // 更改每页数量
  854. handleSizeChange(val) {
  855. this.pageSize = val
  856. this.currentPage = 1
  857. this.getList()
  858. },
  859. // 更改当前页
  860. handleCurrentChange(val) {
  861. this.currentPage = val
  862. this.getList()
  863. },
  864. // 进入表单
  865. toForm(item) {
  866. this.queryItem = item
  867. this.isShowForm = true
  868. },
  869. // 进入审批
  870. toExamine(item) {
  871. this.queryItem = item
  872. this.isShowExamine = true
  873. },
  874. // 进入详情
  875. toDetail(item) {
  876. this.queryItem = item
  877. this.isShowDetail = true
  878. },
  879. // 进入退订
  880. toReturn(item) {
  881. if (item.refundableQty <= 0) {
  882. return this.$errorMsg('可退数量为0')
  883. }
  884. this.queryItem = item
  885. this.isShowReturn = true
  886. },
  887. backList() {
  888. this.queryItem = {}
  889. this.isShowDetail = false
  890. this.isShowForm = false
  891. this.isShowExamine = false
  892. this.isShowReturn = false
  893. },
  894. // 申请
  895. handleSubmit(id, row) {
  896. this.$confirm('发货时将暂扣工程押金,请确保钱包余额充足', '温馨提示').then(() => {
  897. applyHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  898. this.$successMsg()
  899. this.getList()
  900. })
  901. })
  902. },
  903. // 撤回
  904. handleWithdraw(id, row) {
  905. withdrawHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  906. this.$successMsg()
  907. this.getList()
  908. })
  909. },
  910. // 弃审
  911. handleAbandon(id, row) {
  912. abandonHome({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  913. this.$successMsg()
  914. this.getList()
  915. })
  916. },
  917. // 删除
  918. handleDelete(id, row) {
  919. deleteHome({ ids: id }).then(res => {
  920. this.$successMsg()
  921. this.getList()
  922. })
  923. },
  924. // 批量删除
  925. batchDelete() {
  926. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  927. confirmButtonText: '确定',
  928. cancelButtonText: '取消',
  929. type: 'warning'
  930. })
  931. .then(() => {
  932. const ids = this.multipleSelection.map(item => {
  933. return item.parentId
  934. })
  935. deleteHome({ ids: ids.join(',') }).then(res => {
  936. this.$successMsg()
  937. this.getList()
  938. })
  939. })
  940. .catch(() => {})
  941. },
  942. handleSelectionChange(val) {
  943. this.multipleSelection = val
  944. },
  945. // 打开 修改订单日期
  946. editDate(item) {
  947. this.editId = item.parentId
  948. this.dateForm.date = item.orderDate.slice(0, 10)
  949. this.isShowEditDateDialog = true
  950. },
  951. // 提交 修改订单日期
  952. submitDateForm() {
  953. editDateHome({
  954. enginOrderId: this.editId,
  955. orderDate: this.dateForm.date + ' 00:00:00',
  956. refEnginRecordNo: this.screenForm.loginNum
  957. }).then(res => {
  958. this.isShowEditDateDialog = false
  959. this.getList()
  960. this.$successMsg('修改成功')
  961. })
  962. }
  963. }
  964. }
  965. </script>
  966. <style lang="scss" scoped>
  967. .ulStyle{
  968. list-style: none;
  969. margin: 0;
  970. padding: 10px 0;
  971. background-color: #ffffff;
  972. z-index: 1;
  973. }
  974. .title{
  975. display: inline-block;
  976. font-weight: 700;
  977. margin-right: 20px;
  978. }
  979. .num{
  980. padding-left: 6px;
  981. font-weight: 400;
  982. }
  983. </style>