engin_list.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  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="salesMan">
  61. <el-select v-model="screenForm.salesMan" placeholder="选择业务员" 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="orderType">
  73. <el-select v-model="screenForm.orderType" placeholder="请选择" clearable>
  74. <el-option
  75. v-for="item in orderTypeList"
  76. :key="item.value"
  77. :label="item.label"
  78. :value="item.value">
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  84. <el-form-item label="">
  85. <el-button @click="resetScreenForm">清空</el-button>
  86. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. </el-form>
  91. </div>
  92. <div class="mymain-container">
  93. <div class="btn-group clearfix">
  94. <div class="fl">
  95. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
  96. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('add', $route.meta.roles)">退货申请</el-button>
  97. <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>
  98. </div>
  99. <div class="fr">
  100. <ExportButton :exUrl="'invoice/listProjectExport'" :exParams="exParams" />
  101. </div>
  102. </div>
  103. <div class="table">
  104. <el-table
  105. v-loading="listLoading"
  106. :data="dataList"
  107. element-loading-text="Loading"
  108. border
  109. fit
  110. highlight-current-row
  111. stripe
  112. @selection-change="handleSelectionChange"
  113. show-summary
  114. :summary-method="$getSummaries">
  115. <el-table-column align="center" type="selection" width="55"></el-table-column>
  116. <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
  117. <template slot-scope="scope">
  118. {{scope.row.type | orderTypeFilter}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="left" label="发货申请单" prop="id" min-width="120" show-overflow-tooltip>
  122. <template slot-scope="scope">
  123. <CopyButton :copyText="scope.row.id" />
  124. <span>{{scope.row.id}}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="left" label="发货申请日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  128. <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip>
  129. <template slot-scope="scope">
  130. {{scope.row.type === 3 ? scope.row.stockName : scope.row.correspondName}}
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="left" label="订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  134. <template slot-scope="scope">
  135. <CopyButton :copyText="scope.row.enginOrderNo" />
  136. <span>{{scope.row.enginOrderNo}}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="left" label="工程登录编码" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. <CopyButton :copyText="scope.row.refEnginRecordNo" />
  142. <span>{{scope.row.refEnginRecordNo}}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column align="left" label="工程名称" prop="refProjectName" min-width="120" show-overflow-tooltip></el-table-column>
  146. <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="120" show-overflow-tooltip></el-table-column>
  147. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  148. <template slot-scope="scope">
  149. <CopyButton :copyText="scope.row.customerNumber" />
  150. <span>{{scope.row.customerNumber}}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  154. <template slot-scope="scope">
  155. <CopyButton :copyText="scope.row.customerName" />
  156. <span>{{scope.row.customerName}}</span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  160. <template slot-scope="scope">
  161. <CopyButton :copyText="scope.row.materialCode" />
  162. <span>{{scope.row.materialCode}}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  166. <template slot-scope="scope">
  167. <CopyButton :copyText="scope.row.materialOldNumber" />
  168. <span>{{scope.row.materialOldNumber}}</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  172. <template slot-scope="scope">
  173. <CopyButton :copyText="scope.row.materialName" />
  174. <span>{{scope.row.materialName}}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  178. <template slot-scope="scope">
  179. <CopyButton :copyText="scope.row.specification" />
  180. <span>{{scope.row.specification}}</span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  184. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  185. <template slot-scope="scope">
  186. {{scope.row.payAmount | numToFixed}}
  187. </template>
  188. </el-table-column>
  189. <el-table-column align="right" label="返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  190. <template slot-scope="scope">
  191. {{scope.row.payRebateAmount | numToFixed}}
  192. </template>
  193. </el-table-column>
  194. <el-table-column align="right" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
  195. <template slot-scope="scope">
  196. {{scope.row.totalDiscAmount | numToFixed}}
  197. </template>
  198. </el-table-column>
  199. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  200. <el-table-column align="left" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  201. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  202. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  203. <el-table-column align="left" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
  204. <el-table-column align="left" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
  205. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  206. <template slot-scope="scope">
  207. {{scope.row.examineStatus | statusFilter}}
  208. </template>
  209. </el-table-column>
  210. <el-table-column align="center" label="操作" width="180" fixed="right">
  211. <template slot-scope="scope">
  212. <el-popconfirm
  213. style="margin-right: 10px;"
  214. title="确定申请吗?"
  215. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  216. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  217. <el-button slot="reference" type="text">申请</el-button>
  218. </el-popconfirm>
  219. <el-popconfirm
  220. style="margin-right: 10px;"
  221. title="确定撤回吗?"
  222. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  223. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  224. <el-button slot="reference" type="text">撤回</el-button>
  225. </el-popconfirm>
  226. <el-popconfirm
  227. style="margin-right: 10px;"
  228. title="确定弃审吗?"
  229. @onConfirm="handleAbandon(scope.row.id)"
  230. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  231. <el-button slot="reference" type="text">弃审</el-button>
  232. </el-popconfirm>
  233. <el-button
  234. type="text"
  235. @click="toForm(scope.row)"
  236. v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 1">
  237. 编辑
  238. </el-button>
  239. <el-button
  240. type="text"
  241. @click="toReturnForm(scope.row)"
  242. v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 2">
  243. 编辑
  244. </el-button>
  245. <el-button
  246. type="text"
  247. @click="toExamine(scope.row)"
  248. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
  249. 审单
  250. </el-button>
  251. <el-button
  252. type="text"
  253. @click="toDetail(scope.row)">
  254. 详情
  255. </el-button>
  256. <el-popconfirm
  257. style="margin-left: 10px;"
  258. title="确定删除吗?"
  259. @onConfirm="handleDelete(scope.row.id)"
  260. v-if="$checkBtnRole('del', $route.meta.roles)">
  261. <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
  262. </el-popconfirm>
  263. </template>
  264. </el-table-column>
  265. </el-table>
  266. </div>
  267. </div>
  268. <div class="pagination clearfix">
  269. <div class="fr">
  270. <el-pagination
  271. @size-change="handleSizeChange"
  272. @current-change="handleCurrentChange"
  273. :current-page="currentPage"
  274. :page-sizes="[10, 20, 30, 50]"
  275. :page-size="10"
  276. layout="total, sizes, prev, pager, next, jumper"
  277. :total="listTotal">
  278. </el-pagination>
  279. </div>
  280. </div>
  281. </div>
  282. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  283. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  284. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  285. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  286. <EnginReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" />
  287. </div>
  288. </template>
  289. <script>
  290. import { getEnginList, submitEngin, deleteEngin, abandonEngin, examineBatchEngin } from "@/api/supply/apply";
  291. import { getSalesmanList } from '@/api/common'
  292. import EnginDetail from "@/views/supply/apply/components/engin_detail";
  293. import EnginExamine from "@/views/supply/apply/components/engin_examine";
  294. import EnginForm from "@/views/supply/apply/components/engin_form";
  295. import EnginReturnForm from "@/views/supply/apply/components/engin_return_form";
  296. import ExamineDialog from "@/components/Common/examine-dialog";
  297. let that
  298. export default {
  299. components: {
  300. EnginDetail,
  301. EnginExamine,
  302. EnginForm,
  303. EnginReturnForm,
  304. ExamineDialog,
  305. },
  306. filters: {
  307. statusFilter(val) {
  308. let obj = that.statusList.find(o => o.value == val);
  309. return obj ? obj.label : ''
  310. },
  311. orderTypeFilter(val) {
  312. let obj = that.orderTypeList.find(o => o.value == val);
  313. return obj ? obj.label : ''
  314. },
  315. },
  316. data() {
  317. return {
  318. currentPage: 1, // 当前页码
  319. pageSize: 10, // 每页数量
  320. listTotal: 0, // 列表总数
  321. dataList: null, // 列表数据
  322. listLoading: false, // 列表加载loading
  323. screenForm: { // 筛选表单数据
  324. status: '',
  325. orderNum: '',
  326. warehouse: '',
  327. jxsNum: '',
  328. jxsName: '',
  329. date: '',
  330. chName: '',
  331. model: '',
  332. salesMan: '',
  333. orderType: '',
  334. },
  335. statusList: [
  336. { label: '已保存', value: 'SAVE' },
  337. { label: '待审核', value: 'WAIT' },
  338. { label: '审核通过', value: 'OK' },
  339. { label: '审核驳回', value: 'FAIL' },
  340. { label: '已关闭', value: 'CLOSE' },
  341. ],
  342. orderTypeList: [
  343. { label: '发货申请单', value: 1 },
  344. { label: '退货申请单', value: 2 },
  345. { label: '直调发货单', value: 3 },
  346. ],
  347. salesmanList: [],
  348. queryItem: {},
  349. isShowDetail: false,
  350. isShowExamine: false,
  351. isShowForm: false,
  352. isShowReturnForm: false,
  353. multipleSelection: [],
  354. isShowExamineDialog: false,
  355. examineForm: {
  356. status: '',
  357. remark: '',
  358. },
  359. }
  360. },
  361. computed: {
  362. exParams() {
  363. return {
  364. id: this.screenForm.orderNum,
  365. correspondName: this.screenForm.warehouse,
  366. customerNumber: this.screenForm.jxsNum,
  367. customerName: this.screenForm.jxsName,
  368. productName: this.screenForm.chName,
  369. specification: this.screenForm.model,
  370. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  371. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  372. examineStatus: this.screenForm.status,
  373. serviceId: this.screenForm.salesMan,
  374. type: this.screenForm.orderType,
  375. }
  376. },
  377. },
  378. beforeCreate() {
  379. that = this;
  380. },
  381. created() {
  382. this.getSalesmanList();
  383. this.getList();
  384. },
  385. methods: {
  386. // 获取业务员列表
  387. getSalesmanList() {
  388. getSalesmanList({
  389. pageNum: 1,
  390. pageSize: -1,
  391. isCustomer: 0,
  392. status: true,
  393. }).then(res => {
  394. this.salesmanList = res.data.records;
  395. })
  396. },
  397. // 查询列表
  398. getList() {
  399. this.listLoading = true;
  400. let params = {
  401. pageNum: this.currentPage,
  402. pageSize: this.pageSize,
  403. id: this.screenForm.orderNum,
  404. correspondName: this.screenForm.warehouse,
  405. customerNumber: this.screenForm.jxsNum,
  406. customerName: this.screenForm.jxsName,
  407. productName: this.screenForm.chName,
  408. specification: this.screenForm.model,
  409. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  410. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  411. examineStatus: this.screenForm.status,
  412. serviceId: this.screenForm.salesMan,
  413. type: this.screenForm.orderType,
  414. };
  415. getEnginList(params).then((res) => {
  416. res.data.records.forEach(item => {
  417. item.sums1 = ['refundableQty'];
  418. item.sums2 = ['payAmount', 'payRebateAmount', 'totalDiscAmount'];
  419. })
  420. this.dataList = res.data.records;
  421. this.listTotal = res.data.total;
  422. this.listLoading = false;
  423. })
  424. },
  425. // 提交筛选表单
  426. submitScreenForm() {
  427. this.currentPage = 1;
  428. this.getList();
  429. },
  430. // 重置筛选表单
  431. resetScreenForm() {
  432. this.$refs.screenForm.resetFields();
  433. this.currentPage = 1;
  434. this.getList();
  435. },
  436. // 更改每页数量
  437. handleSizeChange(val) {
  438. this.pageSize = val;
  439. this.currentPage = 1;
  440. this.getList();
  441. },
  442. // 更改当前页
  443. handleCurrentChange(val) {
  444. this.currentPage = val;
  445. this.getList();
  446. },
  447. // 进入表单
  448. toForm(item) {
  449. this.queryItem = item;
  450. this.isShowForm = true;
  451. },
  452. // 进入表单
  453. toReturnForm(item) {
  454. this.queryItem = item;
  455. this.isShowReturnForm = true;
  456. },
  457. // 进入审批
  458. toExamine(item) {
  459. this.queryItem = item;
  460. this.isShowExamine = true;
  461. },
  462. // 进入详情
  463. toDetail(item) {
  464. this.queryItem = item;
  465. this.isShowDetail = true;
  466. },
  467. backList() {
  468. this.queryItem = {};
  469. this.isShowDetail = false;
  470. this.isShowExamine = false;
  471. this.isShowForm = false;
  472. this.isShowReturnForm = false;
  473. },
  474. handleDelete(id) {
  475. deleteEngin({id}).then(res => {
  476. this.$successMsg();
  477. this.getList();
  478. })
  479. },
  480. // 申请/撤回
  481. handleSubmit(id, examineStatus) {
  482. submitEngin({id, examineStatus}).then(res => {
  483. this.$successMsg();
  484. this.getList();
  485. })
  486. },
  487. // 弃审
  488. handleAbandon(id) {
  489. abandonEngin({id}).then(res => {
  490. this.$successMsg();
  491. this.getList();
  492. })
  493. },
  494. handleSelectionChange(val) {
  495. this.multipleSelection = val;
  496. },
  497. // 打开 批量审批
  498. batchExamine() {
  499. this.isShowExamineDialog = true;
  500. },
  501. // 提交 批量审批
  502. submitExamineForm() {
  503. let ids = this.multipleSelection.map(item => {
  504. return item.id;
  505. });
  506. ids = Array.from(new Set(ids));
  507. examineBatchEngin({
  508. ids: ids.join(','),
  509. examineStatus: this.examineForm.status,
  510. approvalRemark: this.examineForm.remark,
  511. }).then(res => {
  512. this.isShowExamineDialog = false;
  513. this.getList();
  514. this.$successMsg('审批成功');
  515. })
  516. },
  517. }
  518. }
  519. </script>
  520. <style lang="scss" scoped>
  521. </style>