engin_list.vue 28 KB

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