apply_list.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowForm && !isShowReturnForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="24" :lg="24">
  9. <el-form-item prop="status" label-width="0">
  10. <el-radio-group v-model="screenForm.status" @change="getList()">
  11. <el-radio-button label="">全部</el-radio-button>
  12. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
  13. </el-radio-group>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :xs="24" :sm="12" :lg="6">
  17. <el-form-item label="发货申请单" prop="orderNum">
  18. <el-input v-model="screenForm.orderNum" placeholder="请输入发货申请单"></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="仓库名称" prop="warehouse">
  23. <el-input v-model="screenForm.warehouse" 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="jxsNum">
  28. <el-input v-model="screenForm.jxsNum" 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="jxsName">
  33. <el-input v-model="screenForm.jxsName" 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="date">
  38. <el-date-picker
  39. v-model="screenForm.date"
  40. type="datetimerange"
  41. range-separator="至"
  42. style="width: 100%;"
  43. value-format="yyyy-MM-dd HH:mm:ss"
  44. start-placeholder="开始日期"
  45. end-placeholder="结束日期">
  46. </el-date-picker>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="12" :lg="6">
  50. <el-form-item label="产品名称" prop="chName">
  51. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :lg="6">
  55. <el-form-item label="规格型号" prop="model">
  56. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6">
  60. <el-form-item label="表头业务员" prop="k3ServiceId">
  61. <el-select v-model="screenForm.k3ServiceId" placeholder="选择表头业务员" size="small" clearable filterable style="width: 100%">
  62. <el-option
  63. v-for="item in salesmanList"
  64. :key="item.adminUserId"
  65. :label="item.nickName"
  66. :value="item.adminUserId">
  67. </el-option>
  68. </el-select>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :xs="24" :sm="12" :lg="6">
  72. <el-form-item label="表体业务员" prop="serviceId">
  73. <el-select v-model="screenForm.serviceId" placeholder="选择表体业务员" size="small" clearable filterable style="width: 100%">
  74. <el-option
  75. v-for="item in salesmanList"
  76. :key="item.adminUserId"
  77. :label="item.nickName"
  78. :value="item.adminUserId">
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="12" :lg="6">
  84. <el-form-item label="订单类型" prop="orderType">
  85. <el-select v-model="screenForm.orderType" placeholder="请选择" clearable>
  86. <el-option
  87. v-for="item in orderTypeList"
  88. :key="item.value"
  89. :label="item.label"
  90. :value="item.value">
  91. </el-option>
  92. </el-select>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :xs="24" :sm="12" :lg="6">
  96. <el-form-item label="订单号" prop="mainOrderId">
  97. <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单号"></el-input>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :xs="24" :sm="12" :lg="6">
  101. <el-form-item label="产品类别" >
  102. <el-select v-model="screenForm.categoryId" style="width: 100%" placeholder="选择产品类别" filterable clearable>
  103. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
  104. </el-select>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  108. <el-form-item label="">
  109. <el-button @click="resetScreenForm">清空</el-button>
  110. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </div>
  116. <div class="mymain-container">
  117. <div class="btn-group clearfix">
  118. <div class="fl">
  119. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
  120. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('refund', $route.meta.roles)">退货申请</el-button>
  121. <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
  122. </div>
  123. <div class="fr">
  124. <ExportButton :exUrl="'invoice/listExport'" :exParams="exParams" />
  125. </div>
  126. </div>
  127. <div class="table">
  128. <el-table
  129. v-loading="listLoading"
  130. :data="dataList"
  131. element-loading-text="Loading"
  132. border
  133. fit
  134. :row-style="rowClass"
  135. @selection-change="handleSelectionChange"
  136. show-summary
  137. :summary-method="$getSummaries">
  138. <el-table-column align="center" type="selection" width="55" fixed="left"></el-table-column>
  139. <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. {{scope.row.type | orderTypeFilter}}
  142. </template>
  143. </el-table-column>
  144. <el-table-column align="left" label="发货申请单" prop="id" min-width="130" show-overflow-tooltip>
  145. <template slot-scope="scope">
  146. <CopyButton :copyText="scope.row.id" />
  147. <span>{{scope.row.id}}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column align="left" label="发货申请日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  151. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip>
  152. <template slot-scope="scope">
  153. {{scope.row.type === 3 ? scope.row.stockName : scope.row.correspondName}}
  154. </template>
  155. </el-table-column>
  156. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  157. <template slot-scope="scope">
  158. <CopyButton :copyText="scope.row.mainOrderId" />
  159. <span>{{scope.row.mainOrderId}}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  163. <template slot-scope="scope">
  164. <CopyButton :copyText="scope.row.customerNumber" />
  165. <span>{{scope.row.customerNumber}}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  169. <template slot-scope="scope">
  170. <CopyButton :copyText="scope.row.customerName" />
  171. <span>{{scope.row.customerName}}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  175. <template slot-scope="scope">
  176. <CopyButton :copyText="scope.row.materialCode" />
  177. <span>{{scope.row.materialCode}}</span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  181. <template slot-scope="scope">
  182. <CopyButton :copyText="scope.row.materialOldNumber" />
  183. <span>{{scope.row.materialOldNumber}}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  187. <template slot-scope="scope">
  188. <CopyButton :copyText="scope.row.materialName" />
  189. <span>{{scope.row.materialName}}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  193. <template slot-scope="scope">
  194. <CopyButton :copyText="scope.row.specification" />
  195. <span>{{scope.row.specification}}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column align="left" label="产品类别" prop="categoryName" min-width="350" show-overflow-tooltip>
  199. <template slot-scope="scope">
  200. <span>{{scope.row.categoryName}}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column align="left" label="销售政策名称" prop="policyTitle" min-width="350" show-overflow-tooltip>
  204. </el-table-column>
  205. <el-table-column align="left" label="文件编号" prop="itemFileNo" min-width="350" show-overflow-tooltip>
  206. </el-table-column>
  207. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  208. <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
  209. <template slot-scope="scope">
  210. {{scope.row.singlePayPrice | numToFixed}}
  211. </template>
  212. </el-table-column>
  213. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  214. <template slot-scope="scope">
  215. {{scope.row.payAmount | numToFixed}}
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  219. <template slot-scope="scope">
  220. {{scope.row.payRebateAmount | numToFixed}}
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  224. <template slot-scope="scope">
  225. {{scope.row.totalDiscAmount | numToFixed}}
  226. </template>
  227. </el-table-column>
  228. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  229. <el-table-column align="right" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
  230. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
  231. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  232. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
  233. <el-table-column align="left" label="审批说明" prop="approvalRemark" min-width="160" show-overflow-tooltip></el-table-column>
  234. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  235. <el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip></el-table-column>
  236. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  237. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  238. <el-table-column align="left" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
  239. <el-table-column align="left" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
  240. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  241. <template slot-scope="scope">
  242. {{scope.row.examineStatus | statusFilter}}
  243. </template>
  244. </el-table-column>
  245. <el-table-column align="center" label="操作" width="180" fixed="right">
  246. <template slot-scope="scope">
  247. <el-popconfirm
  248. style="margin-right: 10px;"
  249. title="确定申请吗?"
  250. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  251. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  252. <el-button slot="reference" type="text">申请</el-button>
  253. </el-popconfirm>
  254. <el-popconfirm
  255. style="margin-right: 10px;"
  256. title="确定撤回吗?"
  257. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  258. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  259. <el-button slot="reference" type="text">撤回</el-button>
  260. </el-popconfirm>
  261. <el-popconfirm
  262. style="margin-right: 10px;"
  263. title="确定弃审吗?"
  264. @onConfirm="handleAbandon(scope.row.id)"
  265. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  266. <el-button slot="reference" type="text">弃审</el-button>
  267. </el-popconfirm>
  268. <el-button
  269. type="text"
  270. @click="toForm(scope.row)"
  271. v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 1">
  272. 编辑
  273. </el-button>
  274. <el-button
  275. type="text"
  276. @click="toReturnForm(scope.row)"
  277. v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 2">
  278. 编辑
  279. </el-button>
  280. <el-button
  281. type="text"
  282. @click="toExamine(scope.row)"
  283. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
  284. 审单
  285. </el-button>
  286. <el-button
  287. type="text"
  288. @click="toDetail(scope.row)">
  289. 详情
  290. </el-button>
  291. <el-popconfirm
  292. style="margin-left: 10px;"
  293. title="确定删除吗?"
  294. @onConfirm="handleDelete(scope.row.id)"
  295. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  296. <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
  297. </el-popconfirm>
  298. </template>
  299. </el-table-column>
  300. </el-table>
  301. </div>
  302. </div>
  303. <div class="pagination clearfix">
  304. <div class="fr">
  305. <el-pagination
  306. @size-change="handleSizeChange"
  307. @current-change="handleCurrentChange"
  308. :current-page="currentPage"
  309. :page-sizes="[10, 20, 30, 50]"
  310. :page-size="10"
  311. layout="total, sizes, prev, pager, next, jumper"
  312. :total="listTotal">
  313. </el-pagination>
  314. </div>
  315. </div>
  316. </div>
  317. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  318. <ApplyDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  319. <ApplyExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  320. <ApplyForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  321. <ApplyReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" :isShow="isShow"/>
  322. </div>
  323. </template>
  324. <script>
  325. import { getApplyList, submitApply, deleteApply, abandonApply, examineBatchApply } from "@/api/supply/apply";
  326. import {getCategoryList, getSalesmanList} from '@/api/common'
  327. import ApplyDetail from "@/views/supply/apply/components/apply_detail";
  328. import ApplyExamine from "@/views/supply/apply/components/apply_examine";
  329. import ApplyForm from "@/views/supply/apply/components/apply_form";
  330. import ApplyReturnForm from "@/views/supply/apply/components/apply_return_form";
  331. import ExamineDialog from "@/components/Common/examine-dialog";
  332. let that
  333. export default {
  334. components: {
  335. ApplyDetail,
  336. ApplyExamine,
  337. ApplyForm,
  338. ApplyReturnForm,
  339. ExamineDialog,
  340. },
  341. filters: {
  342. statusFilter(val) {
  343. let obj = that.statusList.find(o => o.value == val);
  344. return obj ? obj.label : ''
  345. },
  346. orderTypeFilter(val) {
  347. let obj = that.orderTypeList.find(o => o.value == val);
  348. return obj ? obj.label : ''
  349. },
  350. },
  351. data() {
  352. return {
  353. currentPage: 1, // 当前页码
  354. pageSize: 10, // 每页数量
  355. listTotal: 0, // 列表总数
  356. dataList: null, // 列表数据
  357. listLoading: false, // 列表加载loading
  358. screenForm: { // 筛选表单数据
  359. status: '',
  360. orderNum: '',
  361. warehouse: '',
  362. jxsNum: '',
  363. jxsName: '',
  364. date: '',
  365. chName: '',
  366. model: '',
  367. salesMan: '',
  368. orderType: '',
  369. mainOrderId: '',
  370. k3ServiceId:'',
  371. serviceId:'',
  372. categoryId: ''
  373. },
  374. statusList: [
  375. { label: '已保存', value: 'SAVE' },
  376. { label: '待审核', value: 'WAIT' },
  377. { label: '审核通过', value: 'OK' },
  378. // // { label: '审核驳回', value: 'FAIL' },,
  379. { label: '已关闭', value: 'CLOSE' },
  380. ],
  381. orderTypeList: [
  382. { label: '发货申请单', value: 1 },
  383. { label: '退货申请单', value: 2 },
  384. { label: '直调发货单', value: 3 },
  385. ],
  386. salesmanList: [],
  387. queryItem: {},
  388. isShowDetail: false,
  389. isShowExamine: false,
  390. isShowForm: false,
  391. isShowReturnForm: false,
  392. selectRow: [],
  393. multipleSelection: [],
  394. isShowExamineDialog: false,
  395. examineForm: {
  396. status: '',
  397. remark: '',
  398. },
  399. categoryList: []
  400. }
  401. },
  402. computed: {
  403. exParams() {
  404. return {
  405. id: this.screenForm.orderNum,
  406. correspondName: this.screenForm.warehouse,
  407. customerNumber: this.screenForm.jxsNum,
  408. customerName: this.screenForm.jxsName,
  409. productName: this.screenForm.chName,
  410. specification: this.screenForm.model,
  411. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  412. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  413. examineStatus: this.screenForm.status,
  414. k3ServiceId:this.screenForm.k3ServiceId,
  415. serviceId:this.screenForm.serviceId,
  416. type: this.screenForm.orderType,
  417. mainOrderId: this.screenForm.mainOrderId,
  418. categoryId: this.screenForm.categoryId
  419. }
  420. },
  421. },
  422. watch: {
  423. multipleSelection(data) { // 监听选中状态
  424. this.selectRow = []
  425. if (data.length > 0) {
  426. data.forEach((item, index) => {
  427. this.selectRow.push(item.id)
  428. })
  429. }
  430. }
  431. },
  432. beforeCreate() {
  433. that = this;
  434. },
  435. created() {
  436. this.getSalesmanList();
  437. this.getList();
  438. this.getCategoryList();
  439. },
  440. activated() {
  441. this.isShow = false
  442. if (this.$route.query && this.$route.query.isShow) {
  443. this.isShow = this.$route.query.isShow
  444. this.toReturnForm()
  445. }
  446. },
  447. methods: {
  448. // 获取业务员列表
  449. getSalesmanList() {
  450. getSalesmanList({
  451. pageNum: 1,
  452. pageSize: -1,
  453. isCustomer: 0,
  454. status: true,
  455. }).then(res => {
  456. this.salesmanList = res.data.records;
  457. })
  458. },
  459. // 查询列表
  460. getList() {
  461. this.listLoading = true;
  462. let params = {
  463. pageNum: this.currentPage,
  464. pageSize: this.pageSize,
  465. id: this.screenForm.orderNum,
  466. correspondName: this.screenForm.warehouse,
  467. customerNumber: this.screenForm.jxsNum,
  468. customerName: this.screenForm.jxsName,
  469. productName: this.screenForm.chName,
  470. specification: this.screenForm.model,
  471. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  472. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  473. examineStatus: this.screenForm.status,
  474. serviceId: this.screenForm.salesMan,
  475. type: this.screenForm.orderType,
  476. k3ServiceId:this.screenForm.k3ServiceId,
  477. mainOrderId: this.screenForm.mainOrderId,
  478. categoryId: this.screenForm.categoryId
  479. };
  480. getApplyList(params).then((res) => {
  481. res.data.records.forEach(item => {
  482. item.sums1 = ['refundableQty', 'retiredQty'];
  483. item.sums2 = ['singlePayPrice', 'payAmount', 'payRebateAmount', 'totalDiscAmount'];
  484. })
  485. this.dataList = res.data.records;
  486. this.listTotal = res.data.total;
  487. this.listLoading = false;
  488. })
  489. },
  490. // 提交筛选表单
  491. submitScreenForm() {
  492. this.currentPage = 1;
  493. this.getList();
  494. },
  495. // 重置筛选表单
  496. resetScreenForm() {
  497. this.$refs.screenForm.resetFields();
  498. this.currentPage = 1;
  499. this.getList();
  500. },
  501. // 更改每页数量
  502. handleSizeChange(val) {
  503. this.pageSize = val;
  504. this.currentPage = 1;
  505. this.getList();
  506. },
  507. // 更改当前页
  508. handleCurrentChange(val) {
  509. this.currentPage = val;
  510. this.getList();
  511. },
  512. // 进入表单
  513. toForm(item) {
  514. this.queryItem = item;
  515. this.isShowForm = true;
  516. },
  517. // 进入表单
  518. toReturnForm(item) {
  519. this.queryItem = item;
  520. this.isShowReturnForm = true;
  521. },
  522. // 进入审批
  523. toExamine(item) {
  524. this.queryItem = item;
  525. this.isShowExamine = true;
  526. },
  527. // 进入详情
  528. toDetail(item) {
  529. this.queryItem = item;
  530. this.isShowDetail = true;
  531. },
  532. backList() {
  533. this.queryItem = {};
  534. this.isShowDetail = false;
  535. this.isShowExamine = false;
  536. this.isShowForm = false;
  537. this.isShowReturnForm = false;
  538. },
  539. handleDelete(id) {
  540. deleteApply({id}).then(res => {
  541. this.$successMsg();
  542. this.getList();
  543. })
  544. },
  545. // 申请/撤回
  546. handleSubmit(id, examineStatus) {
  547. submitApply({id, examineStatus}).then(res => {
  548. this.$successMsg();
  549. this.getList();
  550. })
  551. },
  552. // 弃审
  553. handleAbandon(id) {
  554. abandonApply({id}).then(res => {
  555. this.$successMsg();
  556. this.getList();
  557. })
  558. },
  559. handleSelectionChange(val) {
  560. this.multipleSelection = val;
  561. if(val) {
  562. this.selections = val;
  563. }else {
  564. this.selections = [];
  565. }
  566. },
  567. rowClass({ row, rowIndex }) {
  568. if (this.selectRow.includes(row.id)) {
  569. return { 'background-color': '#ecf5ff' }
  570. }
  571. },
  572. // 打开 批量审批
  573. batchExamine() {
  574. this.isShowExamineDialog = true;
  575. },
  576. // 提交 批量审批
  577. submitExamineForm() {
  578. let ids = this.multipleSelection.map(item => {
  579. return item.id;
  580. });
  581. ids = Array.from(new Set(ids));
  582. examineBatchApply({
  583. ids: ids.join(','),
  584. examineStatus: this.examineForm.status,
  585. approvalRemark: this.examineForm.remark,
  586. }).then(res => {
  587. this.isShowExamineDialog = false;
  588. this.getList();
  589. this.$successMsg('审批成功');
  590. })
  591. },
  592. // 获取存货类别列表
  593. getCategoryList() {
  594. getCategoryList({
  595. pageNum: 1,
  596. pageSize: -1
  597. }).then(res => {
  598. this.categoryList = res.data.records
  599. })
  600. },
  601. }
  602. }
  603. </script>
  604. <style lang="scss" scoped>
  605. </style>