index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. <template>
  2. <view :class="[AppTheme]" class="all_box">
  3. <view class="content_box">
  4. <view class="content_detail_1">
  5. <view class="detail_title_1">
  6. <view class="detail_title_p1">
  7. <image class="image" :src="storelist.pic" mode=""></image>
  8. </view>
  9. <view class="detail_title_p2">
  10. <view class="detail_title_p3">{{storelist.name}}</view>
  11. <view class="detail_title_p4">
  12. {{storelist.renyantime}}
  13. </view>
  14. <view>
  15. <u-line-progress :percentage="storelist.munber" activeColor="#ff0000"></u-line-progress>
  16. </view>
  17. <view class="fram_oper_1">
  18. <view class="fram_oper_2">
  19. <view class="views1">品种</view>
  20. <view class="views1">周期</view>
  21. <view class="views1">收获</view>
  22. </view>
  23. <view class="fram_oper_2">
  24. <view class="views1">{{storelist.vname}}</view>
  25. <view class="views1">{{storelist.cycle}}天</view>
  26. <view class="views1">{{storelist.bonusway}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="farm_name_4">
  33. <view class="farm_name_7" @click="pkxunzhe">
  34. <view class="farm_name_5">
  35. 操作类型
  36. </view>
  37. <view class="farm_name_6">
  38. {{operatorname}}
  39. <u-icon name="arrow-right" :bold="true" color="#999" size="18"></u-icon>
  40. </view>
  41. </view>
  42. <view class="bor_solp"></view>
  43. <view class="farm_name_7" @click="pkxun">
  44. <view class="farm_name_5">
  45. 操作详情
  46. </view>
  47. <view class="farm_name_6">
  48. {{operatorname2}}
  49. <u-icon name="arrow-right" :bold="true" color="#999" size="18" ></u-icon>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="content_detail">
  54. <view class="detail_text">
  55. <textarea v-model="form.describe" class="detail_ipt" type="text" placeholder="请输入备注" />
  56. </view>
  57. <view class="content_detail_img">
  58. <view v-if="detailimg.length!=0" class="detail_img" v-for="(item,index) in detailimg" :key="index"
  59. @click="preview(item,index)">
  60. <image class="image" :src="item" mode=""></image>
  61. <u-icon @click="deleteimg(index)" class="delete_img" name="close-circle" color="#fff" size="20">
  62. </u-icon>
  63. </view>
  64. <view class="detail_img" @click="uploadlogo(2)">
  65. <u-icon class="icon_plus" name="plus" size="50"></u-icon>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="submit bg-linear-gradient" @click="submit">记录</view>
  70. </view>
  71. <u-picker :show="show" :columns="columns" @cancel='cancel' @confirm='confirm' keyName="label"></u-picker>
  72. <u-picker :show="show1" :columns="columns1" @cancel='cancel1' @confirm='confirm1' keyName="label"></u-picker>
  73. <!-- <u-modal :show="show1" :title="title" :content='content' @confirm='confirmmodel'></u-modal> -->
  74. </view>
  75. </template>
  76. <script>
  77. import mineApi from "@/api/mine/index.js"
  78. import {
  79. pathToBase64
  80. } from "@/js/pathto64.js"
  81. export default {
  82. data() {
  83. return {
  84. primary: this.$theme.primary,
  85. settingFile: getApp().globalData.siteinfo,
  86. soil: '',
  87. detailimg: [], //农场描述附加图
  88. //表单数据
  89. form: {
  90. describe: "", //农场描述
  91. detailimg: [] //农场描述附加图
  92. },
  93. columns: [],
  94. columns1: [],
  95. show: false,
  96. show1: false,
  97. storelist: '',
  98. operatorname: '',
  99. operatorname2:'',
  100. id:''
  101. }
  102. },
  103. onLoad(options) {
  104. this.id = options.id
  105. this.finantype()
  106. },
  107. methods: {
  108. finantype() {
  109. mineApi.finantype({
  110. id: this.id
  111. })
  112. .then(res => {
  113. this.storelist = res.data;
  114. this.columns = res.data.lable1;
  115. this.operatorname = res.data.lable1[0][0].label;
  116. this.columns1= res.data.lable1[0][0].lable2;
  117. console.log(res.data.lable1[0][0].lable2[0][0].label,'this.columns2')
  118. this.operatorname2 = res.data.lable1[0][0].lable2[0][0].label;
  119. })
  120. },
  121. confirmmodel() {
  122. this.show1 = false
  123. uni.navigateTo({
  124. url: '/pagesD/pages/inspection/inspection'
  125. })
  126. },
  127. confirm(e) {
  128. console.log(e, 'eeeeeee')
  129. this.show = false
  130. this.id = e.value[0].id
  131. this.operatorname = e.value[0].label
  132. this.operatorname2 = e.value[0].lable2[0][0].label;
  133. this.columns1= e.value[0].lable2;
  134. },
  135. confirm1(e){
  136. this.show1= false
  137. this.operatorname2 = e.value[0].label
  138. },
  139. cancel() {
  140. this.show = false
  141. },
  142. cancel1() {
  143. this.show1 = false
  144. },
  145. pkxunzhe() {
  146. this.show = true
  147. },
  148. pkxun() {
  149. this.show1 = true
  150. },
  151. preview(url, idx) { //预览图片
  152. uni.previewImage({
  153. current: idx,
  154. urls: this.detailimg,
  155. success: function(res) {
  156. console.log(res, '预览')
  157. },
  158. fail: function(res) {
  159. console.log(res, '00000')
  160. }
  161. })
  162. },
  163. deleteimg(idx) { //图片删除
  164. this.detailimg.splice(idx, 1)
  165. this.form.detailimg.splice(idx, 1)
  166. },
  167. //提交资料
  168. submit() {
  169. let data = {
  170. orderid: this.storelist.orderid,//订单表id
  171. operator_name: this.operatorname,
  172. type_name: this.operatorname2,
  173. detail_img: this.form.detailimg,
  174. remark: this.form.describe,
  175. operid: this.storelist.operid,
  176. work_id: this.storelist.work_id,
  177. finance_id: this.storelist.goodid,
  178. farm_id: this.storelist.farm_id,
  179. name:this.storelist.opername
  180. }
  181. mineApi.getfinance(data)
  182. .then(res => {
  183. if (res.status === 1) {
  184. uni.showToast({
  185. title: res.msg,
  186. icon: "none"
  187. })
  188. setTimeout(() => {
  189. uni.redirectTo({
  190. url: '/pagesD/pages/financeoperator/financeoperator'
  191. })
  192. }, 1000)
  193. } else {
  194. uni.showToast({
  195. title: res.msg,
  196. icon: "none"
  197. })
  198. }
  199. })
  200. .catch(error => {
  201. console.log(error, 'error')
  202. })
  203. },
  204. //上传Logo和农场描述附加图
  205. uploadlogo(num) {
  206. let that = this
  207. // #ifdef MP
  208. uni.chooseImage({
  209. count: 9,
  210. success: function(res) {
  211. res.tempFilePaths.forEach(ele => {
  212. that.detailimg.push(ele)
  213. uni.getFileSystemManager().readFile({
  214. filePath: ele,
  215. encoding: 'base64',
  216. success: function(ress) {
  217. //返回不带data:image/jpeg;base64,'头的base64格式
  218. let imageurl = 'data:image/jpeg;base64,' + ress
  219. .data;
  220. that.form.detailimg.push(imageurl)
  221. }
  222. })
  223. })
  224. }
  225. })
  226. // #endif
  227. // #ifdef APP||H5
  228. uni.chooseImage({
  229. count: 9,
  230. success: function(res) {
  231. res.tempFilePaths.forEach(ele => {
  232. that.detailimg.push(ele)
  233. pathToBase64(res.tempFilePaths[0]).then(base64 => {
  234. console.log(base64, "base64")
  235. that.form.detailimg.push(base64)
  236. })
  237. })
  238. },
  239. fail: function(res) {
  240. }
  241. })
  242. // #endif
  243. },
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .all_box {
  249. // background-color: #ffffff;
  250. .step_bar {
  251. padding: 50rpx;
  252. padding-bottom: 80rpx;
  253. color: #fff;
  254. }
  255. .reason {
  256. background-color: #f97c00;
  257. color: #fff;
  258. line-height: 50rpx;
  259. padding: 0 20rpx;
  260. .reason_text {
  261. overflow: hidden;
  262. text-overflow: ellipsis;
  263. white-space: nowrap;
  264. }
  265. }
  266. .content_box {
  267. padding-bottom: 20rpx;
  268. .farm_name_4 {
  269. width: 90%;
  270. margin-left: 2.5%;
  271. display: flex;
  272. flex-direction: column;
  273. // align-items: center;
  274. padding: 20rpx 20rpx;
  275. background: #fff;
  276. border-radius: 10upx;
  277. margin-top: 20rpx;
  278. .farm_name_7 {
  279. display: flex;
  280. justify-content: space-between;
  281. }
  282. .farm_name_5 {
  283. display: flex;
  284. justify-content: flex-start;
  285. align-items: center;
  286. image {
  287. width: 45rpx;
  288. height: 45rpx;
  289. }
  290. font-size: 32rpx;
  291. }
  292. .farm_name_6 {
  293. display: flex;
  294. justify-content: flex-start;
  295. align-items: center;
  296. color: #999;
  297. font-size: 26rpx;
  298. margin-right: 2vh;
  299. }
  300. }
  301. .content_detail_1 {
  302. width: 90%;
  303. margin-left: 2.5%;
  304. margin-top: 20rpx;
  305. border-radius: 10upx;
  306. background-color: #ffffff;
  307. padding: 20rpx;
  308. .detail_text_p1 {
  309. padding: 30rpx 0 0 0;
  310. // color: #999;
  311. .detail_text_p2 {
  312. padding: 20rpx 0;
  313. }
  314. }
  315. .detail_title_1 {
  316. display: flex;
  317. justify-content: flex-start;
  318. align-items: center;
  319. .detail_title_p1 {
  320. width: 35%;
  321. .image {
  322. border-radius: 10rpx;
  323. width: 200rpx;
  324. height: 200rpx;
  325. }
  326. }
  327. .detail_title_p2 {
  328. width: 65%;
  329. .detail_title_p3 {
  330. padding: 20rpx 0;
  331. font-size: 32rpx;
  332. line-height: 45rpx;
  333. }
  334. .detail_title_p4 {
  335. margin-bottom: 20rpx;
  336. }
  337. .detail_title_p4 {
  338. -webkit-line-clamp: 2;
  339. display: -webkit-box;
  340. -webkit-box-orient: vertical;
  341. overflow: hidden;
  342. text-overflow: ellipsis;
  343. }
  344. .fram_oper_1 {
  345. display: flex;
  346. flex-direction: column;
  347. .fram_oper_2 {
  348. display: flex;
  349. justify-content: space-between;
  350. align-items: center;
  351. padding: 10rpx 0;
  352. .views1 {
  353. font-size: 28rpx;
  354. width: 20%;
  355. -webkit-line-clamp: 1;
  356. display: -webkit-box;
  357. -webkit-box-orient: vertical;
  358. overflow: hidden;
  359. text-overflow: ellipsis;
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. // margin: 20rpx;
  367. .content_detail {
  368. margin: 15rpx;
  369. background: #fff;
  370. border-radius: 10upx;
  371. .detail_title {
  372. font-weight: 700;
  373. font-size: 30rpx;
  374. color: #999;
  375. // margin: 15rpx;
  376. }
  377. .detail_text {
  378. // font-size: 25rpx;
  379. margin-top: 20rpx;
  380. display: flex;
  381. .input {
  382. width: 100%;
  383. padding-left: 10rpx;
  384. height: 80rpx;
  385. border-radius: 5rpx;
  386. overflow: hidden;
  387. text-overflow: ellipsis;
  388. white-space: nowrap;
  389. border: 1rpx solid #eae8e9;
  390. }
  391. .detail_ipt {
  392. border: 1rpx solid #eae8e9;
  393. padding: 15rpx;
  394. width: 100%;
  395. .text {
  396. margin-bottom: 20rpx;
  397. }
  398. .detail_logo {
  399. margin-top: 20rpx;
  400. .img {
  401. width: 120rpx;
  402. height: 120rpx;
  403. }
  404. }
  405. .choose_img {
  406. margin-top: 20rpx;
  407. width: 120rpx;
  408. height: 120rpx;
  409. text-align: center;
  410. overflow: hidden;
  411. border: 1rpx solid #eae8e9;
  412. .icon_plus {
  413. margin: 15rpx;
  414. }
  415. }
  416. }
  417. .detail_ipt1 {
  418. border: 1rpx solid #eae8e9;
  419. padding: 15rpx;
  420. height: 70rpx;
  421. }
  422. .icon {
  423. position: absolute;
  424. top: 10rpx;
  425. right: 20rpx;
  426. z-index: 10;
  427. }
  428. }
  429. .detail_text_address {
  430. width: 100%;
  431. margin-top: 20rpx;
  432. height: 80rpx;
  433. border-radius: 5rpx;
  434. border: 1rpx solid #eae8e9;
  435. display: flex;
  436. align-items: center;
  437. justify-content: flex-start;
  438. .input {
  439. padding-left: 10rpx;
  440. width: 92%;
  441. overflow: hidden;
  442. text-overflow: ellipsis;
  443. white-space: nowrap;
  444. }
  445. .icon {}
  446. }
  447. .content_detail_img {
  448. display: flex;
  449. justify-content: space-between;
  450. align-items: center;
  451. flex-wrap: wrap;
  452. .detail_img {
  453. position: relative;
  454. margin-top: 10rpx;
  455. width: 200rpx;
  456. height: 200rpx;
  457. display: flex;
  458. justify-content: center;
  459. align-items: center;
  460. border: 1rpx solid #eae8e9;
  461. // margin-right: 20rpx;
  462. .image {
  463. width: 200rpx;
  464. height: 200rpx;
  465. }
  466. .delete_img {
  467. position: absolute;
  468. top: 5rpx;
  469. right: 5rpx;
  470. }
  471. }
  472. }
  473. }
  474. .agree_terms {
  475. display: flex;
  476. justify-content: center;
  477. align-items: center;
  478. .agree_dot {
  479. margin-right: 10rpx;
  480. }
  481. text {
  482. color: #2375f4;
  483. }
  484. }
  485. .submit {
  486. font-size: 30rpx;
  487. color: #ffffff;
  488. padding: 25rpx 0;
  489. border-radius: 35rpx;
  490. text-align: center;
  491. width: 90%;
  492. margin: 20rpx auto;
  493. margin-bottom: 40rpx;
  494. }
  495. }
  496. .bor_solp {
  497. background-color: #999;
  498. height: 1rpx;
  499. width: 100%;
  500. transform: scaleY(0.3);
  501. margin: 25rpx 0;
  502. }
  503. .under_review {
  504. margin-top: 100rpx;
  505. text-align: center;
  506. image {
  507. width: 150rpx;
  508. height: 150rpx;
  509. }
  510. .text {
  511. margin-top: 20rpx;
  512. }
  513. }
  514. }
  515. </style>