commerce_list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :is-collapse="isCollapse" :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="请输入工程订单号"></el-input>
  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 v-model="screenForm.enginNum" placeholder="请输入工程编号"></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :lg="6">
  32. <el-form-item label="工程信息单号" prop="loginNum">
  33. <el-input v-model="screenForm.loginNum" placeholder="请输入工程信息单号"></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :lg="6">
  37. <el-form-item label="项目名称" prop="enginName">
  38. <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="单据日期" prop="date">
  43. <el-date-picker
  44. v-model="screenForm.date"
  45. type="datetimerange"
  46. range-separator="至"
  47. style="width: 100%"
  48. value-format="yyyy-MM-dd HH:mm:ss"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期"
  51. >
  52. </el-date-picker>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6">
  56. <el-form-item label="销售类型" prop="saleType">
  57. <el-select v-model="screenForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
  58. <el-option
  59. v-for="item in salesTypeList"
  60. :key="item.id"
  61. :label="item.saleName"
  62. :value="item.id"
  63. ></el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="经销商" prop="dealer">
  69. <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
  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="请输入制表人"></el-input>
  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="请输入审核人"></el-input>
  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-option>
  98. </el-select>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :lg="6">
  102. <el-form-item label="规格型号" prop="model">
  103. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :xs="24" :sm="12" :lg="6">
  107. <el-form-item label="是否直调" prop="isDirectTransfer">
  108. <el-select v-model="screenForm.isDirectTransfer" placeholder="选择是否直" style="width: 100%">
  109. <el-option :value="null" label="默认"></el-option>
  110. <el-option v-for="item in transfer" :key="item.value" :label="item.label" :value="item.value">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. </el-form>
  117. </template>
  118. </Collapse>
  119. </div>
  120. <div class="mymain-container">
  121. <div class="btn-group clearfix">
  122. <div class="fl">
  123. <el-button
  124. size="mini"
  125. type="primary"
  126. icon="el-icon-plus"
  127. @click="toForm()"
  128. v-if="$checkBtnRole('add', $route.meta.roles)"
  129. >新增</el-button
  130. >
  131. <el-button
  132. size="mini"
  133. type="danger"
  134. icon="el-icon-minus"
  135. :disabled="multipleSelection.length < 1"
  136. @click="batchDelete()"
  137. v-if="$checkBtnRole('del', $route.meta.roles)"
  138. >批量删除</el-button
  139. >
  140. </div>
  141. <div class="fr">
  142. <ExportButton :exUrl="'engin-order/export'" :exParams="exParams" />
  143. </div>
  144. </div>
  145. <div class="table">
  146. <el-table
  147. v-loading="listLoading"
  148. :data="dataList"
  149. element-loading-text="Loading"
  150. border
  151. fit
  152. highlight-current-row
  153. stripe
  154. @selection-change="handleSelectionChange"
  155. show-summary
  156. :summary-method="$getSummaries"
  157. >
  158. <el-table-column align="center" type="selection" width="55"></el-table-column>
  159. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  160. <template slot-scope="scope">
  161. {{ scope.row.examineStatus | statusFilter }}
  162. </template>
  163. </el-table-column>
  164. <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  165. <template slot-scope="scope">
  166. <CopyButton :copyText="scope.row.enginOrderNo" />
  167. <span>{{ scope.row.enginOrderNo }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column align="left" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
  171. <template slot-scope="scope">
  172. <div>
  173. <span>{{ scope.row.orderDate | dateToDayFilter }}</span>
  174. <el-button
  175. type="text"
  176. icon="el-icon-edit"
  177. style="padding: 0; margin-left: 6px"
  178. @click="editDate(scope.row)"
  179. v-if="
  180. $checkBtnRole('date', $route.meta.roles) &&
  181. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')
  182. "
  183. ></el-button>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column
  188. align="left"
  189. label="工程编号"
  190. prop="refProjectNo"
  191. min-width="160"
  192. show-overflow-tooltip
  193. ></el-table-column>
  194. <el-table-column
  195. align="left"
  196. label="工程登录编号"
  197. prop="refEnginRecordNo"
  198. min-width="200"
  199. show-overflow-tooltip
  200. >
  201. <template slot-scope="scope">
  202. <CopyButton :copyText="scope.row.refEnginRecordNo" />
  203. <span>{{ scope.row.refEnginRecordNo }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column
  207. align="left"
  208. label="仓库"
  209. prop="correspondName"
  210. min-width="160"
  211. show-overflow-tooltip
  212. ></el-table-column>
  213. <el-table-column align="left" label="订单类型" prop="enginOrderType" min-width="100" show-overflow-tooltip>
  214. <template slot-scope="scope">
  215. {{ scope.row.enginOrderType | typeFilter }}
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  219. <template slot-scope="scope">
  220. <CopyButton :copyText="scope.row.customerName" />
  221. <span>{{ scope.row.customerName }}</span>
  222. </template>
  223. </el-table-column>
  224. <el-table-column
  225. align="left"
  226. label="使用单位"
  227. prop="refUseUnit"
  228. min-width="160"
  229. show-overflow-tooltip
  230. ></el-table-column>
  231. <el-table-column
  232. align="left"
  233. label="项目名称"
  234. prop="refProjectName"
  235. min-width="160"
  236. show-overflow-tooltip
  237. ></el-table-column>
  238. <!-- <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>-->
  239. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  240. <template slot-scope="scope">
  241. <CopyButton :copyText="scope.row.materialNumber" />
  242. <span>{{ scope.row.materialNumber }}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column
  246. align="left"
  247. label="产品编码"
  248. prop="materialOldNumber"
  249. min-width="140"
  250. show-overflow-tooltip
  251. >
  252. <template slot-scope="scope">
  253. <CopyButton :copyText="scope.row.materialOldNumber" />
  254. <span>{{ scope.row.materialOldNumber }}</span>
  255. </template>
  256. </el-table-column>
  257. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  258. <template slot-scope="scope">
  259. <CopyButton :copyText="scope.row.materialName" />
  260. <span>{{ scope.row.materialName }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  264. <template slot-scope="scope">
  265. <CopyButton :copyText="scope.row.specification" />
  266. <span>{{ scope.row.specification }}</span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column
  270. align="left"
  271. label="单位"
  272. prop="unit"
  273. min-width="100"
  274. show-overflow-tooltip
  275. ></el-table-column>
  276. <el-table-column
  277. align="right"
  278. label="总数量"
  279. prop="qty"
  280. min-width="100"
  281. sortable
  282. show-overflow-tooltip
  283. ></el-table-column>
  284. <el-table-column
  285. align="left"
  286. label="是否直调"
  287. prop="isDirectTransfer"
  288. min-width="100"
  289. show-overflow-tooltip
  290. >
  291. <template slot-scope="scope">
  292. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. align="right"
  297. label="直调数量"
  298. prop="directTransferQty"
  299. min-width="110"
  300. sortable
  301. show-overflow-tooltip
  302. ></el-table-column>
  303. <el-table-column
  304. align="right"
  305. label="出库数量"
  306. prop="hasSendQty"
  307. min-width="110"
  308. sortable
  309. show-overflow-tooltip
  310. ></el-table-column>
  311. <el-table-column align="right" label="单价" prop="price" min-width="100" sortable show-overflow-tooltip>
  312. <template slot-scope="scope">
  313. {{ scope.row.price | numToFixed }}
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. align="right"
  318. label="实付金额"
  319. prop="payAmount"
  320. min-width="110"
  321. sortable
  322. show-overflow-tooltip
  323. >
  324. <template slot-scope="scope">
  325. {{ scope.row.payAmount | numToFixed }}
  326. </template>
  327. </el-table-column>
  328. <el-table-column
  329. align="left"
  330. label="返利钱包"
  331. prop="customerWalletName2"
  332. min-width="100"
  333. show-overflow-tooltip
  334. ></el-table-column>
  335. <el-table-column
  336. align="right"
  337. label="使用返利金额"
  338. prop="rebateAmount"
  339. min-width="120"
  340. show-overflow-tooltip
  341. >
  342. <template slot-scope="scope">
  343. <div v-if="scope.row.examineStatus === 'OK'">
  344. {{ scope.row.payRebateAmount | numToFixed }}
  345. </div>
  346. <div v-else>{{ scope.row.rebateAmount | numToFixed }}</div>
  347. </template>
  348. </el-table-column>
  349. <el-table-column
  350. align="right"
  351. label="格力折扣"
  352. prop="discAmount"
  353. min-width="110"
  354. sortable
  355. show-overflow-tooltip
  356. >
  357. <template slot-scope="scope">
  358. {{ scope.row.discAmount | numToFixed }}
  359. </template>
  360. </el-table-column>
  361. <el-table-column
  362. align="left"
  363. label="备注"
  364. prop="remark"
  365. min-width="160"
  366. show-overflow-tooltip
  367. ></el-table-column>
  368. <el-table-column
  369. align="left"
  370. label="表头业务员"
  371. prop="serviceName"
  372. min-width="100"
  373. show-overflow-tooltip
  374. ></el-table-column>
  375. <el-table-column
  376. align="left"
  377. label="表体业务员"
  378. prop="itemServiceName"
  379. min-width="100"
  380. show-overflow-tooltip
  381. ></el-table-column>
  382. <el-table-column
  383. align="left"
  384. label="制表人"
  385. prop="createName"
  386. min-width="100"
  387. show-overflow-tooltip
  388. ></el-table-column>
  389. <el-table-column
  390. align="left"
  391. label="制表日期"
  392. prop="createTime"
  393. min-width="160"
  394. show-overflow-tooltip
  395. ></el-table-column>
  396. <el-table-column
  397. align="left"
  398. label="审核人"
  399. prop="confirmName"
  400. min-width="100"
  401. show-overflow-tooltip
  402. ></el-table-column>
  403. <el-table-column
  404. align="left"
  405. label="审核日期"
  406. prop="confirmTime"
  407. min-width="160"
  408. show-overflow-tooltip
  409. ></el-table-column>
  410. <el-table-column align="center" label="操作" width="220" fixed="right">
  411. <template slot-scope="scope">
  412. <el-popconfirm
  413. style="margin-right: 10px"
  414. title="确定申请吗?"
  415. @onConfirm="handleSubmit(scope.row.parentId, scope.row)"
  416. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
  417. >
  418. <el-button slot="reference" type="text">申请</el-button>
  419. </el-popconfirm>
  420. <el-popconfirm
  421. style="margin-right: 10px"
  422. title="确定撤回吗?"
  423. @onConfirm="handleWithdraw(scope.row.parentId, scope.row)"
  424. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  425. >
  426. <el-button slot="reference" type="text">撤回</el-button>
  427. </el-popconfirm>
  428. <el-popconfirm
  429. style="margin-right: 10px"
  430. title="确定弃审吗?"
  431. @onConfirm="handleAbandon(scope.row.parentId, scope.row)"
  432. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
  433. >
  434. <el-button slot="reference" type="text">弃审</el-button>
  435. </el-popconfirm>
  436. <el-button
  437. type="text"
  438. @click="toForm(scope.row)"
  439. v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
  440. >
  441. 编辑
  442. </el-button>
  443. <el-button
  444. type="text"
  445. @click="toExamine(scope.row)"
  446. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
  447. >
  448. 审批
  449. </el-button>
  450. <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles)">
  451. 退订
  452. </el-button>
  453. <el-button type="text" @click="toDetail(scope.row)"> 详情 </el-button>
  454. <el-popconfirm
  455. style="margin-left: 10px"
  456. title="确定删除吗?"
  457. @onConfirm="handleDelete(scope.row.parentId, scope.row)"
  458. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'"
  459. >
  460. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  461. </el-popconfirm>
  462. </template>
  463. </el-table-column>
  464. </el-table>
  465. </div>
  466. </div>
  467. <div class="pagination clearfix">
  468. <div class="fr">
  469. <el-pagination
  470. @size-change="handleSizeChange"
  471. @current-change="handleCurrentChange"
  472. :current-page="currentPage"
  473. :page-sizes="[10, 20, 30, 50]"
  474. :page-size="10"
  475. layout="total, sizes, prev, pager, next, jumper"
  476. :total="listTotal"
  477. >
  478. </el-pagination>
  479. </div>
  480. </div>
  481. </div>
  482. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  483. <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  484. <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  485. <CommerceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  486. <CommerceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
  487. </div>
  488. </template>
  489. <script>
  490. import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom, abandonCom } from '@/api/supply/engin'
  491. import { getSalesmanList, getTypeList } from '@/api/common'
  492. import CommerceDetail from '@/views/supply/engin/components/commerce_detail'
  493. import CommerceForm from '@/views/supply/engin/components/commerce_form'
  494. import CommerceExamine from '@/views/supply/engin/components/commerce_examine'
  495. import CommerceReturn from '@/views/supply/engin/components/commerce_return'
  496. import EditDateDialog from '@/components/Common/edit-date-dialog'
  497. let that
  498. export default {
  499. components: {
  500. CommerceDetail,
  501. CommerceForm,
  502. CommerceExamine,
  503. CommerceReturn,
  504. EditDateDialog
  505. },
  506. filters: {
  507. statusFilter(val) {
  508. let obj = that.statusList.find(o => o.value == val)
  509. return obj ? obj.label : ''
  510. },
  511. typeFilter(val) {
  512. const MAP = {
  513. TRADE: '商用',
  514. HOME: '家用'
  515. }
  516. return MAP[val]
  517. }
  518. },
  519. data() {
  520. return {
  521. currentPage: 1, // 当前页码
  522. pageSize: 10, // 每页数量
  523. listTotal: 0, // 列表总数
  524. dataList: null, // 列表数据
  525. listLoading: false, // 列表加载loading
  526. screenForm: {
  527. // 筛选表单数据
  528. status: [],
  529. orderNum: '',
  530. enginNum: '',
  531. loginNum: '',
  532. enginName: '',
  533. date: '',
  534. saleType: '',
  535. createMan: '',
  536. examineMan: '',
  537. salesMan: '',
  538. dealer: '',
  539. model: '',
  540. isDirectTransfer: null
  541. },
  542. statusList: [
  543. { label: '已保存', value: 'SAVE' },
  544. { label: '待审核', value: 'WAIT' },
  545. { label: '审核通过', value: 'OK' }
  546. // // { label: '审核驳回', value: 'FAIL' },,
  547. // { label: '已关闭', value: 'CLOSE' },
  548. ],
  549. salesmanList: [],
  550. salesTypeList: [],
  551. isCollapse: true,
  552. multipleSelection: [],
  553. transfer: [
  554. { label: '是', value: true },
  555. { label: '否', value: false }
  556. ],
  557. queryItem: {},
  558. isShowDetail: false,
  559. isShowForm: false,
  560. isShowExamine: false,
  561. isShowReturn: false,
  562. editId: null,
  563. isShowEditDateDialog: false,
  564. dateForm: {
  565. date: ''
  566. }
  567. }
  568. },
  569. computed: {
  570. exParams() {
  571. let ids = this.multipleSelection.map(item => {
  572. return item.enginOrderNo
  573. })
  574. return {
  575. examineStatus: this.screenForm.status.join(','),
  576. enginOrderNo: ids && ids.length ? ids.join(',') : this.screenForm.orderNum,
  577. refProjectNo: this.screenForm.enginNum,
  578. refEnginRecordNo: this.screenForm.loginNum,
  579. refProjectName: this.screenForm.enginName,
  580. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  581. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  582. saleTypeId: this.screenForm.saleType,
  583. createName: this.screenForm.createMan,
  584. confirmName: this.screenForm.examineMan,
  585. serviceId: this.screenForm.salesMan,
  586. customerKeyWord: this.screenForm.dealer,
  587. specification: this.screenForm.model,
  588. isDirectTransfer: this.screenForm.isDirectTransfer,
  589. enginOrderType: 'TRADE' // TRADE=商用 HOME=家用
  590. }
  591. }
  592. },
  593. beforeCreate() {
  594. that = this
  595. },
  596. created() {
  597. this.getSalesTypeList()
  598. this.getSalesmanList()
  599. this.getList()
  600. },
  601. methods: {
  602. // 获取业务员列表
  603. getSalesmanList() {
  604. getSalesmanList({
  605. pageNum: 1,
  606. pageSize: -1,
  607. isCustomer: 0,
  608. status: true
  609. }).then(res => {
  610. this.salesmanList = res.data.records
  611. })
  612. },
  613. // 获取销售类型列表
  614. getSalesTypeList() {
  615. getTypeList({
  616. pageNum: 1,
  617. pageSize: -1
  618. }).then(res => {
  619. this.salesTypeList = res.data.records
  620. })
  621. },
  622. // 查询列表
  623. getList() {
  624. this.listLoading = true
  625. let params = {
  626. pageNum: this.currentPage,
  627. pageSize: this.pageSize,
  628. examineStatus: this.screenForm.status.join(','),
  629. enginOrderNo: this.screenForm.orderNum,
  630. refProjectNo: this.screenForm.enginNum,
  631. refEnginRecordNo: this.screenForm.loginNum,
  632. refProjectName: this.screenForm.enginName,
  633. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  634. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  635. saleTypeId: this.screenForm.saleType,
  636. createName: this.screenForm.createMan,
  637. confirmName: this.screenForm.examineMan,
  638. serviceId: this.screenForm.salesMan,
  639. customerKeyword: this.screenForm.dealer,
  640. isDirectTransfer: this.screenForm.isDirectTransfer,
  641. specification: this.screenForm.model,
  642. enginOrderType: 'TRADE' // TRADE=商用 HOME=家用
  643. }
  644. getOrderList(params).then(res => {
  645. res.data.records.forEach(item => {
  646. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty']
  647. item.sums2 = ['price', 'payAmount', 'discAmount']
  648. })
  649. this.dataList = res.data.records
  650. this.listTotal = res.data.total
  651. this.listLoading = false
  652. })
  653. },
  654. // 提交筛选表单
  655. submitScreenForm() {
  656. this.currentPage = 1
  657. this.getList()
  658. },
  659. // 重置筛选表单
  660. resetScreenForm() {
  661. this.$refs.screenForm.resetFields()
  662. this.currentPage = 1
  663. this.getList()
  664. },
  665. // 更改每页数量
  666. handleSizeChange(val) {
  667. this.pageSize = val
  668. this.currentPage = 1
  669. this.getList()
  670. },
  671. // 更改当前页
  672. handleCurrentChange(val) {
  673. this.currentPage = val
  674. this.getList()
  675. },
  676. // 进入表单
  677. toForm(item) {
  678. this.queryItem = item
  679. this.isShowForm = true
  680. },
  681. // 进入审批
  682. toExamine(item) {
  683. this.queryItem = item
  684. this.isShowExamine = true
  685. },
  686. // 进入详情
  687. toDetail(item) {
  688. this.queryItem = item
  689. this.isShowDetail = true
  690. },
  691. // 进入退订
  692. toReturn(item) {
  693. this.queryItem = item
  694. this.isShowReturn = true
  695. },
  696. backList() {
  697. this.queryItem = {}
  698. this.isShowDetail = false
  699. this.isShowForm = false
  700. this.isShowExamine = false
  701. this.isShowReturn = false
  702. },
  703. // 申请
  704. handleSubmit(id, row) {
  705. applyCom({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  706. this.$successMsg()
  707. this.getList()
  708. })
  709. },
  710. // 撤回
  711. handleWithdraw(id, row) {
  712. withdrawCom({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  713. this.$successMsg()
  714. this.getList()
  715. })
  716. },
  717. // 弃审
  718. handleAbandon(id, row) {
  719. abandonCom({ id, refEnginRecordNo: row.refEnginRecordNo }).then(res => {
  720. this.$successMsg()
  721. this.getList()
  722. })
  723. },
  724. // 删除
  725. handleDelete(id) {
  726. deleteCom({ ids: id }).then(res => {
  727. this.$successMsg()
  728. this.getList()
  729. })
  730. },
  731. // 批量删除
  732. batchDelete() {
  733. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  734. confirmButtonText: '确定',
  735. cancelButtonText: '取消',
  736. type: 'warning'
  737. })
  738. .then(() => {
  739. let ids = this.multipleSelection.map(item => {
  740. return item.parentId
  741. })
  742. deleteCom({ ids: ids.join(',') }).then(res => {
  743. this.$successMsg()
  744. this.getList()
  745. })
  746. })
  747. .catch(() => {})
  748. },
  749. handleSelectionChange(val) {
  750. this.multipleSelection = val
  751. },
  752. // 打开 修改订单日期
  753. editDate(item) {
  754. this.editId = item.parentId
  755. this.dateForm.date = item.orderDate.slice(0, 10)
  756. this.isShowEditDateDialog = true
  757. },
  758. // 提交 修改订单日期
  759. submitDateForm() {
  760. editDateCom({
  761. refEnginRecordNo: this.screenForm.loginNum,
  762. enginOrderId: this.editId,
  763. orderDate: this.dateForm.date + ' 00:00:00'
  764. }).then(res => {
  765. this.isShowEditDateDialog = false
  766. this.getList()
  767. this.$successMsg('修改成功')
  768. })
  769. }
  770. }
  771. }
  772. </script>
  773. <style lang="scss" scoped></style>