fourthInfoForm.vue 14 KB

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