engin_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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="200" 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="right" label="数量" prop="qty" min-width="100" sortable show-overflow-tooltip></el-table-column>
  174. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" sortable show-overflow-tooltip>
  175. <template slot-scope="scope">
  176. {{scope.row.totalAmount | numToFixed}}
  177. </template>
  178. </el-table-column>
  179. <el-table-column align="left" label="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  180. <el-table-column align="left" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  181. <el-table-column align="left" label="审核人" prop="confirmBy" min-width="100" show-overflow-tooltip></el-table-column>
  182. <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  183. <el-table-column align="center" label="操作" width="210" fixed="right">
  184. <template slot-scope="scope">
  185. <el-popconfirm
  186. style="margin-right: 10px;"
  187. title="确定申请吗?"
  188. @onConfirm="handleSubmit(scope.row.enginInfoId)"
  189. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  190. <el-button slot="reference" type="text">申请</el-button>
  191. </el-popconfirm>
  192. <el-popconfirm
  193. style="margin-right: 10px;"
  194. title="确定撤回吗?"
  195. @onConfirm="handleWithdraw(scope.row.enginInfoId)"
  196. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  197. <el-button slot="reference" type="text">撤回</el-button>
  198. </el-popconfirm>
  199. <el-popconfirm
  200. style="margin-right: 10px;"
  201. title="确定弃审吗?"
  202. @onConfirm="handleAbandon(scope.row.enginInfoId)"
  203. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  204. <el-button slot="reference" type="text">弃审</el-button>
  205. </el-popconfirm>
  206. <el-button
  207. type="text"
  208. @click="toForm(scope.row)"
  209. v-if="$checkBtnRole('edit', $route.meta.roles)">
  210. 编辑
  211. </el-button>
  212. <el-button
  213. type="text"
  214. @click="toExamine(scope.row)"
  215. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
  216. 审批
  217. </el-button>
  218. <el-button
  219. type="text"
  220. @click="toDetail(scope.row)">
  221. 详情
  222. </el-button>
  223. <el-popconfirm
  224. style="margin-left: 10px;"
  225. title="确定删除吗?"
  226. @onConfirm="handleDelete(scope.row.enginInfoId)"
  227. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  228. <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
  229. </el-popconfirm>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. </div>
  234. </div>
  235. <div class="pagination clearfix">
  236. <div class="fr">
  237. <el-pagination
  238. @size-change="handleSizeChange"
  239. @current-change="handleCurrentChange"
  240. :current-page="currentPage"
  241. :page-sizes="[10, 20, 30, 50]"
  242. :page-size="10"
  243. layout="total, sizes, prev, pager, next, jumper"
  244. :total="listTotal">
  245. </el-pagination>
  246. </div>
  247. </div>
  248. </div>
  249. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  250. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  251. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  252. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  253. </div>
  254. </template>
  255. <script>
  256. import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin, abandonEngin } from "@/api/supply/engin";
  257. import { getSalesmanList } from '@/api/common'
  258. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  259. import EnginForm from "@/views/supply/engin/components/engin_form";
  260. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  261. import EditDateDialog from "@/components/Common/edit-date-dialog";
  262. let that
  263. export default {
  264. components: {
  265. EnginDetail,
  266. EnginForm,
  267. EnginExamine,
  268. EditDateDialog,
  269. },
  270. filters: {
  271. statusFilter(val) {
  272. let obj = that.statusList.find(o => o.value == val);
  273. return obj ? obj.label : ''
  274. }
  275. },
  276. data() {
  277. return {
  278. currentPage: 1, // 当前页码
  279. pageSize: 10, // 每页数量
  280. listTotal: 0, // 列表总数
  281. dataList: null, // 列表数据
  282. listLoading: false, // 列表加载loading
  283. screenForm: { // 筛选表单数据
  284. orderNum: '',
  285. enginNum: '',
  286. loginNum: '',
  287. enginName: '',
  288. date: '',
  289. dealer: '',
  290. company: '',
  291. createMan: '',
  292. examineMan: '',
  293. status: [],
  294. salesMan: '',
  295. model: '',
  296. },
  297. statusList: [
  298. { label: '已保存', value: 'SAVE' },
  299. { label: '待审核', value: 'WAIT' },
  300. { label: '审核通过', value: 'OK' },
  301. { label: '审核驳回', value: 'FAIL' },
  302. { label: '已关闭', value: 'CLOSE' },
  303. ],
  304. salesmanList: [],
  305. queryItem: {},
  306. isShowDetail: false,
  307. isShowForm: false,
  308. isShowExamine: false,
  309. editId: null,
  310. isShowEditDateDialog: false,
  311. dateForm: {
  312. date: '',
  313. },
  314. }
  315. },
  316. computed: {
  317. exParams() {
  318. return {
  319. enginInfoNo: this.screenForm.orderNum,
  320. projectNo: this.screenForm.enginNum,
  321. enginSignType: this.screenForm.loginNum,
  322. projectName: this.screenForm.enginName,
  323. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  324. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  325. customerKeyWord: this.screenForm.dealer,
  326. useUnit: this.screenForm.company,
  327. createName: this.screenForm.createMan,
  328. confirmName: this.screenForm.examineMan,
  329. examineStatus: this.screenForm.status.join(','),
  330. serviceId: this.screenForm.salesMan,
  331. specification: this.screenForm.model,
  332. }
  333. },
  334. },
  335. beforeCreate() {
  336. that = this;
  337. },
  338. created() {
  339. this.getSalesmanList();
  340. this.getList();
  341. },
  342. methods: {
  343. // 获取业务员列表
  344. getSalesmanList() {
  345. getSalesmanList({
  346. pageNum: 1,
  347. pageSize: -1,
  348. isCustomer: 0,
  349. status: true,
  350. }).then(res => {
  351. this.salesmanList = res.data.records;
  352. })
  353. },
  354. // 查询列表
  355. getList() {
  356. this.listLoading = true;
  357. let params = {
  358. pageNum: this.currentPage,
  359. pageSize: this.pageSize,
  360. enginInfoNo: this.screenForm.orderNum,
  361. projectNo: this.screenForm.enginNum,
  362. enginSignType: this.screenForm.loginNum,
  363. projectName: this.screenForm.enginName,
  364. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  365. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  366. customerKeyword: this.screenForm.dealer,
  367. useUnit: this.screenForm.company,
  368. createName: this.screenForm.createMan,
  369. confirmName: this.screenForm.examineMan,
  370. examineStatus: this.screenForm.status.join(','),
  371. serviceId: this.screenForm.salesMan,
  372. specification: this.screenForm.model,
  373. };
  374. getEnginList(params).then((res) => {
  375. res.data.records.forEach(item => {
  376. item.sums1 = ['qty'];
  377. item.sums2 = ['totalAmount'];
  378. })
  379. this.dataList = res.data.records;
  380. this.listTotal = res.data.total;
  381. this.listLoading = false;
  382. })
  383. },
  384. // 提交筛选表单
  385. submitScreenForm() {
  386. this.currentPage = 1;
  387. this.getList();
  388. },
  389. // 重置筛选表单
  390. resetScreenForm() {
  391. this.$refs.screenForm.resetFields();
  392. this.currentPage = 1;
  393. this.getList();
  394. },
  395. // 更改每页数量
  396. handleSizeChange(val) {
  397. this.pageSize = val;
  398. this.currentPage = 1;
  399. this.getList();
  400. },
  401. // 更改当前页
  402. handleCurrentChange(val) {
  403. this.currentPage = val;
  404. this.getList();
  405. },
  406. // 进入表单
  407. toForm(item) {
  408. this.queryItem = item;
  409. this.isShowForm = true;
  410. },
  411. // 进入审批
  412. toExamine(item) {
  413. this.queryItem = item;
  414. this.isShowExamine = true;
  415. },
  416. // 进入详情
  417. toDetail(item) {
  418. this.queryItem = item;
  419. this.isShowDetail = true;
  420. },
  421. backList() {
  422. this.queryItem = {};
  423. this.isShowDetail = false;
  424. this.isShowForm = false;
  425. this.isShowExamine = false;
  426. },
  427. // 申请
  428. handleSubmit(id) {
  429. applyEngin({id}).then(res => {
  430. this.$successMsg();
  431. this.getList();
  432. })
  433. },
  434. // 撤回
  435. handleWithdraw(id) {
  436. withdrawEngin({id}).then(res => {
  437. this.$successMsg();
  438. this.getList();
  439. })
  440. },
  441. // 弃审
  442. handleAbandon(id) {
  443. abandonEngin({id}).then(res => {
  444. this.$successMsg();
  445. this.getList();
  446. })
  447. },
  448. // 删除
  449. handleDelete(id) {
  450. deleteEngin({ids: id}).then(res => {
  451. this.$successMsg();
  452. this.getList();
  453. })
  454. },
  455. // 打开 修改订单日期
  456. editDate(item) {
  457. this.editId = item.enginInfoId;
  458. this.dateForm.date = item.orderDate.slice(0, 10);
  459. this.isShowEditDateDialog = true;
  460. },
  461. // 提交 修改订单日期
  462. submitDateForm() {
  463. editDateEngin({
  464. enginInfoId: this.editId,
  465. orderDate: this.dateForm.date + ' 00:00:00',
  466. }).then(res => {
  467. this.isShowEditDateDialog = false;
  468. this.getList();
  469. this.$successMsg('修改成功');
  470. })
  471. },
  472. }
  473. }
  474. </script>
  475. <style lang="scss" scoped>
  476. </style>