engin_list.vue 20 KB

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