addreport.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view :style="'padding-bottom:' + bottom ">
  3. <view class='zhanline'></view>
  4. <uni-forms class='inform ' ref="form" :rules="rules" :value="datainfo" v-show="type==1">
  5. <view class="info_tit">项目信息</view>
  6. <uni-forms-item name="xmmc" style='margin-bottom: 0;'>
  7. <view class="flexc infolist">
  8. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>项目名称</view>
  9. <!-- <uni-easyinput v-model="datainfo.xmmc" placeholder="请输入项目名称" /> -->
  10. <input placeholder="请输入项目名称" v-model="datainfo.xmmc" class="f16 c34 flex1 txr"/>
  11. </view>
  12. </uni-forms-item>
  13. <uni-forms-item name="xmdw" style='margin-bottom: 0;'>
  14. <view class="flexc infolist">
  15. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>项目单位</view>
  16. <input placeholder="请输入项目单位" v-model="datainfo.xmdw" class="f16 c34 flex1 txr"/>
  17. </view>
  18. </uni-forms-item>
  19. <uni-forms-item name="qtzrdw" style='margin-bottom: 0;'>
  20. <view class="flexc infolist">
  21. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>牵头责任单位</view>
  22. <input placeholder="请输入牵头责任单位" v-model="datainfo.qtzrdw" class="f16 c34 flex1 txr"/>
  23. </view>
  24. </uni-forms-item>
  25. <uni-forms-item name="qtsld" style='margin-bottom: 0;'>
  26. <view class="flexc infolist">
  27. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>牵头市领导</view>
  28. <input placeholder="请输入牵头市领导" v-model="datainfo.qtsld" class="f16 c34 flex1 txr"/>
  29. </view>
  30. </uni-forms-item>
  31. <uni-forms-item name="gmnr" style='margin-bottom: 0;'>
  32. <view class="flexc infolist">
  33. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>主要建设规模和内容</view>
  34. <input placeholder="请输入主要建设规模和内容" v-model="datainfo.gmnr" class="f16 c34 flex1 txr"/>
  35. </view>
  36. </uni-forms-item>
  37. <uni-forms-item name="jhkgsj" style='margin-bottom: 0;'>
  38. <view class="flexc infolist">
  39. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>计划开工时间</view>
  40. <picker mode="date" :value="datainfo.jhkgsj" class="infolist_a" @change='bindDateChangetimea'>
  41. <view :class="datainfo.jhkgsj?'':'f16 co80'">{{datainfo.jhkgsj||"请选择计划开工时间"}}</view>
  42. </picker>
  43. </view>
  44. </uni-forms-item>
  45. <uni-forms-item name="xmztz" style='margin-bottom: 0;'>
  46. <view class="flexc infolist">
  47. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>项目总投资(万元)</view>
  48. <input placeholder="请输入项目总投资" type="number" v-model="datainfo.xmztz" class="f16 c34 flex1 txr"/>
  49. </view>
  50. </uni-forms-item>
  51. <view class="infobtn flexcc cf f16 f500" @click="getNext">下一步</view>
  52. </uni-forms>
  53. <!-- 下一步 -->
  54. <uni-forms class='inform' ref="twoform" :rules="tworules" :value="datainfo" v-show="type==2">
  55. <view class="info_tit">资金来源</view>
  56. <uni-forms-item name="sjbz" style='margin-bottom: 0;'>
  57. <view class="flexc infolist">
  58. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>上级补助资金(万元)</view>
  59. <input @input="getHjFn" placeholder="请输入上级补助资金" type="number" v-model="datainfo.sjbz" class="f16 c34 flex1 txr"/>
  60. </view>
  61. </uni-forms-item>
  62. <uni-forms-item name="sczbj" style='margin-bottom: 0;'>
  63. <view class="flexc infolist">
  64. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>市政财本资金(万元)</view>
  65. <input @input="getHjFn" placeholder="请输入市政财本资金" v-model="datainfo.sczbj" type="number" class="f16 c34 flex1 txr"/>
  66. </view>
  67. </uni-forms-item>
  68. <uni-forms-item name="zxz" style='margin-bottom: 0;'>
  69. <view class="flexc infolist">
  70. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>专项债(万元)</view>
  71. <input @input="getHjFn" placeholder="请输入专项债" v-model="datainfo.zxz" type="number" class="f16 c34 flex1 txr"/>
  72. </view>
  73. </uni-forms-item>
  74. <!-- <uni-forms-item name="ppp" style='margin-bottom: 0;'>
  75. <view class="flexc infolist">
  76. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>PPP(万元)</view>
  77. <input @input="getHjFn" placeholder="请输入PPP" v-model="datainfo.ppp" type="number" class="f16 c34 flex1 txr"/>
  78. </view>
  79. </uni-forms-item> -->
  80. <uni-forms-item name="rz" style='margin-bottom: 0;'>
  81. <view class="flexc infolist">
  82. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>融资(万元)</view>
  83. <input @input="getHjFn" placeholder="请输入融资" v-model="datainfo.rz" type="number" class="f16 c34 flex1 txr"/>
  84. </view>
  85. </uni-forms-item>
  86. <uni-forms-item name="qyzc" style='margin-bottom: 0;'>
  87. <view class="flexc infolist">
  88. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>企业自筹(万元)</view>
  89. <input @input="getHjFn" placeholder="请输入企业自筹" v-model="datainfo.qyzc" type="number" class="f16 c34 flex1 txr"/>
  90. </view>
  91. </uni-forms-item>
  92. <uni-forms-item name="hj" style='margin-bottom: 0;'>
  93. <view class="flexc infolist">
  94. <view class="f16 fw c34 flex0 pr pl12">合计(万元)</view>
  95. <view class="f16 c34 flex1 txr">{{hj}}</view>
  96. </view>
  97. </uni-forms-item>
  98. <view class="border"></view>
  99. <uni-forms-item name="ndjh" style='margin-bottom: 0;'>
  100. <view class="flexc infolist">
  101. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>年度计划完成投资(万元)</view>
  102. <input placeholder="请输入年度计划完成投资" type="number" v-model="datainfo.ndjh" class="f16 c34 flex1 txr"/>
  103. </view>
  104. </uni-forms-item>
  105. <uni-forms-item name="sjbzzjqd" style='margin-bottom: 0;'>
  106. <view class="flexc infolist">
  107. <view class="f16 fw c34 flex0 pr pl12"><text class="cir" v-if="Number(datainfo.sjbz)>0">*</text>上级补助资金渠道</view>
  108. <input placeholder="请输入上级补助资金渠道" v-model="datainfo.sjbzzjqd" class="f16 c34 flex1 txr"/>
  109. </view>
  110. </uni-forms-item>
  111. <uni-forms-item name="rzqd" style='margin-bottom: 0;'>
  112. <view class="flexc infolist">
  113. <view class="f16 fw c34 flex0 pr pl12"><text class="cir" v-if="Number(datainfo.rz)>0">*</text>融资渠道</view>
  114. <input placeholder="请输入融资渠道" v-model="datainfo.rzqd" class="f16 c34 flex1 txr"/>
  115. </view>
  116. </uni-forms-item>
  117. <view class="border"></view>
  118. <uni-forms-item name="remark" style='margin-bottom: 0;'>
  119. <view class="flexc infolist">
  120. <view class="f16 fw c34 flex0 pr pl12">备注</view>
  121. <input placeholder="请输入备注信息" v-model="datainfo.remark" class="f16 c34 flex1 txr"/>
  122. </view>
  123. </uni-forms-item>
  124. <!-- 新增 -->
  125. <view class="infobtn flexcc cf f16 f500" v-if="(checkPermi(['fgw:xmsb:add'])&&pagetype=='add')||(checkPermi(['fgw:xmsb:edit'])&&pagetype=='update')" @click="getSubmit">提交</view>
  126. </uni-forms>
  127. </view>
  128. </template>
  129. <script>
  130. import { getDictionaryFn} from '@/api/work/index.js'
  131. import {selectDictLabel} from "@/utils/common.js"
  132. import {getxmsbDetail,getxmsbAddFn,getxmsbPutFn} from '@/api/zdwork/addclue.js'
  133. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  134. import config from '@/config'
  135. const baseUrl = config.baseUrl
  136. import { getToken } from '@/utils/auth'
  137. export default {
  138. data() {
  139. return {
  140. selectDate: '',
  141. defaultPhoneHeight: '', //屏幕默认高度
  142. nowPhoneHeight: '', //屏幕现在的高度
  143. bottom:0,
  144. type:1,
  145. datainfo:{
  146. "xmbh":"",//项目编号
  147. "xmmc":"",//项目名称
  148. "xmdw":"",//项目单位
  149. "qtzrdw":"",//牵头责任单位
  150. "qtsld":"",//牵头市领导
  151. "gmnr":"",//主要建设规模和内容
  152. "jhkgsj":"",//计划开工时间)
  153. "xmztz":"",//项目总投资
  154. "sjbz":"",//上级补助
  155. "sczbj":"",//市财政补助
  156. "zxz":"",//专项债
  157. "ppp":"",//ppp
  158. "qyzc":"",//qyzc
  159. "rz":"",//融资
  160. "ndjh":"",//年度计划完成投资
  161. "sjbzzjqd":"",//上级补助资金渠道
  162. "rzqd":"",//融资渠道
  163. "remark":""//备注
  164. },
  165. tanfalg:false,
  166. addimg:require("@/static/images/mine/add.png"),
  167. delimg:require("@/static/images/mine/del.png"),
  168. checknimg:require("@/static/images/mine/jnicon.png"),
  169. gcheckimg:require("@/static/images/mine/jicon.png"),
  170. closeimg:require('@/static/images/close.png'),
  171. wimg:require('@/static/images/index/wicon.png'),
  172. downimg:require('@/static/images/index/down.png'),
  173. rules: {
  174. xmmc: {rules: [{required: true,errorMessage: '请输入项目名称'}]},
  175. xmdw: {rules: [{required: true,errorMessage: '请输入项目单位',}]},
  176. qtzrdw: {rules: [{required: true,errorMessage: '请输入牵头责任单位' } ]},
  177. qtsld: {rules: [{required: true,errorMessage: '请输入牵头市领导'} ]},
  178. gmnr: {rules: [{required: true,errorMessage: '请输入主要建设规模和内容'} ]},
  179. jhkgsj: {rules: [{required: true,errorMessage: '请选择计划开工时间'} ]},
  180. xmztz: {rules: [{required: true,errorMessage: '请输入项目总投资'} ]},
  181. },
  182. tworules:{
  183. sjbz: {rules: [{required: true,errorMessage: '请输入上级补助'} ]},
  184. sczbj: {rules: [{required: true,errorMessage: '请输入市政财本级'} ]},
  185. zxz: {rules: [{required: true,errorMessage: '请输入专项债'} ]},
  186. // ppp: {rules: [{required: true,errorMessage: '请输入PPP'} ]},
  187. rz: {rules: [{required: true,errorMessage: '请输入融资'}]},
  188. ndjh: {rules: [{required: true,errorMessage: '请输入年度计划完成投资'} ]},
  189. qyzc: {rules: [{required: true,errorMessage: '请输入企业自筹'} ]},
  190. // sjbzzjqd: {rules: [{required: true,errorMessage: '请输入上级补助资金渠道'} ]},
  191. // rzqd: {rules: [{required: true,errorMessage: '请输入融资渠道'} ]},
  192. },
  193. lhindex:0,
  194. cyindex:0,
  195. cylist:[{dictLabel:'是',dictValue:'Y'},{dictLabel:'否',dictValue:'N'}],//宜商
  196. currentdate:'',//当天日期
  197. pagetype:'add',
  198. hj:'',//合计
  199. }
  200. },
  201. onLoad(e) {
  202. // this.currentdate = this.getNowFormatDate();
  203. if(e.data){
  204. var newObj=JSON.parse(decodeURIComponent(e.data))
  205. this.pagetype=newObj.pagetype||'add';
  206. }
  207. if(this.pagetype=='update'){
  208. this.id=newObj.id;
  209. // 获取详情 修改
  210. this.getDataFn()
  211. }else{
  212. }
  213. // #ifdef APP
  214. uni.onKeyboardHeightChange(res=> { //监听键盘高度变化
  215. const res_keyboard = uni.getSystemInfoSync();
  216. let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight)
  217. // let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight + res_keyboard.safeAreaInsets.bottom)
  218. this.bottom = `${ key_height>0 ? key_height : 0}px`;
  219. // console.log( this.bottom,1)
  220. })
  221. // #endif
  222. },
  223. onHide() {
  224. // #ifdef APP-PLUS
  225. uni.offKeyboardHeightChange(); // 取消监听键盘高度变化事件,避免内存消耗
  226. // #endif
  227. },
  228. onReady() {
  229. // this.$refs.form.setRules(this.rules)
  230. },
  231. methods: {
  232. checkPermi, checkRole,
  233. // 项目详情
  234. // that.diff_amount = parseFloat(that.order.amount - that.money).toFixed(2);
  235. getDataFn(){
  236. var that=this;
  237. getxmsbDetail(this.id).then(res=>{
  238. if(res.code==200){
  239. this.datainfo=res.data;
  240. var strnum=Number(this.datainfo.sjbz) + Number(this.datainfo.sczbj) + Number(this.datainfo.zxz) + Number(this.datainfo.rz) + Number(this.datainfo.qyzc)
  241. this.hj=strnum.toFixed(2);
  242. }else{
  243. this.$toast(res.msg)
  244. }
  245. })
  246. },
  247. getHjFn(){
  248. var strnum=Number(this.datainfo.sjbz) + Number(this.datainfo.sczbj) + Number(this.datainfo.zxz) + Number(this.datainfo.rz)+ Number(this.datainfo.qyzc)
  249. this.hj=strnum.toFixed(2);
  250. },
  251. // 字典值
  252. getinvestmentarea(){
  253. // 所属行业
  254. getDictionaryFn('industry').then(res=>{
  255. if(res.code==200){
  256. this.industry=res.data
  257. }
  258. })
  259. },
  260. getNowFormatDate(){
  261. let date = new Date();
  262. let y = date.getFullYear();
  263. let m = date.getMonth() + 1;
  264. m = m < 10 ? "0" + m : m;
  265. let d = date.getDate();
  266. d = d < 10 ? "0" + d : d;
  267. const timeday = y + "-" + m + "-" + d;
  268. return timeday;
  269. },
  270. bindDateChangetimea(e){//计划开工时间
  271. this.datainfo.jhkgsj=e.detail.value
  272. },
  273. getNext(){
  274. this.$refs.form.validate().then(res => {
  275. this.type=2;
  276. })
  277. },
  278. getSubmit() {
  279. var that=this;
  280. this.$refs.twoform.validate().then(res => {
  281. var params=this.datainfo;
  282. // 判断渠道必填
  283. if(Number(params.sjbz)>0){
  284. if(!params.sjbzzjqd){
  285. this.$toast('请输入上级补助资金渠道')
  286. return
  287. }
  288. }
  289. if(Number(params.rz)>0){
  290. if(!params.rzqd){
  291. this.$toast('请输入融资渠道')
  292. return
  293. }
  294. }
  295. if(this.pagetype=='add'){
  296. getxmsbAddFn(params).then(res=>{
  297. if(res.code==200){
  298. this.$toast('新增申报成功')
  299. setTimeout(function() {
  300. uni.$emit('refreshdatalistzd');
  301. uni.navigateBack({delta: 1});
  302. },1500);
  303. }else{
  304. this.$toast(res.msg)
  305. }
  306. })
  307. }else{
  308. getxmsbPutFn(params).then(res=>{
  309. if(res.code==200){
  310. this.$toast('修改申报信息成功')
  311. setTimeout(function() {
  312. uni.$emit('refreshdatazd');
  313. uni.$emit('refreshdatalistzd');
  314. uni.navigateBack({delta: 1});
  315. },1500);
  316. }else{
  317. this.$toast(res.msg)
  318. }
  319. })
  320. }
  321. })
  322. },
  323. }
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. .inform{padding-top: 30rpx; padding-bottom: 160rpx;}
  328. .infolist{padding: 30rpx 32rpx 30rpx 24rpx;position: relative;
  329. .cir{position: absolute;font-size: 36rpx;font-weight: bold;color: #FE5706;left: 0rpx;}
  330. }
  331. .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;
  332. image{width: 30rpx;height: 30rpx;}
  333. }
  334. .infobtn{width: 100%;height: 88rpx;background: #FA5F03;line-height: 88rpx;position: fixed;left: 0;right: 0;bottom: 0;z-index: 3;}
  335. .input_ye image{width: 34rpx;height: 18rpx;}
  336. .info_tit{font-size: 32rpx;color: #FE5706;padding: 30rpx 26rpx;font-weight: bold;}
  337. .infolist_a{height: 44rpx;flex: 1;text-align: right;font-size: 32rpx;color: #343434;}
  338. .inform /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
  339. .inform .pl12{margin-right: 10rpx;}
  340. .fixedbox .pl12{margin-right: 10rpx;}
  341. // 计算合计
  342. .infohjbtn{font-size: 30rpx;margin-left: 20rpx;color: #3C9BCD;}
  343. </style>