info7.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <wt-card
  3. title="其他信息"
  4. class="mt-10"
  5. :edit-btn="true"
  6. @change="change"
  7. @save="save"
  8. >
  9. <el-form class="mt-20" :disabled="disabled">
  10. <div class="body_title">入库信息</div>
  11. <!-- 入库信息 -->
  12. <div class="flex flex-justify-center">
  13. <el-form-item class="full-width flex-child-average">
  14. <div class="flex flex-center full-width item">
  15. <span class="title">是否入库:</span>
  16. <div class="full-width">
  17. <el-select
  18. v-model="form.is_storage"
  19. placeholder="是否入库"
  20. class="full-width"
  21. >
  22. <el-option
  23. v-for="item in yesOrNo"
  24. :key="item.label"
  25. :label="item.label"
  26. :value="item.value"
  27. />
  28. </el-select>
  29. </div>
  30. </div>
  31. </el-form-item>
  32. <el-form-item class="full-width flex-child-average">
  33. <div class="flex flex-center full-width item">
  34. <span class="title">计划入库时间:</span>
  35. <el-date-picker
  36. v-model="form.plan_storage_time"
  37. type="date"
  38. style="width: 100%"
  39. placeholder="计划入库时间"
  40. format="YYYY-MM-DD"
  41. value-format="YYYY-MM-DD"
  42. />
  43. </div>
  44. </el-form-item>
  45. <el-form-item class="full-width flex-child-average">
  46. <div class="flex flex-center full-width item">
  47. <span class="title">实际入库时间:</span>
  48. <el-date-picker
  49. v-model="form.storage_time"
  50. type="date"
  51. style="width: 100%"
  52. placeholder="实际入库时间"
  53. format="YYYY-MM-DD"
  54. value-format="YYYY-MM-DD"
  55. @change="changeStorageTime"
  56. />
  57. </div>
  58. </el-form-item>
  59. </div>
  60. <div class="flex flex-justify-center">
  61. <el-form-item class="full-width flex-child-average">
  62. <div class="flex flex-center full-width item">
  63. <span class="title">项目代码:</span>
  64. <el-input v-model="form.project_code"></el-input>
  65. </div>
  66. </el-form-item>
  67. <el-form-item class="full-width flex-child-average">
  68. <div class="flex flex-center full-width item">
  69. <span class="title">监管平台代码:</span>
  70. <el-input v-model="form.regulatory_platform_code"></el-input>
  71. </div>
  72. </el-form-item>
  73. <el-form-item class="full-width flex-child-average">
  74. <div class="flex flex-center full-width item">
  75. <span class="title">是否纳入省重点项目:</span>
  76. <div class="full-width">
  77. <el-select
  78. v-model="form.is_provincial_key"
  79. placeholder="是否纳入省重点项目"
  80. class="full-width"
  81. >
  82. <el-option
  83. v-for="item in yesOrNo"
  84. :key="item.label"
  85. :label="item.label"
  86. :value="item.value"
  87. />
  88. </el-select>
  89. </div>
  90. </div>
  91. </el-form-item>
  92. </div>
  93. <div class="flex flex-justify-center">
  94. <el-form-item class="full-width flex-child-average">
  95. <div class="flex flex-center full-width item">
  96. <span class="title">可研批复号:</span>
  97. <el-input v-model="form.available_approval_id"></el-input>
  98. </div>
  99. </el-form-item>
  100. <el-form-item class="full-width flex-child-average">
  101. <div class="flex flex-center full-width item">
  102. <span class="title">可研批复时间:</span>
  103. <el-date-picker
  104. v-model="form.available_approval_date"
  105. type="date"
  106. style="width: 100%"
  107. placeholder="可研批复时间"
  108. format="YYYY-MM-DD"
  109. value-format="YYYY-MM-DD"
  110. />
  111. </div>
  112. </el-form-item>
  113. <el-form-item class="full-width flex-child-average">
  114. <div class="flex flex-center full-width item">
  115. <span class="title">是否纳入省集中开工:</span>
  116. <div class="full-width">
  117. <el-select
  118. v-model="form.is_provincial_level_construction"
  119. placeholder="是否纳入省集中开工"
  120. class="full-width"
  121. >
  122. <el-option
  123. v-for="item in yesOrNo"
  124. :key="item.label"
  125. :label="item.label"
  126. :value="item.value"
  127. />
  128. </el-select>
  129. </div>
  130. </div>
  131. </el-form-item>
  132. </div>
  133. <!-- 开工信息 -->
  134. <div class="body_title start">开工信息</div>
  135. <div class="flex flex-justify-center">
  136. <el-form-item class="full-width flex-child-average">
  137. <div class="flex flex-center full-width item">
  138. <span class="title">是否开工:</span>
  139. <div class="full-width">
  140. <el-select
  141. v-model="form.is_start"
  142. placeholder="是否开工"
  143. class="full-width"
  144. >
  145. <el-option
  146. v-for="item in yesOrNo"
  147. :key="item.label"
  148. :label="item.label"
  149. :value="item.value"
  150. />
  151. </el-select>
  152. </div>
  153. </div>
  154. </el-form-item>
  155. <el-form-item class="full-width flex-child-average">
  156. <div class="flex flex-center full-width item">
  157. <span class="title">计划开工时间:</span>
  158. <el-date-picker
  159. v-model="form.plan_commencement_time"
  160. type="date"
  161. style="width: 100%"
  162. placeholder="计划开工时间"
  163. format="YYYY-MM-DD"
  164. value-format="YYYY-MM-DD"
  165. />
  166. </div>
  167. </el-form-item>
  168. <el-form-item class="full-width flex-child-average">
  169. <div class="flex flex-center full-width item">
  170. <span class="title">实际开工时间:</span>
  171. <el-date-picker
  172. v-model="form.start_time"
  173. type="date"
  174. style="width: 100%"
  175. placeholder="实际开工时间"
  176. format="YYYY-MM-DD"
  177. value-format="YYYY-MM-DD"
  178. @change="changeStartTime"
  179. />
  180. </div>
  181. </el-form-item>
  182. </div>
  183. <div class="flex flex-justify-center">
  184. <el-form-item class="full-width flex-child-average">
  185. <div class="flex flex-center full-width item">
  186. <span class="title">计划竣工时间:</span>
  187. <el-date-picker
  188. v-model="form.plan_completion_time"
  189. type="date"
  190. style="width: 100%"
  191. placeholder="计划竣工时间"
  192. format="YYYY-MM-DD"
  193. value-format="YYYY-MM-DD"
  194. />
  195. </div>
  196. </el-form-item>
  197. <el-form-item class="full-width flex-child-average">
  198. <div class="flex flex-center full-width item">
  199. <span class="title">实际竣工时间:</span>
  200. <el-date-picker
  201. v-model="form.completion_time"
  202. type="date"
  203. style="width: 100%"
  204. placeholder="实际竣工时间"
  205. format="YYYY-MM-DD"
  206. value-format="YYYY-MM-DD"
  207. @change="changeCompletionTime"
  208. />
  209. </div>
  210. </el-form-item>
  211. <el-form-item class="full-width flex-child-average">
  212. <div class="flex flex-center full-width item"></div>
  213. </el-form-item>
  214. </div>
  215. </el-form>
  216. </wt-card>
  217. </template>
  218. <script>
  219. import wtCard from '@/components/wt-card/index.vue'
  220. export default {
  221. components: {
  222. wtCard
  223. },
  224. props: {
  225. info: {
  226. type: Object,
  227. default: () => {
  228. return {}
  229. }
  230. }
  231. },
  232. watch: {
  233. info: {
  234. handler(val) {
  235. this.form = val
  236. },
  237. immediate: true
  238. }
  239. },
  240. data() {
  241. return {
  242. yesOrNo: [
  243. {
  244. label: '否',
  245. value: 0
  246. },
  247. {
  248. label: '是',
  249. value: 1
  250. }
  251. ],
  252. disabled: true,
  253. form: {}
  254. }
  255. },
  256. methods: {
  257. changeStorageTime(res) {
  258. if (new Date().getTime() < new Date(res).getTime()) {
  259. this.$message.warning('实际入库时间不能大于当前时间!')
  260. }
  261. },
  262. changeStartTime(res) {
  263. if (new Date().getTime() < new Date(res).getTime()) {
  264. this.$message.warning('实际开工时间不能大于当前时间!')
  265. }
  266. },
  267. changeCompletionTime(res) {
  268. if (new Date().getTime() < new Date(res).getTime()) {
  269. this.$message.warning('实际竣工时间不能大于当前时间!')
  270. }
  271. },
  272. save() {
  273. if (this.check()) {
  274. return
  275. }
  276. this.$api.project.proUpdate(this.form).then(res => {
  277. if (res.code === 200) {
  278. this.$message.success(res.msg)
  279. } else {
  280. this.$message.error(res.msg)
  281. }
  282. })
  283. },
  284. check() {
  285. if (new Date().getTime() < new Date(this.form.storage_time).getTime()) {
  286. this.$message.error('实际入库时间不能大于当前时间!')
  287. return true
  288. }
  289. if (new Date().getTime() < new Date(this.form.start_time).getTime()) {
  290. this.$message.error('实际开工时间不能大于当前时间!')
  291. return true
  292. }
  293. if (
  294. new Date().getTime() < new Date(this.form.completion_time).getTime()
  295. ) {
  296. this.$message.error('实际竣工时间不能大于当前时间!')
  297. return true
  298. }
  299. if (this.form.is_storage == 1) {
  300. if (this.form.storage_time == null || this.form.storage_time == '') {
  301. this.$message.error('请填写入库时间!')
  302. return true
  303. }
  304. }
  305. if (this.form.is_start == 1) {
  306. if (this.form.start_time == null || this.form.start_time == '') {
  307. this.$message.error('请填写开工时间!')
  308. return true
  309. }
  310. }
  311. if (this.form.tags == 1) {
  312. //政府投资项目 必须要有可研批复号
  313. if (
  314. this.form.available_approval_id == '' ||
  315. this.form.available_approval_id == null
  316. ) {
  317. this.$message.error('请填写可研批复号!')
  318. return true
  319. }
  320. }
  321. //企业投资项目 必须要有项目代码
  322. if (this.form.tags == 2) {
  323. if (this.form.project_code == '' || this.form.project_code == null) {
  324. this.$message.error('请填写项目代码!')
  325. return true
  326. }
  327. }
  328. },
  329. change(res) {
  330. this.disabled = res
  331. }
  332. }
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. .body_title {
  337. margin-left: 5%;
  338. margin-bottom: 10px;
  339. width: 90%;
  340. text-align: left;
  341. }
  342. .start {
  343. margin-top: 20px;
  344. }
  345. .title {
  346. width: 240px;
  347. padding-right: 10px;
  348. text-align: right;
  349. }
  350. .title-textarea {
  351. width: 85px;
  352. text-align: left;
  353. }
  354. .item {
  355. width: 90%;
  356. }
  357. </style>