engin_list.vue 16 KB

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