comEdit.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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"
  134. type="number"></input>
  135. </view>
  136. <view class="cu-form-group margin-top">
  137. <view class="title">
  138. 女生人数
  139. </view>
  140. <input v-model="inputForm.des8" placeholder="请填写女生人数" :disabled="ischeck"
  141. type="number"></input>
  142. </view>
  143. <view class="cu-form-group margin-top">
  144. <view class="title">
  145. 党员人数
  146. </view>
  147. <input v-model="inputForm.des9" placeholder="请填写党员人数" :disabled="ischeck"
  148. type="number"></input>
  149. </view>
  150. <view class="cu-form-group margin-top">
  151. <view class="title">
  152. 本科以下人数
  153. </view>
  154. <input v-model="inputForm.belowUndergraduate" placeholder="请填写本科以下人数" :disabled="ischeck"
  155. type="number"></input>
  156. </view>
  157. <view class="cu-form-group margin-top">
  158. <view class="title">
  159. 本科人数
  160. </view>
  161. <input v-model="inputForm.undergraduate" placeholder="请填写本科人数" :disabled="ischeck"
  162. type="number"></input>
  163. </view>
  164. <view class="cu-form-group margin-top">
  165. <view class="title">
  166. 研究生人数
  167. </view>
  168. <input v-model="inputForm.postgraduate" placeholder="请填写研究生人数" :disabled="ischeck"
  169. type="number"></input>
  170. </view>
  171. <view class="cu-form-group margin-top">
  172. <view class="title">
  173. 博士生人数
  174. </view>
  175. <input v-model="inputForm.doctoralStudent" placeholder="请填写博士生人数" :disabled="ischeck"
  176. type="number"></input>
  177. </view>
  178. <view class="cu-form-group margin-top">
  179. <view class="title">
  180. 实用新型专利授权数
  181. </view>
  182. <input v-model="inputForm.num2" placeholder="请填写实用新型专利授权数" :disabled="ischeck" type="number"></input>
  183. </view>
  184. <view class="cu-form-group margin-top">
  185. <view class="title">
  186. 发明专利授权数
  187. </view>
  188. <input v-model="inputForm.num3" placeholder="请填写发明专利授权数" :disabled="ischeck" type="number"></input>
  189. </view>
  190. <view class="cu-form-group margin-top">
  191. <view class="title">
  192. 软著数
  193. </view>
  194. <input v-model="inputForm.softWritingNumbers" placeholder="请填写软著数" :disabled="ischeck"
  195. type="number"></input>
  196. </view>
  197. <view class="cu-form-group margin-top">
  198. <view class="title">
  199. 今年准备申报项目明细
  200. </view>
  201. <input v-model="inputForm.bz1" placeholder="请填写今年准备申报项目明细" :disabled="ischeck"></input>
  202. </view>
  203. <view class="cu-form-group margin-top">
  204. <view class="title">
  205. 今年项目认定明细
  206. </view>
  207. <input v-model="inputForm.bz2" placeholder="请填写今年项目认定明细" :disabled="ischeck"></input>
  208. </view>
  209. <view class="cu-form-group margin-top">
  210. <view class="title">
  211. 是否是国家高企
  212. </view>
  213. <jp-picker v-model="inputForm.bz3" rangeKey="label" rangeValue="value"
  214. :range="$dictUtils.getDictList('yes_no')" :disabled="ischeck">
  215. <view class="picker">
  216. {{$dictUtils.getDictLabel('yes_no', inputForm.bz3 ,'请选择')}}
  217. </view>
  218. </jp-picker>
  219. </view>
  220. <view class="cu-form-group margin-top">
  221. <view class="title">
  222. 意向哪年申报国家高企
  223. </view>
  224. <input v-model="inputForm.bz4" placeholder="请填写意向哪年申报国家高企" :disabled="ischeck"></input>
  225. </view>
  226. <view class="cu-form-group margin-top">
  227. <view class="title">
  228. 是否是规上企业
  229. </view>
  230. <jp-picker v-model="inputForm.bz5" rangeKey="label" rangeValue="value"
  231. :range="$dictUtils.getDictList('yes_no')" :disabled="ischeck">
  232. <view class="picker">
  233. {{$dictUtils.getDictLabel('yes_no', inputForm.bz5 ,'请选择')}}
  234. </view>
  235. </jp-picker>
  236. </view>
  237. <view class="cu-form-group margin-top">
  238. <view class="title">
  239. 什么时候能达到规上企业标准
  240. </view>
  241. <input v-model="inputForm.bz6" placeholder="请填写什么时候能达到规上企业标准" :disabled="ischeck"></input>
  242. </view>
  243. <view class="cu-form-group margin-top">
  244. <view class="title">
  245. 企业简介
  246. </view>
  247. <textarea v-model="inputForm.qyDes" placeholder="请填写企业简介" :disabled="ischeck"></textarea>
  248. </view>
  249. <view style="height: 40rpx;"></view>
  250. <view class="padding-xl" v-if="!ischeck">
  251. <button form-type="submit" class="cu-btn block bg-blue margin-tb-sm lg">提交</button>
  252. </view>
  253. </form>
  254. </view>
  255. </template>
  256. <script>
  257. var graceChecker = require("@/common/graceChecker.js");
  258. import revenueListService from '@/api/revenue/revenueListService'
  259. import loginService from '@/api/auth/loginService.js'
  260. export default {
  261. onShow() {
  262. this.$auth.checkLogin()
  263. },
  264. data() {
  265. return {
  266. title: '新建企业信息',
  267. autoUpload: false,
  268. inputForm: {
  269. id: '',
  270. name: '',
  271. industry: '',
  272. des1: '',
  273. des2: '',
  274. des3: '',
  275. entryTime: '',
  276. officeArea: '',
  277. annualRent: '',
  278. floor: '',
  279. lxr: '',
  280. phone: '',
  281. htStime: '',
  282. htEtime: '',
  283. qyDes: '',
  284. businessContent: '',
  285. totalNumber: '',
  286. securityNumber: '',
  287. belowUndergraduate: '',
  288. undergraduate: '',
  289. postgraduate: '',
  290. doctoralStudent: '',
  291. qyDes: '',
  292. num2: '',
  293. num3: '',
  294. softWritingNumbers: '',
  295. bz1: '',
  296. bz2: '',
  297. bz3: '',
  298. bz4: '',
  299. bz5: '',
  300. bz6: '',
  301. des5: '',
  302. des7: '',
  303. des8: '',
  304. des9: '',
  305. },
  306. parkList: [],
  307. ischeck: false,
  308. lyIndex: '',
  309. showLYList: [],
  310. }
  311. },
  312. created() {
  313. },
  314. mounted() {
  315. },
  316. onLoad(query) {
  317. console.log(query, '==============>query')
  318. if (query && query.ischeck) {
  319. this.ischeck = true
  320. this.title = "查看企业信息";
  321. }
  322. if (query && query.id && !query.ischeck) {
  323. this.title = "修改企业信息";
  324. }
  325. this.getParkList(query)
  326. },
  327. methods: {
  328. getParkList(query) {
  329. loginService.list({
  330. current: 1,
  331. size: 1000000,
  332. }).then(({
  333. data
  334. }) => {
  335. this.parkList = data.records.map((item) => {
  336. return {
  337. label: item.buildingName,
  338. value: item.id
  339. }
  340. })
  341. this.showLYList = this.parkList.map(item => item.label)
  342. if (query && query.id) {
  343. loginService.queryByIdCom(query.id).then(({
  344. data
  345. }) => {
  346. this.inputForm = this.recover(this.inputForm, data)
  347. this.lyIndex = this.parkList.findIndex(item => item.value == this.inputForm.des1)
  348. console.log(this.lyIndex, '=====================>lyIndex')
  349. }).catch((e) => {
  350. })
  351. }
  352. }).catch(e => {
  353. console.log(e)
  354. })
  355. },
  356. changeLYId(e){
  357. let index = e.detail.value
  358. this.lyIndex = index
  359. console.log(index, '===========>index')
  360. this.inputForm.des1 = this.parkList[index].value
  361. console.log(this.inputForm.des1, '===========>index')
  362. },
  363. formSubmit: function(e) {
  364. //定义表单规则
  365. var rule = [{
  366. name: "name",
  367. checkType: "notnull",
  368. checkRule: "",
  369. errorMsg: "请填写企业名称"
  370. },{
  371. name: "industry",
  372. checkType: "notnull",
  373. checkRule: "",
  374. errorMsg: "请选择企业类型"
  375. },{
  376. name: "des1",
  377. checkType: "notnull",
  378. checkRule: "",
  379. errorMsg: "请选择所属楼宇"
  380. },
  381. {
  382. name: "entryTime",
  383. checkType: "notnull",
  384. checkRule: "",
  385. errorMsg: "请选择入驻时间"
  386. },
  387. {
  388. name: "floor",
  389. checkType: "notnull",
  390. checkRule: "",
  391. errorMsg: "请填写楼层"
  392. },
  393. {
  394. name: "des3",
  395. checkType: "notnull",
  396. checkRule: "",
  397. errorMsg: "请填写房间号"
  398. },
  399. {
  400. name: "lxr",
  401. checkType: "notnull",
  402. checkRule: "",
  403. errorMsg: "请填写联系人"
  404. },
  405. {
  406. name: "phone",
  407. checkType: "notnull",
  408. checkRule: "",
  409. errorMsg: "请填写联系人手机"
  410. },
  411. {
  412. name: "htStime",
  413. checkType: "notnull",
  414. checkRule: "",
  415. errorMsg: "请填写合约起始时间"
  416. },
  417. {
  418. name: "htEtime",
  419. checkType: "notnull",
  420. checkRule: "",
  421. errorMsg: "请填写合约到期时间"
  422. },
  423. ];
  424. //进行表单检查
  425. var formData = this.inputForm;
  426. var checkRes = graceChecker.check(formData, rule);
  427. console.log(checkRes, '===================>checkRes')
  428. if (checkRes) {
  429. uni.showLoading()
  430. loginService.comSave(this.inputForm).then(({
  431. data
  432. }) => {
  433. uni.showToast({
  434. title: data,
  435. icon: "success"
  436. });
  437. uni.navigateTo({
  438. url: '/pages/comList/comList'
  439. })
  440. }).catch((e) => {
  441. })
  442. } else {
  443. uni.showToast({
  444. title: graceChecker.error,
  445. icon: "none"
  446. });
  447. }
  448. }
  449. }
  450. }
  451. </script>
  452. <style>
  453. /* .file-title) {
  454. font-size: 17px !important;
  455. } */
  456. input,textarea{
  457. color: #8799a3;
  458. }
  459. </style>