engin_list.vue 23 KB

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