engin_list.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine">
  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-checkbox-group v-model="screenForm.status" @change="getList()">
  11. <el-checkbox-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-checkbox-button>
  12. </el-checkbox-group>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="12" :lg="6">
  16. <el-form-item label="工程信息单号" prop="orderNum">
  17. <el-input v-model="screenForm.orderNum" placeholder="请输入工程信息单号"></el-input>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="24" :sm="12" :lg="6">
  21. <el-form-item label="工程编码" prop="enginNum">
  22. <el-input v-model="screenForm.enginNum" placeholder="请输入工程编码"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :xs="24" :sm="12" :lg="6">
  26. <el-form-item label="工程登录编号" prop="loginNum">
  27. <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录编号"></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="项目名称" prop="enginName">
  32. <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="单据日期" prop="date">
  37. <el-date-picker
  38. v-model="screenForm.date"
  39. type="datetimerange"
  40. range-separator="至"
  41. style="width: 100%;"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期">
  45. </el-date-picker>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :xs="24" :sm="12" :lg="6">
  49. <el-form-item label="经销商" prop="dealer">
  50. <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :xs="24" :sm="12" :lg="6">
  54. <el-form-item label="使用单位" prop="company">
  55. <el-input v-model="screenForm.company" placeholder="请输入使用单位"></el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="12" :lg="6">
  59. <el-form-item label="制表人" prop="createMan">
  60. <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :xs="24" :sm="12" :lg="6">
  64. <el-form-item label="审核人" prop="examineMan">
  65. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :xs="24" :sm="12" :lg="6">
  69. <el-form-item label="业务员" prop="salesMan">
  70. <el-select v-model="screenForm.salesMan" placeholder="选择业务员" clearable filterable style="width: 100%">
  71. <el-option
  72. v-for="item in salesmanList"
  73. :key="item.adminUserId"
  74. :label="item.nickName"
  75. :value="item.adminUserId">
  76. </el-option>
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :xs="24" :sm="12" :lg="6">
  81. <el-form-item label="规格型号" prop="model">
  82. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  83. </el-form-item>
  84. </el-col>
  85. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  86. <el-form-item label="">
  87. <el-button @click="resetScreenForm">清空</el-button>
  88. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-form>
  93. </div>
  94. <div class="mymain-container">
  95. <div class="btn-group clearfix">
  96. <div class="fl">
  97. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
  98. </div>
  99. <div class="fr">
  100. <ExportButton :exUrl="'engin-info-order/export'" :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. show-summary
  113. :summary-method="$getSummaries">
  114. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. {{scope.row.examineStatus | statusFilter}}
  117. </template>
  118. </el-table-column>
  119. <el-table-column align="left" label="工程信息单号" prop="enginInfoNo" min-width="150" show-overflow-tooltip>
  120. <template slot-scope="scope">
  121. <CopyButton :copyText="scope.row.enginInfoNo" />
  122. <span>{{scope.row.enginInfoNo}}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column align="left" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
  126. <template slot-scope="scope">
  127. <div>
  128. <span>{{scope.row.orderDate | dateToDayFilter}}</span>
  129. <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  134. <template slot-scope="scope">
  135. <CopyButton :copyText="scope.row.customerNumber" />
  136. <span>{{scope.row.customerNumber}}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. <CopyButton :copyText="scope.row.customerName" />
  142. <span>{{scope.row.customerName}}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column align="left" label="项目名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
  146. <el-table-column align="left" label="使用单位" prop="useUnit" min-width="160" show-overflow-tooltip></el-table-column>
  147. <el-table-column align="left" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip></el-table-column>
  148. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  149. <template slot-scope="scope">
  150. <CopyButton :copyText="scope.row.materialNumber" />
  151. <span>{{scope.row.materialNumber}}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. <CopyButton :copyText="scope.row.materialOldNumber" />
  157. <span>{{scope.row.materialOldNumber}}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  161. <template slot-scope="scope">
  162. <CopyButton :copyText="scope.row.materialName" />
  163. <span>{{scope.row.materialName}}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  167. <template slot-scope="scope">
  168. <CopyButton :copyText="scope.row.specification" />
  169. <span>{{scope.row.specification}}</span>
  170. </template>
  171. </el-table-column>
  172. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  173. <el-table-column align="left" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  174. <template slot-scope="scope">
  175. {{scope.row.price | numToFixed}}
  176. </template>
  177. </el-table-column>
  178. <el-table-column align="right" label="数量" prop="qty" min-width="100" sortable show-overflow-tooltip></el-table-column>
  179. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" sortable show-overflow-tooltip>
  180. <template slot-scope="scope">
  181. {{scope.row.totalAmount | numToFixed}}
  182. </template>
  183. </el-table-column>
  184. <el-table-column align="left" label="已订数量" prop="hasOrderQty" min-width="100" show-overflow-tooltip></el-table-column>
  185. <!-- <el-table-column align="left" label="表体业务员" prop="itemServiceName" min-width="100" show-overflow-tooltip></el-table-column> -->
  186. <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  187. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  188. <el-table-column align="left" label="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  189. <el-table-column align="left" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  190. <el-table-column align="left" label="审核人" prop="confirmBy" min-width="100" show-overflow-tooltip></el-table-column>
  191. <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  192. <el-table-column align="center" label="操作" width="210" fixed="right">
  193. <template slot-scope="scope">
  194. <el-popconfirm
  195. style="margin-right: 10px;"
  196. title="确定申请吗?"
  197. @onConfirm="handleSubmit(scope.row.enginInfoId)"
  198. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  199. <el-button slot="reference" type="text">申请</el-button>
  200. </el-popconfirm>
  201. <el-popconfirm
  202. style="margin-right: 10px;"
  203. title="确定撤回吗?"
  204. @onConfirm="handleWithdraw(scope.row.enginInfoId)"
  205. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  206. <el-button slot="reference" type="text">撤回</el-button>
  207. </el-popconfirm>
  208. <el-popconfirm
  209. style="margin-right: 10px;"
  210. title="确定弃审吗?"
  211. @onConfirm="handleAbandon(scope.row.enginInfoId)"
  212. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  213. <el-button slot="reference" type="text">弃审</el-button>
  214. </el-popconfirm>
  215. <el-button
  216. type="text"
  217. @click="toForm(scope.row)"
  218. v-if="$checkBtnRole('edit', $route.meta.roles) && (!isDealer || (isDealer && scope.row.examineStatus === 'SAVE'))">
  219. 编辑
  220. </el-button>
  221. <el-button
  222. type="text"
  223. @click="toExamine(scope.row)"
  224. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
  225. 审批
  226. </el-button>
  227. <el-button
  228. type="text"
  229. @click="toDetail(scope.row)">
  230. 详情
  231. </el-button>
  232. <el-popconfirm
  233. style="margin-left: 10px;"
  234. title="确定删除吗?"
  235. @onConfirm="handleDelete(scope.row.enginInfoId)"
  236. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  237. <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
  238. </el-popconfirm>
  239. </template>
  240. </el-table-column>
  241. </el-table>
  242. </div>
  243. </div>
  244. <div class="pagination clearfix">
  245. <div class="fr">
  246. <el-pagination
  247. @size-change="handleSizeChange"
  248. @current-change="handleCurrentChange"
  249. :current-page="currentPage"
  250. :page-sizes="[10, 20, 30, 50]"
  251. :page-size="10"
  252. layout="total, sizes, prev, pager, next, jumper"
  253. :total="listTotal">
  254. </el-pagination>
  255. </div>
  256. </div>
  257. </div>
  258. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  259. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  260. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  261. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  262. </div>
  263. </template>
  264. <script>
  265. import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin, abandonEngin } from "@/api/supply/engin";
  266. import { getSalesmanList } from '@/api/common'
  267. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  268. import EnginForm from "@/views/supply/engin/components/engin_form";
  269. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  270. import EditDateDialog from "@/components/Common/edit-date-dialog";
  271. let that
  272. export default {
  273. components: {
  274. EnginDetail,
  275. EnginForm,
  276. EnginExamine,
  277. EditDateDialog,
  278. },
  279. filters: {
  280. statusFilter(val) {
  281. let obj = that.statusList.find(o => o.value == val);
  282. return obj ? obj.label : ''
  283. }
  284. },
  285. data() {
  286. return {
  287. currentPage: 1, // 当前页码
  288. pageSize: 10, // 每页数量
  289. listTotal: 0, // 列表总数
  290. dataList: null, // 列表数据
  291. listLoading: false, // 列表加载loading
  292. screenForm: { // 筛选表单数据
  293. orderNum: '',
  294. enginNum: '',
  295. loginNum: '',
  296. enginName: '',
  297. date: '',
  298. dealer: '',
  299. company: '',
  300. createMan: '',
  301. examineMan: '',
  302. status: [],
  303. salesMan: '',
  304. model: '',
  305. },
  306. statusList: [
  307. { label: '已保存', value: 'SAVE' },
  308. { label: '待审核', value: 'WAIT' },
  309. { label: '审核通过', value: 'OK' },
  310. // { label: '审核驳回', value: 'FAIL' },
  311. { label: '已关闭', value: 'CLOSE' },
  312. ],
  313. salesmanList: [],
  314. queryItem: {},
  315. isShowDetail: false,
  316. isShowForm: false,
  317. isShowExamine: false,
  318. editId: null,
  319. isShowEditDateDialog: false,
  320. dateForm: {
  321. date: '',
  322. },
  323. }
  324. },
  325. computed: {
  326. isDealer() {
  327. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  328. },
  329. exParams() {
  330. return {
  331. enginInfoNo: this.screenForm.orderNum,
  332. projectNo: this.screenForm.enginNum,
  333. enginSignType: this.screenForm.loginNum,
  334. projectName: this.screenForm.enginName,
  335. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  336. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  337. customerKeyWord: this.screenForm.dealer,
  338. useUnit: this.screenForm.company,
  339. createName: this.screenForm.createMan,
  340. confirmName: this.screenForm.examineMan,
  341. examineStatus: this.screenForm.status.join(','),
  342. serviceId: this.screenForm.salesMan,
  343. specification: this.screenForm.model,
  344. }
  345. },
  346. },
  347. beforeCreate() {
  348. that = this;
  349. },
  350. created() {
  351. this.getSalesmanList();
  352. this.getList();
  353. },
  354. methods: {
  355. // 获取业务员列表
  356. getSalesmanList() {
  357. getSalesmanList({
  358. pageNum: 1,
  359. pageSize: -1,
  360. isCustomer: 0,
  361. status: true,
  362. }).then(res => {
  363. this.salesmanList = res.data.records;
  364. })
  365. },
  366. // 查询列表
  367. getList() {
  368. this.listLoading = true;
  369. let params = {
  370. pageNum: this.currentPage,
  371. pageSize: this.pageSize,
  372. enginInfoNo: this.screenForm.orderNum,
  373. projectNo: this.screenForm.enginNum,
  374. enginSignType: this.screenForm.loginNum,
  375. projectName: this.screenForm.enginName,
  376. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  377. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  378. customerKeyword: this.screenForm.dealer,
  379. useUnit: this.screenForm.company,
  380. createName: this.screenForm.createMan,
  381. confirmName: this.screenForm.examineMan,
  382. examineStatus: this.screenForm.status.join(','),
  383. serviceId: this.screenForm.salesMan,
  384. specification: this.screenForm.model,
  385. };
  386. getEnginList(params).then((res) => {
  387. res.data.records.forEach(item => {
  388. item.sums1 = ['qty'];
  389. item.sums2 = ['totalAmount'];
  390. })
  391. this.dataList = res.data.records;
  392. this.listTotal = res.data.total;
  393. this.listLoading = false;
  394. })
  395. },
  396. // 提交筛选表单
  397. submitScreenForm() {
  398. this.currentPage = 1;
  399. this.getList();
  400. },
  401. // 重置筛选表单
  402. resetScreenForm() {
  403. this.$refs.screenForm.resetFields();
  404. this.currentPage = 1;
  405. this.getList();
  406. },
  407. // 更改每页数量
  408. handleSizeChange(val) {
  409. this.pageSize = val;
  410. this.currentPage = 1;
  411. this.getList();
  412. },
  413. // 更改当前页
  414. handleCurrentChange(val) {
  415. this.currentPage = val;
  416. this.getList();
  417. },
  418. // 进入表单
  419. toForm(item) {
  420. this.queryItem = item;
  421. this.isShowForm = true;
  422. },
  423. // 进入审批
  424. toExamine(item) {
  425. this.queryItem = item;
  426. this.isShowExamine = true;
  427. },
  428. // 进入详情
  429. toDetail(item) {
  430. this.queryItem = item;
  431. this.isShowDetail = true;
  432. },
  433. backList() {
  434. this.queryItem = {};
  435. this.isShowDetail = false;
  436. this.isShowForm = false;
  437. this.isShowExamine = false;
  438. },
  439. // 申请
  440. handleSubmit(id) {
  441. applyEngin({id}).then(res => {
  442. this.$successMsg();
  443. this.getList();
  444. })
  445. },
  446. // 撤回
  447. handleWithdraw(id) {
  448. withdrawEngin({id}).then(res => {
  449. this.$successMsg();
  450. this.getList();
  451. })
  452. },
  453. // 弃审
  454. handleAbandon(id) {
  455. abandonEngin({id}).then(res => {
  456. this.$successMsg();
  457. this.getList();
  458. })
  459. },
  460. // 删除
  461. handleDelete(id) {
  462. deleteEngin({ids: id}).then(res => {
  463. this.$successMsg();
  464. this.getList();
  465. })
  466. },
  467. // 打开 修改订单日期
  468. editDate(item) {
  469. this.editId = item.enginInfoId;
  470. this.dateForm.date = item.orderDate.slice(0, 10);
  471. this.isShowEditDateDialog = true;
  472. },
  473. // 提交 修改订单日期
  474. submitDateForm() {
  475. editDateEngin({
  476. enginInfoId: this.editId,
  477. orderDate: this.dateForm.date + ' 00:00:00',
  478. }).then(res => {
  479. this.isShowEditDateDialog = false;
  480. this.getList();
  481. this.$successMsg('修改成功');
  482. })
  483. },
  484. }
  485. }
  486. </script>
  487. <style lang="scss" scoped>
  488. </style>