comEditcf.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '新建企业信息'">
  4. <block slot="backText">返回</block>
  5. <block slot="content">新建企业信息</block>
  6. </cu-custom>
  7. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '修改企业信息'">
  8. <block slot="backText">返回</block>
  9. <block slot="content">修改企业信息</block>
  10. </cu-custom>
  11. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '查看企业信息'">
  12. <block slot="backText">返回</block>
  13. <block slot="content">查看企业信息</block>
  14. </cu-custom>
  15. <form @submit="formSubmit" class="cu-list menu">
  16. <view class="cu-form-group margin-top">
  17. <view class="title">
  18. <text class="red-color ">* </text> 企业名称
  19. </view>
  20. <input v-model="inputForm.name" placeholder="请填写企业名称" :disabled="ischeck"></input>
  21. </view>
  22. <view class="cu-form-group margin-top">
  23. <view class="title">
  24. <text class="red-color ">* </text>企业类型
  25. </view>
  26. <jp-picker v-model="inputForm.industry" rangeKey="label" rangeValue="value"
  27. :range="$dictUtils.getDictList('industrial_type')" :disabled="ischeck">
  28. <view class="picker">
  29. {{$dictUtils.getDictLabel('industrial_type', inputForm.industry ,'请选择')}}
  30. </view>
  31. </jp-picker>
  32. </view>
  33. <view class="cu-form-group margin-top">
  34. <view class="title">
  35. <text class="red-color ">* </text>所属楼宇
  36. </view>
  37. <picker @change="changeLYId" :value="lyIndex" :range="showLYList" :disabled="ischeck">
  38. <view class=" picker action">
  39. <view class="text-grey ">{{showLYList[lyIndex] || '请选择'}}</view>
  40. </view>
  41. </picker>
  42. </view>
  43. <view class="cu-form-group margin-top">
  44. <view class="title">
  45. <text class="red-color ">* </text>
  46. 入驻时间
  47. </view>
  48. <jp-datetime-picker v-model="inputForm.entryTime" mode="date" :disabled="ischeck"></jp-datetime-picker>
  49. </view>
  50. <view class="cu-form-group margin-top">
  51. <view class="title">
  52. 撤场时间
  53. </view>
  54. <jp-datetime-picker v-model="inputForm.des5" mode="date" :disabled="ischeck"></jp-datetime-picker>
  55. </view>
  56. <view class="cu-form-group margin-top">
  57. <view class="title">
  58. 办公面积(平)
  59. </view>
  60. <input v-model="inputForm.officeArea" placeholder="请填写办公面积" :disabled="ischeck"></input>
  61. </view>
  62. <!-- <view class="cu-form-group margin-top">
  63. <view class="title">
  64. 年租金(元)
  65. </view>
  66. <input v-model="inputForm.annualRent" placeholder="请填写年租金" :disabled="ischeck"></input>
  67. </view> -->
  68. <view class="cu-form-group margin-top">
  69. <view class="title">
  70. <text class="red-color ">* </text>
  71. 楼层
  72. </view>
  73. <input v-model="inputForm.floor" placeholder="请填写楼层" :disabled="ischeck"></input>
  74. </view>
  75. <view class="cu-form-group margin-top">
  76. <view class="title">
  77. <text class="red-color ">* </text>
  78. 房间号
  79. </view>
  80. <input v-model="inputForm.des3" placeholder="请填写房间号" :disabled="ischeck"></input>
  81. </view>
  82. <view class="cu-form-group margin-top">
  83. <view class="title">
  84. <text class="red-color ">* </text>
  85. 联系人
  86. </view>
  87. <input v-model="inputForm.lxr" placeholder="请填写联系人" :disabled="ischeck"></input>
  88. </view>
  89. <view class="cu-form-group margin-top">
  90. <view class="title">
  91. <text class="red-color ">* </text>
  92. 联系人手机
  93. </view>
  94. <input v-model="inputForm.phone" placeholder="请填写联系人手机" :disabled="ischeck"></input>
  95. </view>
  96. <view class="cu-form-group margin-top">
  97. <view class="title">
  98. <text class="red-color ">* </text>
  99. 合约起始时间
  100. </view>
  101. <jp-datetime-picker v-model="inputForm.htStime" mode="date" :disabled="ischeck"></jp-datetime-picker>
  102. </view>
  103. <view class="cu-form-group margin-top">
  104. <view class="title">
  105. <text class="red-color ">* </text>
  106. 合约到期时间
  107. </view>
  108. <jp-datetime-picker v-model="inputForm.htEtime" mode="date" :disabled="ischeck"></jp-datetime-picker>
  109. </view>
  110. <view class="cu-form-group margin-top">
  111. <view class="title">
  112. 主营内容
  113. </view>
  114. <input v-model="inputForm.businessContent" placeholder="请填写主营内容" :disabled="ischeck"></input>
  115. </view>
  116. <view class="cu-form-group margin-top">
  117. <view class="title">
  118. 用工总数
  119. </view>
  120. <input v-model="inputForm.totalNumber" placeholder="请填写用工总数" :disabled="ischeck" type="number"></input>
  121. </view>
  122. <view class="cu-form-group margin-top">
  123. <view class="title">
  124. 社保人数
  125. </view>
  126. <input v-model="inputForm.securityNumber" placeholder="请填写社保人数" :disabled="ischeck"
  127. type="number"></input>
  128. </view>
  129. <view class="cu-form-group margin-top">
  130. <view class="title">
  131. 男生人数
  132. </view>
  133. <input v-model="inputForm.des7" placeholder="请填写男生人数" :disabled="ischeck" type="number"></input>
  134. </view>
  135. <view class="cu-form-group margin-top">
  136. <view class="title">
  137. 女生人数
  138. </view>
  139. <input v-model="inputForm.des8" placeholder="请填写女生人数" :disabled="ischeck" type="number"></input>
  140. </view>
  141. <view class="cu-form-group margin-top">
  142. <view class="title">
  143. 党员人数
  144. </view>
  145. <input v-model="inputForm.des9" placeholder="请填写党员人数" :disabled="ischeck" type="number"></input>
  146. </view>
  147. <view class="cu-form-group margin-top">
  148. <view class="title">
  149. 本科以下人数
  150. </view>
  151. <input v-model="inputForm.belowUndergraduate" placeholder="请填写本科以下人数" :disabled="ischeck"
  152. type="number"></input>
  153. </view>
  154. <view class="cu-form-group margin-top">
  155. <view class="title">
  156. 本科人数
  157. </view>
  158. <input v-model="inputForm.undergraduate" placeholder="请填写本科人数" :disabled="ischeck"
  159. type="number"></input>
  160. </view>
  161. <view class="cu-form-group margin-top">
  162. <view class="title">
  163. 研究生人数
  164. </view>
  165. <input v-model="inputForm.postgraduate" placeholder="请填写研究生人数" :disabled="ischeck"
  166. type="number"></input>
  167. </view>
  168. <view class="cu-form-group margin-top">
  169. <view class="title">
  170. 博士生人数
  171. </view>
  172. <input v-model="inputForm.doctoralStudent" placeholder="请填写博士生人数" :disabled="ischeck"
  173. type="number"></input>
  174. </view>
  175. <view class="cu-form-group margin-top">
  176. <view class="title">
  177. 实用新型专利授权数
  178. </view>
  179. <input v-model="inputForm.num2" placeholder="请填写实用新型专利授权数" :disabled="ischeck" type="number"></input>
  180. </view>
  181. <view class="cu-form-group margin-top">
  182. <view class="title">
  183. 发明专利授权数
  184. </view>
  185. <input v-model="inputForm.num3" placeholder="请填写发明专利授权数" :disabled="ischeck" type="number"></input>
  186. </view>
  187. <view class="cu-form-group margin-top">
  188. <view class="title">
  189. 软著数
  190. </view>
  191. <input v-model="inputForm.softWritingNumbers" placeholder="请填写软著数" :disabled="ischeck"
  192. type="number"></input>
  193. </view>
  194. <view class="cu-form-group margin-top">
  195. <view class="title">
  196. 今年准备申报项目明细
  197. </view>
  198. <input v-model="inputForm.bz1" placeholder="请填写今年准备申报项目明细" :disabled="ischeck"></input>
  199. </view>
  200. <view class="cu-form-group margin-top">
  201. <view class="title">
  202. 今年项目认定明细
  203. </view>
  204. <input v-model="inputForm.bz2" placeholder="请填写今年项目认定明细" :disabled="ischeck"></input>
  205. </view>
  206. <view class="cu-form-group margin-top">
  207. <view class="title">
  208. 是否是国家高企
  209. </view>
  210. <jp-picker v-model="inputForm.bz3" rangeKey="label" rangeValue="value"
  211. :range="$dictUtils.getDictList('yes_no')" :disabled="ischeck">
  212. <view class="picker">
  213. {{$dictUtils.getDictLabel('yes_no', inputForm.bz3 ,'请选择')}}
  214. </view>
  215. </jp-picker>
  216. </view>
  217. <view class="cu-form-group margin-top">
  218. <view class="title">
  219. 意向哪年申报国家高企
  220. </view>
  221. <input v-model="inputForm.bz4" placeholder="请填写意向哪年申报国家高企" :disabled="ischeck"></input>
  222. </view>
  223. <view class="cu-form-group margin-top">
  224. <view class="title">
  225. 是否是规上企业
  226. </view>
  227. <jp-picker v-model="inputForm.bz5" rangeKey="label" rangeValue="value"
  228. :range="$dictUtils.getDictList('yes_no')" :disabled="ischeck">
  229. <view class="picker">
  230. {{$dictUtils.getDictLabel('yes_no', inputForm.bz5 ,'请选择')}}
  231. </view>
  232. </jp-picker>
  233. </view>
  234. <view class="cu-form-group margin-top">
  235. <view class="title">
  236. 什么时候能达到规上企业标准
  237. </view>
  238. <input v-model="inputForm.bz6" placeholder="请填写什么时候能达到规上企业标准" :disabled="ischeck"></input>
  239. </view>
  240. <view class="cu-form-group margin-top">
  241. <view class="title">
  242. 企业简介
  243. </view>
  244. <textarea v-model="inputForm.qyDes" placeholder="请填写企业简介" :disabled="ischeck"></textarea>
  245. </view>
  246. <view style="height: 40rpx;"></view>
  247. <view class="padding-xl" v-if="!ischeck">
  248. <button form-type="submit" class="cu-btn block bg-blue margin-tb-sm lg">提交</button>
  249. </view>
  250. </form>
  251. </view>
  252. </template>
  253. <script>
  254. var graceChecker = require("@/common/graceChecker.js");
  255. import revenueListService from '@/api/revenue/revenueListService'
  256. import loginService from '@/api/auth/loginService.js'
  257. export default {
  258. onShow() {
  259. // this.$auth.checkLogin()
  260. },
  261. data() {
  262. return {
  263. title: '新建企业信息',
  264. autoUpload: false,
  265. inputForm: {
  266. "id": "582ca566b9ea44778b7d9482af11b87e",
  267. "createDate": "2024-12-31 14:11:33",
  268. "createBy": {
  269. "id": "1858788038421487618",
  270. "admin": false,
  271. "roleIdList": [],
  272. "roleIds": "",
  273. "postIdList": [],
  274. "roleNames": ""
  275. },
  276. "updateDate": "2024-12-31 14:11:33",
  277. "updateBy": {
  278. "id": "1858788038421487618",
  279. "admin": false,
  280. "roleIdList": [],
  281. "roleIds": "",
  282. "postIdList": [],
  283. "roleNames": ""
  284. },
  285. "delFlag": 0,
  286. "name": "江苏阿顿智能科技有限公司",
  287. "industry": "4",
  288. "entryTime": "2022-04-01",
  289. "officeArea": "",
  290. "annualRent": "",
  291. "floor": "6",
  292. "lxr": "无",
  293. "phone": "18921876098",
  294. "des1": "fbb6ca3417804c4db5a5b635103a4a2c",
  295. "des2": "",
  296. "des3": "无",
  297. "htStime": "2022-04-01 00:00:00",
  298. "htEtime": "2025-03-31 00:00:00",
  299. "qyDes": "",
  300. "businessContent": "",
  301. "totalNumber": 1,
  302. "securityNumber": 1,
  303. "belowUndergraduate": 0,
  304. "undergraduate": 1,
  305. "postgraduate": 0,
  306. "doctoralStudent": 0,
  307. "num2": 0,
  308. "num3": 0,
  309. "softWritingNumbers": 0,
  310. "bz1": "",
  311. "bz2": "",
  312. "bz3": "",
  313. "bz4": "",
  314. "bz5": "",
  315. "bz6": "",
  316. "des5": "",
  317. "des6": "1",
  318. "des7": "1",
  319. "des8": "0",
  320. "des9": "0",
  321. "des10": "0",
  322. "des11": ""
  323. },
  324. parkList: [],
  325. ischeck: false,
  326. lyIndex: '',
  327. showLYList: [],
  328. }
  329. },
  330. created() {},
  331. mounted() {
  332. },
  333. onLoad(query) {
  334. console.log(query, '==============>query')
  335. if (query && query.ischeck) {
  336. this.ischeck = true
  337. this.title = "查看企业信息";
  338. }
  339. if (query && query.id && !query.ischeck) {
  340. this.title = "修改企业信息";
  341. }
  342. // this.getParkList(query)
  343. },
  344. methods: {
  345. getParkList(query) {
  346. loginService.list({
  347. current: 1,
  348. size: 1000000,
  349. }).then(({
  350. data
  351. }) => {
  352. this.parkList = data.records.map((item) => {
  353. return {
  354. label: item.buildingName,
  355. value: item.id
  356. }
  357. })
  358. this.showLYList = this.parkList.map(item => item.label)
  359. if (query && query.id) {
  360. loginService.queryByIdCom(query.id).then(({
  361. data
  362. }) => {
  363. this.inputForm = this.recover(this.inputForm, data)
  364. this.lyIndex = this.parkList.findIndex(item => item.value == this.inputForm
  365. .des1)
  366. console.log(this.lyIndex, '=====================>lyIndex')
  367. }).catch((e) => {
  368. })
  369. }
  370. }).catch(e => {
  371. console.log(e)
  372. })
  373. },
  374. changeLYId(e) {
  375. let index = e.detail.value
  376. this.lyIndex = index
  377. console.log(index, '===========>index')
  378. this.inputForm.des1 = this.parkList[index].value
  379. console.log(this.inputForm.des1, '===========>index')
  380. },
  381. formSubmit: function(e) {
  382. //定义表单规则
  383. var rule = [{
  384. name: "name",
  385. checkType: "notnull",
  386. checkRule: "",
  387. errorMsg: "请填写企业名称"
  388. }, {
  389. name: "industry",
  390. checkType: "notnull",
  391. checkRule: "",
  392. errorMsg: "请选择企业类型"
  393. }, {
  394. name: "des1",
  395. checkType: "notnull",
  396. checkRule: "",
  397. errorMsg: "请选择所属楼宇"
  398. },
  399. {
  400. name: "entryTime",
  401. checkType: "notnull",
  402. checkRule: "",
  403. errorMsg: "请选择入驻时间"
  404. },
  405. {
  406. name: "floor",
  407. checkType: "notnull",
  408. checkRule: "",
  409. errorMsg: "请填写楼层"
  410. },
  411. {
  412. name: "des3",
  413. checkType: "notnull",
  414. checkRule: "",
  415. errorMsg: "请填写房间号"
  416. },
  417. {
  418. name: "lxr",
  419. checkType: "notnull",
  420. checkRule: "",
  421. errorMsg: "请填写联系人"
  422. },
  423. {
  424. name: "phone",
  425. checkType: "notnull",
  426. checkRule: "",
  427. errorMsg: "请填写联系人手机"
  428. },
  429. {
  430. name: "htStime",
  431. checkType: "notnull",
  432. checkRule: "",
  433. errorMsg: "请填写合约起始时间"
  434. },
  435. {
  436. name: "htEtime",
  437. checkType: "notnull",
  438. checkRule: "",
  439. errorMsg: "请填写合约到期时间"
  440. },
  441. ];
  442. //进行表单检查
  443. var formData = this.inputForm;
  444. var checkRes = graceChecker.check(formData, rule);
  445. console.log(checkRes, '===================>checkRes')
  446. if (checkRes) {
  447. uni.showLoading()
  448. loginService.comSave(this.inputForm).then(({
  449. data
  450. }) => {
  451. uni.showToast({
  452. title: data,
  453. icon: "success"
  454. });
  455. uni.navigateTo({
  456. url: '/pages/comList/comList'
  457. })
  458. }).catch((e) => {
  459. })
  460. } else {
  461. uni.showToast({
  462. title: graceChecker.error,
  463. icon: "none"
  464. });
  465. }
  466. }
  467. }
  468. }
  469. </script>
  470. <style>
  471. /* .file-title) {
  472. font-size: 17px !important;
  473. } */
  474. input,
  475. textarea {
  476. color: #8799a3;
  477. }
  478. </style>