index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <template>
  2. <div class="app-conta">
  3. <el-row :gutter="10" class="mb8 roiyy">
  4. <el-col :span="1.5" v-if="setrd % 2 == 1">
  5. <el-button
  6. type="primary"
  7. @click="submitBtn"
  8. v-hasPermi="['bmProject:project:examine']"
  9. >提交</el-button
  10. >
  11. <el-button
  12. type="primary"
  13. @click="submitForm"
  14. v-hasPermi="['system:config:edit']"
  15. >暂存</el-button
  16. >
  17. </el-col>
  18. <el-col :span="1.5">
  19. <el-button
  20. type="primary"
  21. @click="cancel"
  22. v-hasPermi="['system:config:edit']"
  23. >取消</el-button
  24. >
  25. </el-col>
  26. <el-col :span="1.5" :offset="16" v-if="setrd % 2 == 1&&setrd>2">
  27. <el-button
  28. type="danger"
  29. @click="backProBtn"
  30. v-hasPermi="['bmProject:project:back']"
  31. >撤销审核</el-button
  32. >
  33. </el-col>
  34. <el-col :span="1.5" :offset="18" v-if="setrd % 2 == 0">
  35. <el-button
  36. type="danger"
  37. @click="applyBtn"
  38. v-hasPermi="['bmProject:project:pass']"
  39. >审核</el-button
  40. >
  41. <el-button
  42. type="danger"
  43. @click="backBtn"
  44. v-hasPermi="['bmProject:project:reject']"
  45. >驳回</el-button
  46. >
  47. </el-col>
  48. </el-row>
  49. <div class="nauer">
  50. <!-- 投产项目 -->
  51. <div>
  52. <div class="nstruction">
  53. <!-- 内容 -->
  54. <div class="namjeu">
  55. <el-form
  56. :model="form"
  57. :rules="rules"
  58. ref="form"
  59. :inline="true"
  60. label-width="135px"
  61. label-position="center"
  62. class="manager_form"
  63. >
  64. <el-form-item label=" 已完成投资额:" prop="totInvestment">
  65. <el-input
  66. v-model="form.totInvestment"
  67. placeholder="请输入已完成投资额"
  68. clearable
  69. size="small"
  70. :disabled = "disfal"
  71. style="width: 335px"
  72. />
  73. </el-form-item>
  74. <el-form-item label="设备投资额度:" prop="macInvestment">
  75. <el-input
  76. v-model="form.macInvestment"
  77. placeholder="请输入设备投资额度"
  78. clearable
  79. :disabled = "disfal"
  80. size="small"
  81. style="width: 335px"
  82. />
  83. </el-form-item>
  84. <el-form-item label="投产时间:" prop="productDate">
  85. <el-date-picker
  86. type="date"
  87. placeholder="选择日期"
  88. :disabled = "disfal"
  89. v-model="form.productDate"
  90. style="width: 335px"
  91. ></el-date-picker>
  92. </el-form-item>
  93. <el-form-item label="投产图片:" class="maget_ty">
  94. <div class="forieu" style="width: 618px">
  95. <div class="bure burert">
  96. <el-upload
  97. :action="defaultSettings.urls + process+'/common/upload'"
  98. list-type="picture-card"
  99. :on-preview="handlePictureCardPreview"
  100. :on-remove="handleRemove"
  101. :on-success="handleOnsuccess"
  102. :file-list="productPhotoList"
  103. :disabled = "disfal"
  104. >
  105. <i class="el-icon-plus"></i>
  106. <!-- <el-button slot="trigger" size="small" type="primary"
  107. >选取文件</el-button
  108. >
  109. <el-button
  110. style="margin-left: 10px"
  111. size="small"
  112. type="primary"
  113. @click="submitUpload"
  114. >上传到服务器</el-button
  115. > -->
  116. </el-upload>
  117. <el-dialog :visible.sync="dialogVisible">
  118. <img width="100%" :src="dialogImageUrl" alt="" />
  119. </el-dialog>
  120. </div>
  121. </div>
  122. </el-form-item>
  123. <el-form-item> </el-form-item>
  124. <el-form-item label=" 项目入规(限):" prop="isOk">
  125. <el-select
  126. v-model="form.isOk"
  127. placeholder="项目入规(限)"
  128. clearable
  129. size="small"
  130. :disabled = "disfal"
  131. style="width: 335px"
  132. >
  133. <el-option
  134. v-for="dict in typeOptions"
  135. :key="dict.dictValue"
  136. :label="dict.dictLabel"
  137. :value="dict.dictValue"
  138. />
  139. </el-select>
  140. </el-form-item>
  141. <el-form-item label="项目入规时间:" prop="okDate">
  142. <el-date-picker
  143. type="date"
  144. :disabled = "disfal"
  145. placeholder="选择项目入规时间"
  146. v-model="form.okDate"
  147. style="width: 335px"
  148. ></el-date-picker>
  149. </el-form-item>
  150. </el-form>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <el-dialog :visible.sync="dialogVisible">
  156. <img width="100%" :src="dialogImageUrl" alt="" />
  157. </el-dialog>
  158. </div>
  159. </template>
  160. <script>
  161. import {
  162. listProduct,
  163. getProduct,
  164. delProduct,
  165. addProduct,
  166. updateProduct,
  167. exportProduct,
  168. } from "@/api/production/production.js";
  169. import { setExamine, setReject,setBack } from "@/api/projectInfo/info.js";
  170. const defaultSettings = require("@/settings.js");
  171. export default {
  172. name: "production",
  173. data() {
  174. return {
  175. disfal:false,
  176. process: process.env.VUE_APP_BASE_API,
  177. defaultSettings,
  178. //父级项目id
  179. bmProjectId: -1,
  180. scrop: { projectStatus: 2 },
  181. //图片
  182. disabled: false,
  183. dialogVisible: false,
  184. dialogImageUrl: false,
  185. productPhotoList: [],
  186. //数据字典
  187. typeOptions: {},
  188. // 表单参数
  189. form: {},
  190. // 表单校验
  191. rules: {
  192. totInvestment: [
  193. { required: true, message: "请输入已完成投资额", trigger: "blur" },
  194. ],
  195. macInvestment: [
  196. { required: true, message: "请输入设备投资额度", trigger: "blur" },
  197. ],
  198. productDate: [
  199. { required: true, message: "请选择投产时间", trigger: "blur" },
  200. ],
  201. isOk: [
  202. { required: true, message: "请选择项目入规(限)", trigger: "blur" },
  203. ],
  204. okDate: [
  205. { required: true, message: "请选择项目入规时间", trigger: "blur" },
  206. ],
  207. },
  208. };
  209. },
  210. created() {
  211. var that = this;
  212. that.bmProjectId = that.$route.query.setid;
  213. that.form.bmProjectId = that.$route.query.setid;
  214. that.setrd = that.$route.query.setrd;
  215. if(that.setrd != 7){
  216. this.disfal = true
  217. }else{
  218. this.disfal = false
  219. }
  220. that.getDicts("sys_yes_no").then((response) => {
  221. that.typeOptions = response.data;
  222. });
  223. getProduct(that.bmProjectId).then((response) => {
  224. if (response.data) {
  225. that.form = response.data;
  226. if (that.form.productPhoto.length > 0) {
  227. this.productPhotoList = JSON.parse(that.form.productPhoto);
  228. }
  229. }
  230. });
  231. },
  232. methods: {
  233. backProBtn(){
  234. var that = this
  235. this.$confirm("是否确认撤销审核", "提醒", {
  236. confirmButtonText: "确定",
  237. cancelButtonText: "取消",
  238. type: "warning",
  239. })
  240. .then(function() {
  241. return setBack({
  242. code: 4,
  243. bmProjectId: that.form.bmProjectId,
  244. });
  245. })
  246. .then(() => {
  247. this.msgSuccess("撤销成功");
  248. setTimeout(res => {
  249. this.$router.go(-1)
  250. }, 1000)
  251. });
  252. },
  253. reset() {
  254. var that = this;
  255. that.form = {
  256. id: this.form.id,
  257. bmProjectId: this.form.bmProjectId,
  258. createBy: null,
  259. createTime: null,
  260. updateBy: null,
  261. updateTime: null,
  262. isDel: null,
  263. totInvestment: null,
  264. macInvestment: null,
  265. productDate: null,
  266. productPhoto: null,
  267. isOk: null,
  268. okDate: null,
  269. };
  270. this.productPhotoList = [];
  271. },
  272. //上传图片
  273. handleSuccpermit(response, file, fileList) {
  274. console.log(file.response.url);
  275. },
  276. //提交
  277. submitBtn() {
  278. var that = this;
  279. this.$confirm("是否确认提交", "提醒", {
  280. confirmButtonText: "确定",
  281. cancelButtonText: "取消",
  282. type: "warning",
  283. })
  284. .then(function () {
  285. return setExamine({
  286. code: 1,
  287. bmProjectId: that.bmProjectId,
  288. });
  289. })
  290. .then(() => {
  291. this.$router.go(-1);
  292. // this.getList();
  293. this.msgSuccess("审核成功");
  294. });
  295. },
  296. /** 暂存按钮 */
  297. submitForm() {
  298. var tmp = [];
  299. if (this.productPhotoList.length == 0) {
  300. this.msgError("请先选择投产图片");
  301. return;
  302. }
  303. this.productPhotoList.forEach((item, index) => {
  304. var obj = {};
  305. obj.name = item.response.fileName;
  306. obj.uid = item.uid;
  307. obj.url = item.response.url;
  308. tmp[index] = obj;
  309. });
  310. this.form.productPhoto = JSON.stringify(tmp);
  311. this.$refs["form"].validate((valid) => {
  312. if (valid) {
  313. if (this.form.id != null) {
  314. updateProduct(this.form).then((response) => {
  315. this.msgSuccess("暂存成功");
  316. });
  317. } else {
  318. addProduct(this.form).then((response) => {
  319. this.msgSuccess("暂存成功");
  320. });
  321. }
  322. }
  323. });
  324. },
  325. submitUpload() {
  326. this.$refs.upload.submit();
  327. },
  328. handleOnsuccess(response, file, fileList) {
  329. this.productPhotoList = fileList;
  330. },
  331. handleRemove(file, fileList) {
  332. this.productPhotoList = fileList;
  333. },
  334. handlePictureCardPreview(file) {
  335. this.dialogImageUrl = file.url;
  336. this.dialogVisible = true;
  337. },
  338. handleDownload(file) {
  339. console.log(file);
  340. },
  341. /** 查询参数列表 */
  342. getList() {
  343. this.loading = true;
  344. listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(
  345. (response) => {
  346. this.configList = response.rows;
  347. this.total = response.total;
  348. this.loading = false;
  349. }
  350. );
  351. },
  352. // // 参数系统内置字典翻译
  353. // typeFormat(row, column) {
  354. // return this.selectDictLabel(this.typeOptions, row.configType);
  355. // },
  356. //审核
  357. applyBtn() {
  358. var that = this;
  359. this.$confirm("是否确认审核", "提醒", {
  360. confirmButtonText: "确定",
  361. cancelButtonText: "取消",
  362. type: "warning",
  363. })
  364. .then(function () {
  365. return setExamine({
  366. code: 3,
  367. bmProjectId: that.bmProjectId,
  368. });
  369. })
  370. .then(() => {
  371. this.$router.go(-1);
  372. this.getList();
  373. this.msgSuccess("审核成功");
  374. });
  375. },
  376. //驳回
  377. backBtn() {
  378. var that = this;
  379. this.$prompt("请输入驳回意见", "提醒", {
  380. confirmButtonText: "确定",
  381. cancelButtonText: "取消",
  382. type: "warning",
  383. })
  384. .then(({ value }) => {
  385. return setReject({
  386. code: 2,
  387. bmProjectId: that.bmProjectId,
  388. remark:value
  389. });
  390. })
  391. .then(() => {
  392. this.$router.go(-1);
  393. this.getList();
  394. this.msgSuccess("驳回成功");
  395. });
  396. },
  397. // 取消按钮
  398. cancel() {
  399. this.$router.go(-1);
  400. },
  401. /** 搜索按钮操作 */
  402. handleQuery() {
  403. this.queryParams.pageNum = 1;
  404. this.getList();
  405. },
  406. /** 重置按钮操作 */
  407. resetQuery() {
  408. this.dateRange = [];
  409. this.resetForm("queryForm");
  410. this.handleQuery();
  411. },
  412. /** 新增按钮操作 */
  413. handleAdd() {
  414. this.reset();
  415. this.open = true;
  416. this.title = "添加参数";
  417. },
  418. // 多选框选中数据
  419. handleSelectionChange(selection) {
  420. this.ids = selection.map((item) => item.configId);
  421. this.single = selection.length != 1;
  422. this.multiple = !selection.length;
  423. },
  424. /** 修改按钮操作 */
  425. handleUpdate() {},
  426. //tab
  427. tabClid(index) {
  428. this.tab = index;
  429. // this.$router.push('/tab');
  430. },
  431. },
  432. };
  433. </script>
  434. <style rel="stylesheet/scss" lang="scss">
  435. .buiy {
  436. // width: 75px !important;
  437. // height: 30px !important;
  438. // line-height: 30px !important;
  439. }
  440. .ijeut {
  441. display: flex;
  442. height: 78px;
  443. align-items: center;
  444. }
  445. .burert {
  446. .el-upload--picture-card {
  447. height: 78px;
  448. line-height: 78px;
  449. width: 80px;
  450. vertical-align: center;
  451. border: 0 !important;
  452. background-color: #fff;
  453. }
  454. .el-upload-list--picture-card .el-upload-list__item {
  455. height: 78px !important;
  456. width: 78px !important;
  457. }
  458. }
  459. .manager_form {
  460. .manager_lab {
  461. .el-form-item__label {
  462. width: 145px !important;
  463. }
  464. }
  465. .maneg_lar {
  466. position: relative;
  467. .el-form-item__label {
  468. width: 134px !important;
  469. }
  470. span {
  471. position: absolute;
  472. left: -95%;
  473. }
  474. }
  475. .manager_labtwo {
  476. .el-form-item__label {
  477. width: 244px !important;
  478. }
  479. }
  480. // .manager_labthre {
  481. // // .el-form-item{
  482. // .el-form-item__label {
  483. // width: 130px !important;
  484. // }
  485. // margin-right: 40px !important;
  486. // // }
  487. // }
  488. .ieuyr {
  489. .el-textarea__inner {
  490. height: 80px !important;
  491. }
  492. }
  493. // .mage_ter {
  494. // .el-form-item__label {
  495. // width: 543px !important;
  496. // }
  497. // }
  498. .maget_ty {
  499. .el-form-item__label {
  500. width: 135px !important;
  501. }
  502. }
  503. .forieu {
  504. border: 1px solid #dcdfe6;
  505. border-radius: 4px;
  506. width: 480px;
  507. height: 100px !important;
  508. position: relative;
  509. .bure {
  510. display: flex;
  511. // position: absolute;
  512. // height: 100%;
  513. // right: 20px;
  514. // top: 50%;
  515. // transform: translateY(-50%);
  516. padding: 10px 0;
  517. }
  518. .burert {
  519. display: flex;
  520. position: absolute;
  521. height: 100%;
  522. left: 20px;
  523. top: 50%;
  524. transform: translateY(-50%);
  525. }
  526. }
  527. }
  528. .lage_div {
  529. padding-left: 15px;
  530. display: flex;
  531. align-items: center;
  532. margin-bottom: 22px;
  533. .el-form-item {
  534. margin-bottom: 0 !important;
  535. }
  536. }
  537. .app-conta {
  538. .header {
  539. padding-left: 22px;
  540. height: 45px;
  541. line-height: 40px;
  542. background-color: #f1f1f1;
  543. font-size: 18px;
  544. color: #343434;
  545. margin-bottom: 40px;
  546. }
  547. .nauer {
  548. .nuae_wtu {
  549. display: flex;
  550. justify-content: center;
  551. align-content: center;
  552. .naue_one {
  553. width: 30%;
  554. p {
  555. font-size: 12px;
  556. font-family: PingFang SC;
  557. font-weight: 400;
  558. color: #343434;
  559. }
  560. .naue_name {
  561. font-size: 14px;
  562. font-family: PingFang SC;
  563. font-weight: bold;
  564. color: #0669b2;
  565. margin-bottom: 30px;
  566. }
  567. }
  568. .naue_two {
  569. flex: 1;
  570. padding-top: 20px;
  571. // display: flex;
  572. // align-items: center;
  573. // justify-content: center;
  574. }
  575. }
  576. //tab
  577. .naue_tab {
  578. border-bottom: 1px solid #cdcdcd;
  579. display: flex;
  580. margin-top: 30px;
  581. padding: 0 10px;
  582. margin-bottom: 30px;
  583. p {
  584. font-size: 12px;
  585. font-family: PingFang SC;
  586. font-weight: 400;
  587. color: #343434;
  588. padding: 11px 15px;
  589. margin: 0;
  590. }
  591. .p {
  592. border-bottom: 2px solid #1c84c6;
  593. margin-bottom: -1px;
  594. }
  595. }
  596. .mation {
  597. .enterprise {
  598. font-size: 14px;
  599. font-family: PingFang SC;
  600. font-weight: bold;
  601. color: #1c84c6;
  602. margin-top: 25px;
  603. margin-bottom: 20px;
  604. }
  605. .enterprise_tw {
  606. i {
  607. margin-right: 5px;
  608. }
  609. font-size: 14px;
  610. font-family: PingFang SC;
  611. font-weight: 600;
  612. color: #666666;
  613. }
  614. }
  615. }
  616. .nvestor {
  617. margin-bottom: 10px;
  618. p {
  619. margin: 0;
  620. font-size: 14px;
  621. font-family: PingFang SC;
  622. font-weight: bold;
  623. color: #343434;
  624. height: 24px;
  625. line-height: 24px;
  626. border-left: 3px solid #1c84c6;
  627. padding-left: 13px;
  628. i {
  629. color: red;
  630. }
  631. }
  632. }
  633. .souu {
  634. font-size: 14px;
  635. font-family: PingFang SC;
  636. font-weight: 400;
  637. color: #343434;
  638. margin-left: 5px;
  639. }
  640. }
  641. //在建项目
  642. .nstruction {
  643. display: flex;
  644. align-items: center;
  645. .nstruction_nav {
  646. display: flex;
  647. align-items: center;
  648. p:nth-child(1) {
  649. margin-right: 10px;
  650. span {
  651. font-size: 14px;
  652. font-family: PingFang SC;
  653. font-weight: bold;
  654. color: #343434;
  655. }
  656. span:nth-child(1) {
  657. color: #df0024;
  658. }
  659. }
  660. p:nth-child(2) {
  661. width: 233px;
  662. height: 30px;
  663. line-height: 30px;
  664. border: 1px solid #cdcdcd;
  665. border-radius: 3px;
  666. padding-left: 14px;
  667. }
  668. }
  669. .nstruction_navne {
  670. margin-left: 50px;
  671. display: flex;
  672. align-items: center;
  673. p:nth-child(1) {
  674. margin-right: 10px;
  675. span {
  676. font-size: 14px;
  677. font-family: PingFang SC;
  678. font-weight: bold;
  679. color: #343434;
  680. }
  681. span:nth-child(1) {
  682. color: #df0024;
  683. }
  684. }
  685. p:nth-child(2) {
  686. width: 233px;
  687. height: 30px;
  688. line-height: 30px;
  689. border: 1px solid #cdcdcd;
  690. border-radius: 3px;
  691. padding-left: 14px;
  692. }
  693. }
  694. }
  695. .kaieu {
  696. padding-left: 60px;
  697. font-size: 14px;
  698. font-family: PingFang SC;
  699. font-weight: 800;
  700. color: #343434;
  701. }
  702. .kaieu_tw {
  703. padding-left: 60px;
  704. font-size: 14px;
  705. font-family: PingFang SC;
  706. font-weight: 500;
  707. color: #666666;
  708. }
  709. </style>