engin_list.vue 19 KB

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