index.vue 17 KB

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