apply_list.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowForm && !isShowReturnForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #left_btn>
  8. <el-radio-group v-model="screenForm.status" size="mini" @change="getList()">
  9. <el-radio-button label="">全部</el-radio-button>
  10. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{
  11. item.label
  12. }}</el-radio-button>
  13. </el-radio-group>
  14. </template>
  15. <template #right_btn>
  16. <div>
  17. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  18. <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
  19. </div>
  20. </template>
  21. <template #search>
  22. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  23. <el-row :gutter="20">
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="发货申请单" prop="orderNum">
  26. <el-input v-model="screenForm.orderNum" placeholder="请输入发货申请单" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="仓库名称" prop="warehouse">
  31. <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称" />
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="经销商编码" prop="jxsNum">
  36. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码" />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :sm="12" :lg="6">
  40. <el-form-item label="经销商名称" prop="jxsName">
  41. <el-input v-model="screenForm.jxsName" 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. range-separator="至"
  50. style="width: 100%"
  51. value-format="yyyy-MM-dd HH:mm:ss"
  52. start-placeholder="开始日期"
  53. end-placeholder="结束日期"
  54. />
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="6">
  58. <el-form-item label="产品名称" prop="chName">
  59. <el-input v-model="screenForm.chName" placeholder="请输入产品名称" />
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :lg="6">
  63. <el-form-item label="规格型号" prop="model">
  64. <el-input v-model="screenForm.model" placeholder="请输入规格型号" />
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="表头业务员" prop="k3ServiceId">
  69. <el-select
  70. v-model="screenForm.k3ServiceId"
  71. placeholder="选择表头业务员"
  72. size="small"
  73. clearable
  74. filterable
  75. style="width: 100%"
  76. >
  77. <el-option
  78. v-for="item in salesmanList"
  79. :key="item.adminUserId"
  80. :label="item.nickName"
  81. :value="item.adminUserId"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :xs="24" :sm="12" :lg="6">
  87. <el-form-item label="表体业务员" prop="serviceId">
  88. <el-select
  89. v-model="screenForm.serviceId"
  90. placeholder="选择表体业务员"
  91. size="mini"
  92. clearable
  93. filterable
  94. style="width: 100%"
  95. >
  96. <el-option
  97. v-for="item in salesmanList"
  98. :key="item.adminUserId"
  99. :label="item.nickName"
  100. :value="item.adminUserId"
  101. />
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :xs="24" :sm="12" :lg="6">
  106. <el-form-item label="订单类型" prop="orderType">
  107. <el-select v-model="screenForm.orderType" placeholder="请选择" clearable>
  108. <el-option
  109. v-for="item in orderTypeList"
  110. :key="item.value"
  111. :label="item.label"
  112. :value="item.value"
  113. />
  114. </el-select>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :xs="24" :sm="12" :lg="6">
  118. <el-form-item label="订单号" prop="mainOrderId">
  119. <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单号" />
  120. </el-form-item>
  121. </el-col>
  122. <el-col :xs="24" :sm="12" :lg="6">
  123. <el-form-item label="产品类别">
  124. <el-select
  125. v-model="screenForm.categoryId"
  126. style="width: 100%"
  127. placeholder="选择产品类别"
  128. filterable
  129. clearable
  130. >
  131. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
  132. </el-select>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :xs="24" :sm="12" :lg="6">
  136. <el-form-item label="审核人" prop="approvalName">
  137. <el-input v-model="screenForm.approvalName" placeholder="请输入审核人" />
  138. </el-form-item>
  139. </el-col>
  140. <el-col :xs="24" :sm="12" :lg="6">
  141. <el-form-item label="制单人" prop="createBy">
  142. <el-input v-model="screenForm.createBy" placeholder="请输入制单人" />
  143. </el-form-item>
  144. </el-col>
  145. <el-col :xs="24" :sm="12" :lg="6"> </el-col>
  146. </el-row>
  147. </el-form>
  148. </template>
  149. </Collapse>
  150. </div>
  151. <div class="mymain-container">
  152. <div class="btn-group clearfix">
  153. <div class="fl">
  154. <el-button
  155. v-if="$checkBtnRole('add', $route.meta.roles)"
  156. size="mini"
  157. type="primary"
  158. icon="el-icon-plus"
  159. @click="toForm()"
  160. >发货申请</el-button
  161. >
  162. <el-button
  163. v-if="$checkBtnRole('refund', $route.meta.roles)"
  164. size="mini"
  165. type="primary"
  166. icon="el-icon-plus"
  167. @click="toReturnForm()"
  168. >退货申请</el-button
  169. >
  170. <el-button
  171. v-if="$checkBtnRole('examine', $route.meta.roles)"
  172. size="mini"
  173. type="warning"
  174. icon="el-icon-finished"
  175. :disabled="multipleSelection.length < 1"
  176. @click="batchExamine"
  177. >批量审批</el-button
  178. >
  179. </div>
  180. <div class="fr">
  181. <ExportButton :ex-url="'invoice/listExport'" :ex-params="exParams" />
  182. </div>
  183. </div>
  184. <div class="table">
  185. <el-table
  186. v-loading="listLoading"
  187. :data="dataList"
  188. element-loading-text="Loading"
  189. border
  190. fit
  191. :row-style="rowClass"
  192. show-summary
  193. :summary-method="$getSummaries"
  194. @selection-change="handleSelectionChange"
  195. >
  196. <el-table-column align="center" type="selection" width="55" fixed="left" :selectable="selectable" />
  197. <el-table-column align="left" label="订单状态" prop="type" min-width="120" show-overflow-tooltip>
  198. <template slot-scope="scope">
  199. {{ scope.row.automaticStatus ? '非计划单推发货' : '计划单推发货' }}
  200. </template>
  201. </el-table-column>
  202. <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
  203. <template slot-scope="scope">
  204. {{ scope.row.type | orderTypeFilter }}
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="left" label="发货申请单" prop="id" min-width="130" show-overflow-tooltip>
  208. <template slot-scope="scope">
  209. <CopyButton :copy-text="scope.row.id" />
  210. <span>{{ scope.row.id }}</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="left"
  215. label="发货申请日期"
  216. prop="createTime"
  217. min-width="160"
  218. show-overflow-tooltip
  219. />
  220. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip>
  221. <template slot-scope="scope">
  222. {{ scope.row.type === 3 ? scope.row.stockName : scope.row.correspondName }}
  223. </template>
  224. </el-table-column>
  225. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  226. <template slot-scope="scope">
  227. <CopyButton :copy-text="scope.row.mainOrderId" />
  228. <span>{{ scope.row.mainOrderId }}</span>
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. align="left"
  233. label="经销商编码"
  234. prop="customerNumber"
  235. min-width="100"
  236. show-overflow-tooltip
  237. >
  238. <template slot-scope="scope">
  239. <CopyButton :copy-text="scope.row.customerNumber" />
  240. <span>{{ scope.row.customerNumber }}</span>
  241. </template>
  242. </el-table-column>
  243. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  244. <template slot-scope="scope">
  245. <CopyButton :copy-text="scope.row.customerName" />
  246. <span>{{ scope.row.customerName }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  250. <template slot-scope="scope">
  251. <CopyButton :copy-text="scope.row.materialCode" />
  252. <span>{{ scope.row.materialCode }}</span>
  253. </template>
  254. </el-table-column>
  255. <el-table-column
  256. align="left"
  257. label="产品编码"
  258. prop="materialOldNumber"
  259. min-width="140"
  260. show-overflow-tooltip
  261. >
  262. <template slot-scope="scope">
  263. <CopyButton :copy-text="scope.row.materialOldNumber" />
  264. <span>{{ scope.row.materialOldNumber }}</span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  268. <template slot-scope="scope">
  269. <CopyButton :copy-text="scope.row.materialName" />
  270. <span>{{ scope.row.materialName }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  274. <template slot-scope="scope">
  275. <CopyButton :copy-text="scope.row.specification" />
  276. <span>{{ scope.row.specification }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column align="left" label="产品类别" prop="categoryName" min-width="100" show-overflow-tooltip>
  280. <template slot-scope="scope">
  281. <span>{{ scope.row.categoryName }}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. align="left"
  286. label="销售政策名称"
  287. prop="policyTitle"
  288. min-width="100"
  289. show-overflow-tooltip
  290. />
  291. <el-table-column align="left" label="文件编号" prop="itemFileNo" min-width="100" show-overflow-tooltip />
  292. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  293. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip />
  294. <el-table-column align="right" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
  295. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  296. <template slot-scope="scope">
  297. {{ scope.row.singlePayPrice | numToFixed }}
  298. </template>
  299. </el-table-column>
  300. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  301. <template slot-scope="scope">
  302. {{ scope.row.payAmount | numToFixed }}
  303. </template>
  304. </el-table-column>
  305. <el-table-column
  306. align="right"
  307. label="返利金额"
  308. prop="payRebateAmount"
  309. min-width="100"
  310. show-overflow-tooltip
  311. >
  312. <template slot-scope="scope">
  313. {{ scope.row.payRebateAmount | numToFixed }}
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. align="right"
  318. label="格力折扣"
  319. prop="totalDiscAmount"
  320. min-width="100"
  321. show-overflow-tooltip
  322. >
  323. <template slot-scope="scope">
  324. {{ scope.row.totalDiscAmount | numToFixed }}
  325. </template>
  326. </el-table-column>
  327. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip />
  328. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip />
  329. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip />
  330. <el-table-column
  331. align="left"
  332. label="审批说明"
  333. prop="approvalRemark"
  334. min-width="160"
  335. show-overflow-tooltip
  336. />
  337. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
  338. <el-table-column
  339. align="left"
  340. label="表头业务员"
  341. prop="k3ServiceName"
  342. min-width="100"
  343. show-overflow-tooltip
  344. />
  345. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip />
  346. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip />
  347. <el-table-column align="left" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip />
  348. <el-table-column align="left" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip />
  349. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  350. <template slot-scope="scope">
  351. {{ scope.row.examineStatus | statusFilter }}
  352. </template>
  353. </el-table-column>
  354. <el-table-column
  355. v-if="this.$store.getters.customerNumber === '100093' || this.$store.getters.customerNumber === '600023'"
  356. align="left"
  357. label="同步到格匠采购入库单"
  358. prop="gejiangSync"
  359. min-width="160"
  360. show-overflow-tooltip
  361. >
  362. <template slot-scope="scope">
  363. {{ scope.row.gejiangSync === 1 ? '同步成功' : scope.row.gejiangSync === 0 ? '待同步' : '同步失败' }}
  364. </template>
  365. </el-table-column>
  366. <el-table-column
  367. align="left"
  368. v-if="this.$store.getters.customerNumber === '100093' || this.$store.getters.customerNumber === '600023'"
  369. label="同步格匠失败原因"
  370. prop="gejiangSyncRemark"
  371. min-width="160"
  372. show-overflow-tooltip
  373. />
  374. <el-table-column align="center" label="操作" width="180" fixed="right">
  375. <template slot-scope="scope">
  376. <el-popconfirm
  377. v-if="
  378. ($checkBtnRole('apply', $route.meta.roles) &&
  379. !scope.row.automaticStatus &&
  380. scope.row.examineStatus === 'SAVE') ||
  381. ($checkBtnRole('apply', $route.meta.roles) &&
  382. scope.row.automaticStatus &&
  383. scope.row.examineStatus === 'SAVE' &&
  384. scope.row.type == 2)
  385. "
  386. style="margin-right: 10px"
  387. title="确定申请吗?"
  388. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  389. >
  390. <el-button slot="reference" type="text">申请</el-button>
  391. </el-popconfirm>
  392. <el-popconfirm
  393. v-if="
  394. ($checkBtnRole('apply', $route.meta.roles) &&
  395. !scope.row.automaticStatus &&
  396. scope.row.examineStatus === 'WAIT') ||
  397. ($checkBtnRole('apply', $route.meta.roles) &&
  398. scope.row.automaticStatus &&
  399. scope.row.examineStatus === 'SAVE' &&
  400. scope.row.type == 2)
  401. "
  402. style="margin-right: 10px"
  403. title="确定撤回吗?"
  404. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  405. >
  406. <el-button slot="reference" type="text">撤回</el-button>
  407. </el-popconfirm>
  408. <el-popconfirm
  409. v-if="
  410. ($checkBtnRole('examine', $route.meta.roles) &&
  411. !scope.row.automaticStatus &&
  412. scope.row.examineStatus === 'OK') ||
  413. ($checkBtnRole('examine', $route.meta.roles) &&
  414. scope.row.automaticStatus &&
  415. scope.row.examineStatus === 'SAVE' &&
  416. scope.row.type == 2)
  417. "
  418. style="margin-right: 10px"
  419. title="确定弃审吗?"
  420. @onConfirm="handleAbandon(scope.row.id)"
  421. >
  422. <el-button slot="reference" type="text">弃审</el-button>
  423. </el-popconfirm>
  424. <el-button
  425. v-if="
  426. $checkBtnRole('edit', $route.meta.roles) &&
  427. !scope.row.automaticStatus &&
  428. (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') &&
  429. scope.row.type === 1
  430. "
  431. type="text"
  432. @click="toForm(scope.row)"
  433. >
  434. 编辑
  435. </el-button>
  436. <el-button
  437. v-if="
  438. ($checkBtnRole('del', $route.meta.roles) &&
  439. !scope.row.automaticStatus &&
  440. scope.row.examineStatus !== 'OK') ||
  441. ($checkBtnRole('del', $route.meta.roles) && scope.row.automaticStatus && scope.row.type == 2)
  442. "
  443. type="text"
  444. @click="toReturnForm(scope.row)"
  445. >
  446. 编辑
  447. </el-button>
  448. <el-button
  449. v-if="
  450. ($checkBtnRole('examine', $route.meta.roles) &&
  451. !scope.row.automaticStatus &&
  452. scope.row.examineStatus === 'WAIT') ||
  453. ($checkBtnRole('examine', $route.meta.roles) && scope.row.automaticStatus && scope.row.type === 2)
  454. "
  455. type="text"
  456. @click="toExamine(scope.row)"
  457. >
  458. 审单
  459. </el-button>
  460. <el-button type="text" @click="toDetail(scope.row)"> 详情 </el-button>
  461. <el-popconfirm
  462. v-if="
  463. $checkBtnRole('del', $route.meta.roles) &&
  464. !scope.row.automaticStatus &&
  465. scope.row.type == 2 &&
  466. (scope.row.examineStatus !== 'OK' || scope.row.examineStatus === 'SAVE')
  467. "
  468. style="margin-left: 10px"
  469. title="确定删除吗?"
  470. @onConfirm="handleDelete(scope.row.id)"
  471. >
  472. <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
  473. </el-popconfirm>
  474. </template>
  475. </el-table-column>
  476. </el-table>
  477. </div>
  478. </div>
  479. <div class="pagination clearfix">
  480. <div class="fr">
  481. <el-pagination
  482. :current-page="currentPage"
  483. :page-sizes="[10, 20, 30, 50]"
  484. :page-size="10"
  485. layout="total, sizes, prev, pager, next, jumper"
  486. :total="listTotal"
  487. @size-change="handleSizeChange"
  488. @current-change="handleCurrentChange"
  489. />
  490. </div>
  491. </div>
  492. </div>
  493. <ExamineDialog :is-show.sync="isShowExamineDialog" :examine-form.sync="examineForm" />
  494. <ApplyDetail v-if="isShowDetail" ref="refDetail" :list-item="queryItem" @backListFormDetail="backList" />
  495. <ApplyExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
  496. <ApplyForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
  497. <ApplyReturnForm v-if="isShowReturnForm" :list-item="queryItem" :is-show="isShow" @backListFormDetail="backList" />
  498. </div>
  499. </template>
  500. <script>
  501. import { getApplyList, submitApply, deleteApply, abandonApply, examineBatchApply } from '@/api/supply/apply'
  502. import { getCategoryList, getSalesmanList } from '@/api/common'
  503. import ApplyDetail from '@/views/supply/apply/components/apply_detail'
  504. import ApplyExamine from '@/views/supply/apply/components/apply_examine'
  505. import ApplyForm from '@/views/supply/apply/components/apply_form'
  506. import ApplyReturnForm from '@/views/supply/apply/components/apply_return_form'
  507. import ExamineDialog from '@/components/Common/examine-dialog'
  508. let that
  509. export default {
  510. components: {
  511. ApplyDetail,
  512. ApplyExamine,
  513. ApplyForm,
  514. ApplyReturnForm,
  515. ExamineDialog
  516. },
  517. filters: {
  518. statusFilter(val) {
  519. const obj = that.statusList.find(o => o.value == val)
  520. return obj ? obj.label : ''
  521. },
  522. orderTypeFilter(val) {
  523. const obj = that.orderTypeList.find(o => o.value == val)
  524. return obj ? obj.label : ''
  525. }
  526. },
  527. data() {
  528. return {
  529. currentPage: 1, // 当前页码
  530. pageSize: 10, // 每页数量
  531. listTotal: 0, // 列表总数
  532. dataList: null, // 列表数据
  533. listLoading: false, // 列表加载loading
  534. screenForm: {
  535. // 筛选表单数据
  536. status: '',
  537. orderNum: '',
  538. warehouse: '',
  539. jxsNum: '',
  540. jxsName: '',
  541. date: '',
  542. chName: '',
  543. model: '',
  544. salesMan: '',
  545. orderType: '',
  546. mainOrderId: '',
  547. k3ServiceId: '',
  548. serviceId: '',
  549. categoryId: '',
  550. approvalName: '',
  551. createBy: ''
  552. },
  553. statusList: [
  554. { label: '已保存', value: 'SAVE' },
  555. { label: '待审核', value: 'WAIT' },
  556. { label: '审核通过', value: 'OK' },
  557. // // { label: '审核驳回', value: 'FAIL' },,
  558. { label: '已关闭', value: 'CLOSE' }
  559. ],
  560. orderTypeList: [
  561. { label: '发货申请单', value: 1 },
  562. { label: '退货申请单', value: 2 },
  563. { label: '直调发货单', value: 3 }
  564. ],
  565. salesmanList: [],
  566. queryItem: {},
  567. isShowDetail: false,
  568. isShowExamine: false,
  569. isShowForm: false,
  570. isShowReturnForm: false,
  571. selectRow: [],
  572. multipleSelection: [],
  573. isShowExamineDialog: false,
  574. examineForm: {
  575. status: '',
  576. remark: ''
  577. },
  578. categoryList: []
  579. }
  580. },
  581. computed: {
  582. exParams() {
  583. return {
  584. id: this.screenForm.orderNum,
  585. correspondName: this.screenForm.warehouse,
  586. customerNumber: this.screenForm.jxsNum,
  587. customerName: this.screenForm.jxsName,
  588. productName: this.screenForm.chName,
  589. specification: this.screenForm.model,
  590. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  591. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  592. examineStatus: this.screenForm.status,
  593. k3ServiceId: this.screenForm.k3ServiceId,
  594. serviceId: this.screenForm.serviceId,
  595. createBy: this.screenForm.createBy,
  596. type: this.screenForm.orderType,
  597. mainOrderId: this.screenForm.mainOrderId,
  598. categoryId: this.screenForm.categoryId,
  599. approvalName: this.screenForm.approvalName
  600. }
  601. }
  602. },
  603. watch: {
  604. multipleSelection(data) {
  605. // 监听选中状态
  606. this.selectRow = []
  607. if (data.length > 0) {
  608. data.forEach((item, index) => {
  609. this.selectRow.push(item.id)
  610. })
  611. }
  612. }
  613. },
  614. beforeCreate() {
  615. that = this
  616. },
  617. created() {
  618. this.getSalesmanList()
  619. this.getList()
  620. this.getCategoryList()
  621. this.isShow = false
  622. if (this.$route.query && this.$route.query.isShow) {
  623. this.isShow = this.$route.query.isShow
  624. this.toReturnForm()
  625. }
  626. },
  627. // activated() {
  628. // this.isShow = false
  629. // if (this.$route.query && this.$route.query.isShow) {
  630. // this.isShow = this.$route.query.isShow
  631. // this.toReturnForm()
  632. // }
  633. // },
  634. methods: {
  635. // 获取业务员列表
  636. getSalesmanList() {
  637. getSalesmanList({
  638. pageNum: 1,
  639. pageSize: -1,
  640. isCustomer: 0,
  641. status: true
  642. }).then(res => {
  643. this.salesmanList = res.data.records
  644. })
  645. },
  646. // 查询列表
  647. getList() {
  648. this.listLoading = true
  649. const params = {
  650. pageNum: this.currentPage,
  651. pageSize: this.pageSize,
  652. id: this.screenForm.orderNum,
  653. correspondName: this.screenForm.warehouse,
  654. customerNumber: this.screenForm.jxsNum,
  655. createBy: this.screenForm.createBy,
  656. customerName: this.screenForm.jxsName,
  657. productName: this.screenForm.chName,
  658. specification: this.screenForm.model,
  659. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  660. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  661. examineStatus: this.screenForm.status,
  662. serviceId: this.screenForm.salesMan,
  663. type: this.screenForm.orderType,
  664. k3ServiceId: this.screenForm.k3ServiceId,
  665. mainOrderId: this.screenForm.mainOrderId,
  666. categoryId: this.screenForm.categoryId,
  667. approvalName: this.screenForm.approvalName
  668. }
  669. getApplyList(params).then(res => {
  670. res.data.records.forEach(item => {
  671. item.sums1 = ['refundableQty', 'retiredQty']
  672. item.sums2 = ['singlePayPrice', 'payAmount', 'payRebateAmount', 'totalDiscAmount']
  673. })
  674. this.dataList = res.data.records
  675. this.listTotal = res.data.total
  676. this.listLoading = false
  677. })
  678. },
  679. // 提交筛选表单
  680. submitScreenForm() {
  681. this.currentPage = 1
  682. this.getList()
  683. },
  684. handleCollapse() {
  685. this.isCollapse = !this.isCollapse
  686. },
  687. // 重置筛选表单
  688. resetScreenForm() {
  689. this.$refs.screenForm.resetFields()
  690. this.currentPage = 1
  691. this.getList()
  692. },
  693. // 更改每页数量
  694. handleSizeChange(val) {
  695. this.pageSize = val
  696. this.currentPage = 1
  697. this.getList()
  698. },
  699. // 更改当前页
  700. handleCurrentChange(val) {
  701. this.currentPage = val
  702. this.getList()
  703. },
  704. // 进入表单
  705. toForm(item) {
  706. this.queryItem = item
  707. this.isShowForm = true
  708. },
  709. // 进入表单
  710. toReturnForm(item) {
  711. this.queryItem = item
  712. this.isShowReturnForm = true
  713. },
  714. // 进入审批
  715. toExamine(item) {
  716. this.queryItem = item
  717. this.isShowExamine = true
  718. },
  719. // 进入详情
  720. toDetail(item) {
  721. this.queryItem = item
  722. this.isShowDetail = true
  723. this.$nextTick(() => {
  724. this.$refs.refDetail.initPrint()
  725. })
  726. // this.$refs.refDetail.initPrint()
  727. },
  728. backList() {
  729. this.queryItem = {}
  730. this.isShowDetail = false
  731. this.isShowExamine = false
  732. this.isShowForm = false
  733. this.isShowReturnForm = false
  734. },
  735. handleDelete(id) {
  736. deleteApply({ id }).then(res => {
  737. this.$successMsg()
  738. this.getList()
  739. })
  740. },
  741. // 申请/撤回
  742. handleSubmit(id, examineStatus) {
  743. submitApply({ id, examineStatus }).then(res => {
  744. this.$successMsg()
  745. this.getList()
  746. })
  747. },
  748. // 弃审
  749. handleAbandon(id) {
  750. abandonApply({ id }).then(res => {
  751. this.$successMsg()
  752. this.getList()
  753. })
  754. },
  755. handleSelectionChange(val) {
  756. this.multipleSelection = val
  757. if (val) {
  758. this.selections = val
  759. } else {
  760. this.selections = []
  761. }
  762. },
  763. rowClass({ row, rowIndex }) {
  764. if (this.selectRow.includes(row.id)) {
  765. return { 'background-color': '#ecf5ff' }
  766. }
  767. },
  768. // 打开 批量审批
  769. batchExamine() {
  770. this.isShowExamineDialog = true
  771. },
  772. // 提交 批量审批
  773. submitExamineForm() {
  774. let ids = this.multipleSelection.map(item => {
  775. return item.id
  776. })
  777. ids = Array.from(new Set(ids))
  778. examineBatchApply({
  779. ids: ids.join(','),
  780. examineStatus: this.examineForm.status,
  781. approvalRemark: this.examineForm.remark
  782. }).then(res => {
  783. this.isShowExamineDialog = false
  784. this.getList()
  785. this.$successMsg('审批成功')
  786. })
  787. },
  788. // 获取存货类别列表
  789. getCategoryList() {
  790. getCategoryList({
  791. pageNum: 1,
  792. pageSize: -1
  793. }).then(res => {
  794. this.categoryList = res.data.records
  795. })
  796. },
  797. /**
  798. * 根据条件禁用行复选框
  799. * 函数返回值为false则禁用选择(反之亦然)
  800. * @param {Object} row - 行数据
  801. * @param {String} index - 索引值
  802. * @return Boolean
  803. */
  804. selectable: function (row, index) {
  805. if (row.automaticStatus) {
  806. return false
  807. }
  808. return true
  809. // 函数必须有返回值且是布尔值
  810. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  811. // 如果没有返回值则默认返回false(全部无法选中)
  812. }
  813. }
  814. }
  815. </script>
  816. <style lang="scss" scoped></style>