fourthInfoForm.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <div>
  3. <el-form ref="basicInfoForm" label-position="top" :model="info" :rules="rules" label-width="150px">
  4. <div class="fomebox">
  5. <div class="ftop flexc">
  6. <img class="timg flex0" src="@/assets/images/project/tabtit.png" />
  7. <div class="flex1 tit">投产信息</div>
  8. <el-button type="primary" plain @click="submitForm">保存</el-button>
  9. </div>
  10. <div class="rowbox">
  11. <el-row :gutter="22">
  12. <el-col :span="6">
  13. <el-form-item label="投产时间" prop="begitcTimenTime">
  14. <el-date-picker v-model="info.begitcTimenTime" type="date" value-format="yyyy-MM-dd"
  15. placeholder="年 / 月 / 日">
  16. </el-date-picker>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="6">
  20. <el-form-item label="入规时间" prop="rgTime">
  21. <el-date-picker v-model="info.rgTime" type="date" value-format="yyyy-MM-dd"
  22. placeholder="年 / 月 / 日">
  23. </el-date-picker>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="6">
  27. <el-form-item label="万元产值能耗" prop="wycznh">
  28. <el-input placeholder="请输入万元产值能耗" v-model="info.wycznh" />
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. </div>
  33. </div>
  34. <div class="fomebox">
  35. <div class="ftop flexc">
  36. <img class="timg flex0" src="@/assets/images/project/tabtit.png" />
  37. <div class="flex1 tit">年度统计<span style="color: red; font-size: 12px;">(请先报存投产信息在填写年度统计)</span></div>
  38. <el-button type="primary" plain @click="handleAdd">提交</el-button>
  39. </div>
  40. <div class="rowbox">
  41. <el-row :gutter="22">
  42. <el-col :span="6">
  43. <el-form-item label="年度" prop="tcxxYear">
  44. <el-date-picker v-model="form.tcxxYear" type="year" value-format="yyyy"
  45. placeholder="选择年">
  46. </el-date-picker>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="6">
  50. <el-form-item label="月份" prop="tcxxMonth">
  51. <el-date-picker v-model="form.tcxxMonth" type="month" value-format="MM"
  52. placeholder="选择月">
  53. </el-date-picker>
  54. </el-form-item>
  55. </el-col>
  56. </el-row>
  57. <el-row :gutter="22">
  58. <el-col :span="6">
  59. <el-form-item label="当月累计产值(万元)" prop="cz">
  60. <el-input type="number" placeholder="请输入累计产值" v-model="form.cz" />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="6">
  64. <el-form-item label="当月实缴税收(万元)" prop="sjss">
  65. <el-input type="number" placeholder="请输入实缴税收" v-model="form.sjss" />
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="6">
  69. <el-form-item label="当月累计用电(万千瓦时)" prop="hdl">
  70. <el-input type="number" placeholder="请输入累计用电" v-model="form.hdl" />
  71. </el-form-item>
  72. </el-col>
  73. </el-row>
  74. </div>
  75. <div class="ftab flexc" style="padding-top: 7px;">
  76. <div class="line"></div>每月项目建设进展情况
  77. </div>
  78. <div class="rowbox" style="width: 100%;overflow: hidden;">
  79. <el-table :max-height="213" show-summary :data="tableDataa" border
  80. style="width: 100%;margin-bottom: 15px;">
  81. <el-table-column align="center" type="index" label="序号" width="150"></el-table-column>
  82. <el-table-column align="center" prop="cz" label="当月累计产值(万元)"> </el-table-column>
  83. <el-table-column align="center" prop="sjss" label="当月实缴税收(万元)"> </el-table-column>
  84. <el-table-column align="center" prop="hdl" label="当月累计用电(万千瓦时)"> </el-table-column>
  85. <el-table-column align="center" prop="createTime" label="上报时间">
  86. </el-table-column>
  87. <el-table-column align="center" label="操作" :width="120">
  88. <template slot-scope="scope">
  89. <div class="flexcc">
  90. <div class="btna coa" style="padding: 0; margin-right: 3px;"
  91. @click="handleUpdate(scope.row)">
  92. <div class="imgs">
  93. </div>修改
  94. </div>
  95. <div class="btna cod" style="padding: 0; margin-left: 3px;"
  96. @click="handleDelete(scope.row)">
  97. <div class="imgs">
  98. </div>删除
  99. </div>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. </div>
  106. <div class="fomebox">
  107. <div class="ftop flexc">
  108. <img class="timg flex0" src="@/assets/images/project/tabtit.png" />
  109. <div class="flex1 tit">上传附件</div>
  110. <!-- <el-button type="primary" plain>保存</el-button> -->
  111. </div>
  112. <div class="rowbox">
  113. <el-table :data="tableData" border style="width: 100%;margin-bottom: 15px;">
  114. <el-table-column align="center" prop="index" label="序号" width="10%"></el-table-column>
  115. <el-table-column align="center" prop="fjlx" label="附件类型" width="30%"> </el-table-column>
  116. <el-table-column align="center" label="操作" width="30%">
  117. <template slot-scope="scope">
  118. <div class="flexcc">
  119. <div class="btna flexc coa">
  120. <fileUploadt v-model="jylist" :datam="jyzhp" :data="jyzhp"
  121. v-if="scope.row.index == 0" />
  122. <fileUploadt v-model="xshtlist" :datam="xsht" :data="xsht"
  123. v-if="(scope.row.index == 1 && issfe)" />
  124. <fileUploadt v-model="xsfqlist" :datam="xsfp" :data="xsfp"
  125. v-if="(scope.row.index == 2 && issfe)" />
  126. <fileUploadt v-model="cwbblist" :datam="cwbb" :data="cwbb"
  127. v-if="(scope.row.index == 3 && issfe)" />
  128. <fileUploadt v-model="tjbblist" :datam="tjbb" :data="tjbb"
  129. v-if="(scope.row.index == 4 && issfe)" />
  130. </div>
  131. </div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. </div>
  136. </div>
  137. </el-form>
  138. <div class="flexcc pt7">
  139. <!-- <el-button type="primary" plain>暂存</el-button> -->
  140. <el-button type="primary" style="margin-left: 26px;" @click="submitForm">提交</el-button>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. import {
  146. listMonth,
  147. getMonth,
  148. delMonth,
  149. addMonth,
  150. updateMonth
  151. } from "@/api/zhaoshang/month"
  152. import {
  153. listTcxx,
  154. getTcxx,
  155. delTcxx,
  156. addTcxx,
  157. updateTcxx
  158. } from "@/api/zhaoshang/tcxx"
  159. export default {
  160. props: {
  161. info: {
  162. type: Object,
  163. default: null
  164. }
  165. },
  166. data() {
  167. return {
  168. value: '',
  169. value1: '',
  170. loading: false,
  171. form: {
  172. tcxxYear: null,
  173. tcxxMonth: null,
  174. cz: null,
  175. sjss: null,
  176. hdl: null,
  177. createBy: null,
  178. createTime: null,
  179. updateBy: null,
  180. updateTime: null,
  181. remark: null
  182. },
  183. options: [{
  184. value: '选项1',
  185. label: '黄金糕'
  186. }, {
  187. value: '选项2',
  188. label: '双皮奶'
  189. }],
  190. tableData: [{
  191. fjlx: '项目生产经营照片',
  192. index: 0,
  193. time: '2025-06-16 16:57',
  194. },
  195. {
  196. fjlx: '销售合同',
  197. index: 1,
  198. time: '2025-06-16 16:57',
  199. },
  200. {
  201. fjlx: '销售发票',
  202. index: 2,
  203. time: '2025-06-16 16:57',
  204. },
  205. {
  206. fjlx: '公司财务报表',
  207. index: 3,
  208. time: '2025-06-16 16:57',
  209. },
  210. {
  211. fjlx: '生产统计报表',
  212. index: 4,
  213. time: '2025-06-16 16:57',
  214. }
  215. ],
  216. jyzhp: {
  217. fileName: '项目生产经营照片',
  218. bigType: 'd',
  219. type: 19
  220. },
  221. xsht: {
  222. fileName: '销售合同',
  223. bigType: 'd',
  224. type: 20
  225. },
  226. xsfp: {
  227. bigType: 'd',
  228. fileName: '销售发票',
  229. type: 21
  230. },
  231. cwbb: {
  232. bigType: 'd',
  233. fileName: '公司财务报表',
  234. type: 22
  235. },
  236. tjbb: {
  237. fileName: '生产统计报表',
  238. bigType: 'd',
  239. type: 23
  240. },
  241. tableDataa: [],
  242. rules: {
  243. begitcTimenTime: [{
  244. required: true,
  245. message: "不能为空",
  246. trigger: "blur"
  247. }],
  248. },
  249. issfe: false,
  250. jylist:[],
  251. xshtlist:[],
  252. xsfqlist:[],
  253. cwbblist:[],
  254. tjbblist:[]
  255. }
  256. },
  257. watch: {
  258. info: {
  259. handler(newVal, oldVal) {
  260. // 在这里处理dataMsg变化后的逻辑
  261. // console.log(this.info)
  262. this.getshui()
  263. },
  264. immediate: true // 立即执行一次
  265. }
  266. },
  267. created() {
  268. this.getshui()
  269. },
  270. mounted() {
  271. },
  272. methods: {
  273. // 回显
  274. getshui() {
  275. this.jylist = []
  276. this.xshtlist = []
  277. this.xsfqlist = []
  278. this.cwbblist = []
  279. this.tjbblist = []
  280. let that = this
  281. setTimeout(function() {
  282. let sngsenhgt = that.info.xmbh
  283. that.jyzhp.xmbh = sngsenhgt
  284. that.xsht.xmbh = sngsenhgt
  285. that.xsfp.xmbh = sngsenhgt
  286. that.cwbb.xmbh = sngsenhgt
  287. that.tjbb.xmbh = sngsenhgt
  288. that.issfe = true
  289. if (that.info.id == -1) {
  290. // 新增
  291. // this.getList()
  292. } else {
  293. // 修改
  294. if (that.info.zsyzFjList.length != 0) {
  295. that.info.zsyzFjList.filter(rou => {
  296. if (rou.bigType == 'd') {
  297. if (rou.type == 19) {
  298. // 设备清单
  299. that.jylist.push(rou)
  300. }
  301. if (rou.type == 20) {
  302. // 设备清单
  303. that.xshtlist.push(rou)
  304. }
  305. if (rou.type == 21) {
  306. // 设备清单
  307. that.xsfqlist.push(rou)
  308. }
  309. if (rou.type == 22) {
  310. // 设备清单
  311. that.cwbblist.push(rou)
  312. }
  313. if (rou.type == 23) {
  314. // 设备清单
  315. that.tjbblist.push(rou)
  316. }
  317. }
  318. })
  319. }
  320. that.getList()
  321. }
  322. }, 2000)
  323. // console.log(this.info)
  324. },
  325. getList() {
  326. this.loading = true
  327. let sgnsegse = {
  328. xmbh: this.info.xmbh
  329. }
  330. listMonth(sgnsegse).then(response => {
  331. this.tableDataa = response.rows
  332. this.total = response.total
  333. this.loading = false
  334. })
  335. },
  336. // 每月更新提交
  337. handleAdd() {
  338. if (this.form.tcxxYear == null) {
  339. this.$message.error('请填写年度');
  340. return
  341. }
  342. if (this.form.tcxxMonth == null) {
  343. this.$message.error('请填写月份');
  344. return
  345. }
  346. // console.log(this.form)
  347. this.form.tcxxId = this.info.tcxxId
  348. this.form.xmbh = this.info.xmbh
  349. // this.form.tcxxId = 1
  350. // return
  351. if (this.form.tcxxMonthId != undefined) {
  352. updateMonth(this.form).then(response => {
  353. this.$modal.msgSuccess("修改成功")
  354. this.open = false
  355. this.getList()
  356. })
  357. } else {
  358. addMonth(this.form).then(response => {
  359. this.$modal.msgSuccess("新增成功")
  360. this.open = false
  361. this.getList()
  362. })
  363. }
  364. },
  365. // 表单重置
  366. reset() {
  367. this.form = {
  368. tcxxYear: null,
  369. tcxxMonth: null,
  370. cz: null,
  371. sjss: null,
  372. hdl: null,
  373. createBy: null,
  374. createTime: null,
  375. updateBy: null,
  376. updateTime: null,
  377. remark: null
  378. }
  379. this.resetForm("form")
  380. },
  381. /** 修改按钮操作 */
  382. handleUpdate(row) {
  383. this.reset()
  384. const tzfkId = row.tcxxMonthId
  385. getMonth(tzfkId).then(response => {
  386. this.form = response.data
  387. this.open = true
  388. this.title = "修改信息"
  389. })
  390. },
  391. /** 删除按钮操作 */
  392. handleDelete(row) {
  393. const tzfkIds = row.tcxxMonthId
  394. delMonth(tzfkIds).then(response => {
  395. this.$modal.msgSuccess("删除成功")
  396. this.getList()
  397. })
  398. },
  399. /** 提交按钮 */
  400. submitForm: function() {
  401. this.$refs["basicInfoForm"].validate(valid => {
  402. if (valid) {
  403. this.info.zsyzFjList = []
  404. console.log(this.info, 6)
  405. if (this.jylist.length != 0) {
  406. this.info.zsyzFjList = this.info.zsyzFjList.concat(this.jylist)
  407. }
  408. if (this.xshtlist.length != 0) {
  409. this.info.zsyzFjList = this.info.zsyzFjList.concat(this.xshtlist)
  410. }
  411. if (this.xsfqlist.length != 0) {
  412. this.info.zsyzFjList = this.info.zsyzFjList.concat(this.xsfqlist)
  413. }
  414. if (this.cwbblist.length != 0) {
  415. this.info.zsyzFjList = this.info.zsyzFjList.concat(this.cwbblist)
  416. }
  417. if (this.tjbblist.length != 0) {
  418. this.info.zsyzFjList = this.info.zsyzFjList.concat(this.tjbblist)
  419. }
  420. // return
  421. if (this.info.id != -1) {
  422. updateTcxx(this.info).then(response => {
  423. this.$modal.msgSuccess("修改成功")
  424. this.open = false
  425. // this.getList()
  426. })
  427. } else {
  428. addTcxx(this.info).then(response => {
  429. this.$modal.msgSuccess("新增成功")
  430. this.form.tcxxId = response.data
  431. this.info.tcxxId = response.data
  432. // this.open = false
  433. // this.$router.go(-1)
  434. // this.getList()
  435. })
  436. }
  437. }
  438. })
  439. },
  440. }
  441. }
  442. </script>
  443. <style lang="scss" scoped>
  444. ::v-deep {
  445. .fomebox {
  446. .el-button--primary {
  447. font-size: 14px;
  448. padding: 8px 14px;
  449. }
  450. .el-form-item__label {
  451. padding-bottom: 0;
  452. line-height: 38px;
  453. }
  454. .el-form-item {
  455. margin-bottom: 15px;
  456. }
  457. .el-input__inner {
  458. height: 40px;
  459. line-height: 40px;
  460. }
  461. .el-date-editor.el-input {
  462. width: 100%;
  463. }
  464. .el-select {
  465. width: 100%;
  466. }
  467. table {
  468. width: 100% !important;
  469. }
  470. .el-table .el-table__header-wrapper th {
  471. background: #F6FAFD;
  472. }
  473. }
  474. }
  475. .fomebox {
  476. background: #FFFFFF;
  477. margin-bottom: 15px;
  478. border-radius: 4px;
  479. .ftop {
  480. padding: 10px 17px 10px 16px;
  481. border-bottom: 1px solid #E6E6E6;
  482. .timg {
  483. width: 20px;
  484. height: 20px;
  485. margin-right: 13px;
  486. }
  487. .tit {
  488. font-weight: bold;
  489. font-size: 16px;
  490. color: #222838;
  491. }
  492. }
  493. .rowbox {
  494. padding: 10px 15px 9px;
  495. }
  496. .ftab {
  497. font-weight: bold;
  498. font-size: 14px;
  499. color: #2777D0;
  500. padding: 7px 16px 0px;
  501. .line {
  502. width: 6px;
  503. margin-right: 9px;
  504. height: 20px;
  505. background: #2777D0;
  506. }
  507. }
  508. .btna {
  509. font-weight: 500;
  510. font-size: 14px;
  511. padding: 0 13px;
  512. .imgs {
  513. width: 15px;
  514. height: 15px;
  515. display: flex;
  516. align-items: center;
  517. justify-content: center;
  518. margin-right: 7px;
  519. .imga {
  520. width: 13px;
  521. height: 14px;
  522. }
  523. .imgb {
  524. width: 14px;
  525. height: 14px;
  526. }
  527. .imgc {
  528. width: 15px;
  529. height: 15px;
  530. }
  531. .imgd {
  532. width: 13px;
  533. height: 14px;
  534. }
  535. }
  536. &.coa {
  537. color: #1890FF;
  538. }
  539. &.cob {
  540. color: #FE7F0E;
  541. }
  542. &.coc {
  543. color: #00A854;
  544. }
  545. &.cod {
  546. color: #F25858;
  547. }
  548. }
  549. }
  550. </style>