管理系统PC端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

operate_edit.vue 11 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <div class="home_wrapper">
  3. <van-nav-bar
  4. title="经营信息维护"
  5. left-arrow
  6. placeholder
  7. safe-area-inset-top
  8. @click-left="onClickLeft"
  9. />
  10. <van-form @submit="onSubmit">
  11. <div class="main">
  12. <p class="title"><i></i>经营信息</p>
  13. <van-field readonly v-model="form.deptName" label="区域位置名称" placeholder="请输入" input-align="right" label-width="auto" />
  14. <van-field readonly required :rules="[{ required: true }]" v-model="form.dkbm" label="地块编码" placeholder="请输入" input-align="right" label-width="auto" />
  15. <van-field readonly :rules="[{ required: true }]" v-model="form.dkmc" label="地块名称" placeholder="请输入" input-align="right" label-width="auto" required />
  16. <van-field readonly v-model="form.dkdz" label="地块东至" placeholder="请输入" input-align="right" label-width="auto" />
  17. <van-field readonly v-model="form.dkxz" label="地块西至" placeholder="请输入" input-align="right" label-width="auto" />
  18. <van-field readonly v-model="form.dknz" label="地块南至" placeholder="请输入" input-align="right" label-width="auto" />
  19. <van-field readonly v-model="form.dkbz" label="地块北至" placeholder="请输入" input-align="right" label-width="auto" />
  20. <van-field required :rules="[{ required: true }]" v-model="form.jymj" label="经营面积" placeholder="请输入" input-align="right" label-width="auto" />
  21. <van-field required :rules="[{ required: true }]" readonly @click="showJyfsPicker = true" v-model="form.jyfsText" label="经营方式" placeholder="请输入" input-align="right" label-width="auto" />
  22. <van-popup v-model="showJyfsPicker" round position="bottom">
  23. <van-picker
  24. show-toolbar
  25. :columns="dict.type.jyfs"
  26. value-key="label"
  27. @cancel="showJyfsPicker = false"
  28. @confirm="onConfirmJyfs"
  29. />
  30. </van-popup>
  31. <van-field readonly @click="showJydxlxPicker = true" v-model="form.jydxlxText" label="经营对象类型" placeholder="请输入" input-align="right" label-width="auto" />
  32. <van-popup v-model="showJydxlxPicker" round position="bottom">
  33. <van-picker
  34. show-toolbar
  35. :columns="dict.type.jydxlx"
  36. value-key="label"
  37. @cancel="showJydxlxPicker = false"
  38. @confirm="onConfirmJydxlx"
  39. />
  40. </van-popup>
  41. <van-field required :rules="[{ required: true }]" v-model="form.jydxmc" label="经营对象名称" placeholder="请输入" input-align="right" label-width="auto" />
  42. <van-field readonly @click="showJydxzjlxPicker = true" v-model="form.jydxzjlxText" label="经营对象证件类型" placeholder="请输入" input-align="right" label-width="auto" />
  43. <van-popup v-model="showJydxzjlxPicker" round position="bottom">
  44. <van-picker
  45. show-toolbar
  46. :columns="dict.type.zjlx"
  47. value-key="label"
  48. @cancel="showJydxzjlxPicker = false"
  49. @confirm="onConfirmJydxzjlx"
  50. />
  51. </van-popup>
  52. <van-field v-model="form.jydxzjhm" label="经营对象证件号码" placeholder="请输入" input-align="right" label-width="auto" />
  53. <van-field readonly @click="showSfqdhtPicker = true" v-model="form.sfqdhtText" label="是否签订合同" placeholder="请输入" input-align="right" label-width="auto" />
  54. <van-popup v-model="showSfqdhtPicker" round position="bottom">
  55. <van-picker
  56. show-toolbar
  57. :columns="dict.type.is_common"
  58. value-key="label"
  59. @cancel="showSfqdhtPicker = false"
  60. @confirm="onConfirmSfqdht"
  61. />
  62. </van-popup>
  63. <van-field required :rules="[{ required: true }]" readonly @click="showJykssjPicker = true" v-model="form.jykssj" label="经营开始时间" placeholder="请输入" input-align="right" label-width="auto" />
  64. <van-popup v-model="showJykssjPicker" round position="bottom">
  65. <van-datetime-picker
  66. v-model="jykssj"
  67. type="date"
  68. title="选择年月日"
  69. :min-date="minDate"
  70. :max-date="maxDate"
  71. @cancel="showJykssjPicker = false"
  72. @confirm="onConfirmJykssj"
  73. />
  74. </van-popup>
  75. <van-field required :rules="[{ required: true }]" readonly @click="showJyjssjPicker = true" v-model="form.jyjssj" label="经营结束时间" placeholder="请输入" input-align="right" label-width="auto" />
  76. <van-popup v-model="showJyjssjPicker" round position="bottom">
  77. <van-datetime-picker
  78. v-model="jyjssj"
  79. type="date"
  80. title="选择年月日"
  81. :min-date="minDate"
  82. :max-date="maxDate"
  83. @cancel="showJyjssjPicker = false"
  84. @confirm="onConfirmJyjssj"
  85. />
  86. </van-popup>
  87. <van-field required :rules="[{ required: true }]" v-model="form.cbje" label="承包金额(元)" placeholder="请输入" input-align="right" label-width="auto" />
  88. <van-field v-model="form.dxje" label="兑现金额(元)" placeholder="请输入" input-align="right" label-width="auto" />
  89. <van-field v-model="form.sqje" label="尚欠金额(元)" placeholder="请输入" input-align="right" label-width="auto" />
  90. <van-field v-model="form.nsy" label="年收益(元)" placeholder="请输入" input-align="right" label-width="auto" />
  91. <van-field v-model="form.bzxx" label="备注信息" placeholder="请输入" input-align="right" label-width="auto" />
  92. <van-field readonly label="实物图" placeholder="" input-align="right" label-width="auto" />
  93. <image-upload v-model="form.dkImg"/>
  94. <van-field readonly required :rules="[{ required: true }]" @click="showSurveyStatusPicker = true" v-model="form.surveyStatusText" label="调查状态" placeholder="请输入" input-align="right" label-width="auto" />
  95. <van-popup v-model="showSurveyStatusPicker" round position="bottom">
  96. <van-picker
  97. show-toolbar
  98. :columns="dict.type.survey_status"
  99. value-key="label"
  100. @cancel="showSurveyStatusPicker = false"
  101. @confirm="onConfirmSurveyStatus"
  102. />
  103. </van-popup>
  104. </div>
  105. <van-button round block type="primary" native-type="submit" class="subClass">提交</van-button>
  106. </van-form>
  107. </div>
  108. </template>
  109. <script>
  110. // import { getMenuApp } from "@/api/app/index";
  111. import Cookies from "js-cookie";
  112. import { getLandDetail } from "@/api/resource/land"
  113. import { getOperation, getOperationDetail, updateOperation, addOperation } from "@/api/resource/operation"
  114. import {getInfoByImportCode} from "@/api/system/dept";
  115. export default {
  116. dicts: ['zjlx', 'survey_status', 'is_common', 'jydxlx', 'jyfs'],
  117. name: "appEdit",
  118. data() {
  119. return {
  120. showJyfsPicker: false,
  121. showSfqdhtPicker: false,
  122. showJydxlxPicker: false,
  123. showJydxzjlxPicker: false,
  124. showJykssjPicker: false,
  125. showJyjssjPicker: false,
  126. showSurveyStatusPicker: false,
  127. minDate: new Date(2020, 0, 1),
  128. maxDate: new Date(2025, 10, 1),
  129. form: {},
  130. jykssj:new Date(),
  131. jyjssj:new Date(),
  132. openPic: [],
  133. openPic2: [],
  134. };
  135. },
  136. created() {
  137. this.getDetail()
  138. },
  139. methods: {
  140. onClickLeft(){
  141. history.back(-1);
  142. },
  143. getDetail(){
  144. getOperationDetail(this.$route.query.dkbm).then(response => {
  145. if (response.data){
  146. response.data.jyfsText = this.selectDictLabel(this.dict.type.jyfs,response.data.jyfs);
  147. response.data.jydxlxText = this.selectDictLabel(this.dict.type.jydxlx,response.data.jydxlx);
  148. response.data.jydxzjlxText = this.selectDictLabel(this.dict.type.zjlx,response.data.jydxzjlx);
  149. response.data.sfqdhtText = this.selectDictLabel(this.dict.type.is_common,response.data.sfqdht);
  150. response.data.surveyStatusText = this.selectDictLabel(this.dict.type.survey_status,response.data.surveyStatus);
  151. this.jykssj = new Date(response.data.jykssj);
  152. this.jyjssj = new Date(response.data.jyjssj);
  153. this.form = response.data
  154. }else{
  155. getLandDetail(this.$route.query.dkbm).then(response => {
  156. this.form = response.data
  157. })
  158. }
  159. // getInfoByImportCode(response.data.importCode).then((res) => {
  160. // this.form.deptId = res.data.deptId
  161. // });
  162. });
  163. },
  164. onConfirmJydxlx(value) {
  165. this.form.jydxlxText = value.label;
  166. this.form.jydxlx = value.value;
  167. this.showJydxlxPicker = false;
  168. },
  169. onConfirmJyfs(value) {
  170. this.form.jyfsText = value.label;
  171. this.form.jyfs = value.value;
  172. this.showJyfsPicker = false;
  173. },
  174. onConfirmJydxzjlx(value) {
  175. this.form.jydxzjlxText = value.label;
  176. this.form.jydxzjlx = value.value;
  177. this.showJydxzjlxPicker = false;
  178. },
  179. onConfirmSfqdht(value) {
  180. this.form.sfqdhtText = value.label;
  181. this.form.sfqdht = value.value;
  182. this.showSfqdhtPicker = false;
  183. },
  184. onConfirmJykssj(data) {
  185. this.form.jykssj = this.format(data, 'yyyy-MM-dd');
  186. this.showJykssjPicker = false;
  187. },
  188. onConfirmJyjssj(data) {
  189. this.form.jyjssj = this.format(data, 'yyyy-MM-dd');
  190. this.showJyjssjPicker = false;
  191. },
  192. onConfirmSurveyStatus(value) {
  193. this.form.surveyStatusText = value.label;
  194. this.form.surveyStatus = value.value;
  195. this.showSurveyStatusPicker = false;
  196. },
  197. /** 提交按钮 */
  198. onSubmit() {
  199. if (!this.form.id){
  200. addOperation(this.form).then(response => {
  201. this.$modal.msgSuccess("新增成功")
  202. setTimeout(function(){
  203. history.back(-1);
  204. },2000)
  205. })
  206. }else{
  207. updateOperation(this.form).then(response => {
  208. if (response.code == 200){
  209. this.$modal.msgSuccess("修改成功")
  210. setTimeout(function(){
  211. history.back(-1);
  212. },2000)
  213. }
  214. })
  215. }
  216. },
  217. },
  218. };
  219. </script>
  220. <style scoped lang="scss">
  221. p{margin: 0;}
  222. .home_wrapper{
  223. width: 100vw;
  224. min-height: 100vh;
  225. background: #F6F9FB;
  226. padding-bottom: 5vh;
  227. }
  228. .van-nav-bar{
  229. background: linear-gradient( 173deg, #91E2D3 0%, #CDFCF0 100%);
  230. ::v-deep.van-icon{
  231. color: #000000;
  232. }
  233. }
  234. .main{
  235. width: 94%;
  236. margin: 3vw auto;
  237. padding: 3vw;
  238. background-color: #ffffff;
  239. border-radius: 10px;
  240. overflow: hidden;
  241. }
  242. .title{
  243. display: flex;
  244. align-items: center;
  245. font-size: 20px;
  246. font-weight: bold;
  247. margin-bottom: 10px;
  248. i{
  249. width: 5px;
  250. height: 20px;
  251. display: block;
  252. background-color: #29D2AF;
  253. margin-right: 10px;
  254. }
  255. }
  256. .subClass{
  257. background: linear-gradient( 270deg, #53E4A5 0%, #24DBDB 100%);
  258. border-radius: 50px 50px 50px 50px;
  259. border: none;
  260. width: 90%;
  261. margin: 3vw auto;
  262. height: 50px;
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. color: #ffffff;
  267. font-size: 18px;
  268. }
  269. </style>