buyEdit.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <template>
  2. <view class="center">
  3. <view class="area">
  4. <view class="c-row b-b">
  5. <text class="tit">名头</text>
  6. <view class="con-list">
  7. <text @click="navToDetailPage">{{deptList.buyer}}<text class='tip_text cuIcon-right'></text></text>
  8. </view>
  9. </view>
  10. <view class="c-row b-b">
  11. <text class="tit">标题</text>
  12. <view class="con-list">
  13. <input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input" v-model="deptList.title"></input>
  14. </view>
  15. </view>
  16. <view class="c-row b-b">
  17. <text class="tit">货名</text>
  18. <view class="con-list">
  19. <input placeholder="请输入货名,如玉米" name="input" v-model="deptList.goodsName"></input>
  20. </view>
  21. </view>
  22. <view class="c-row b-b">
  23. <text class="tit">采购量(吨)</text>
  24. <view class="con-list">
  25. <input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedPurchaseVolume"></input>
  26. </view>
  27. </view>
  28. <view class="c-row b-b">
  29. <text class="tit">最小成交量(吨)</text>
  30. <view class="con-list">
  31. <input placeholder="请输入最小成交量" name="input" v-model="deptList.minimumVolume"></input>
  32. </view>
  33. </view>
  34. <view class="c-row b-b">
  35. <text class="tit">类型</text>
  36. <view class="con-list">
  37. {{deptList.procurementPlanType}}
  38. </view>
  39. </view>
  40. <view class="c-row b-b">
  41. <text class="tit">价格类型</text>
  42. <view class="con-list">
  43. {{deptList.priceType}}
  44. </view>
  45. </view>
  46. <view class="c-row b-b" v-if="this.typesIndex != 1">
  47. <text class="tit">单价(元/吨)</text>
  48. <view class="con-list">
  49. <input placeholder="请填写单价" name="input" v-model="deptList.procurementPrice"></input>
  50. </view>
  51. </view>
  52. <view class="c-row b-b" v-if="this.typesIndex == 1">
  53. <text class="tit">基差(元/吨)</text>
  54. <view class="con-list">
  55. <input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
  56. </view>
  57. </view>
  58. <view class="c-row b-b">
  59. <text class="tit">收货地区</text>
  60. <view class="con-list">
  61. <view @click='regionchange'>{{region}}</view>
  62. <u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show" ></u-picker>
  63. </view>
  64. </view>
  65. <view class="c-row b-b">
  66. <text class="tit">买方手机号</text>
  67. <view class="con-list">
  68. <input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
  69. </view>
  70. </view>
  71. <view style='width:100%;position:relative;padding:10px;' class="flex">
  72. <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
  73. class='getcode'>{{sendText}}</button>
  74. <view style='width:70%;position:relative;margin-left: 200px;'>
  75. <view class="con-list">
  76. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="area">
  82. <view class="c-row b-b">
  83. <checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text style="font-size: 14px; ">完善更多信息<text style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
  84. </view>
  85. <view v-if='!checked' class="c-row b-b">
  86. <text class="tit">水分(%)<= </text>
  87. <view class="con-list">
  88. <input placeholder="请填写水分占比" name="input" v-model="deptList.waterContent"></input>
  89. </view>
  90. </view>
  91. <view v-if='!checked' class="c-row b-b">
  92. <text class="tit">容重(g/L)<= </text>
  93. <view class="con-list">
  94. <input placeholder="请填写容重" name="input" v-model="deptList.bulkDensity"></input>
  95. </view>
  96. </view>
  97. <view v-if='!checked' class="c-row b-b">
  98. <text class="tit">热损伤(%)<= </text>
  99. <view class="con-list">
  100. <input placeholder="请填写热损伤占比" name="input" v-model="deptList.jiaorenli"></input>
  101. </view>
  102. </view>
  103. <view v-if='!checked' class="c-row b-b">
  104. <text class="tit">杂质(%)<= </text>
  105. <view class="con-list">
  106. <input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
  107. </view>
  108. </view>
  109. <view v-if='!checked' class="c-row b-b">
  110. <text class="tit">霉变粒(%)<= </text>
  111. <view class="con-list">
  112. <input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
  113. </view>
  114. </view>
  115. <view v-if='!checked' class="c-row b-b">
  116. <text class="tit">不完整粒(%)<= </text>
  117. <view class="con-list">
  118. <input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
  119. </view>
  120. </view>
  121. <view v-if='!checked' class="c-row b-b">
  122. <text class="tit">蛋白(%)<= </text>
  123. <view class="con-list">
  124. <input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
  125. </view>
  126. </view>
  127. <view v-if='!checked' class="c-row b-b">
  128. <text class="tit">粒型 </text>
  129. <picker @change="liChange" :value="liIndex" :range="liType" class="con-list" v-model="deptList.grain">
  130. <view class="con-list">
  131. {{liIndex>-1?liType[liIndex]:'请选择粒型'}}
  132. </view>
  133. </picker>
  134. </view>
  135. <view v-if='!checked' class="c-row b-b">
  136. <text class="tit">品级 </text>
  137. <picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list" v-model="deptList.grade">
  138. <view class="con-list">
  139. {{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
  140. </view>
  141. </picker>
  142. </view>
  143. <view v-if='!checked' class="c-row b-b">
  144. <text class="tit">产地</text>
  145. <view class="con-list">
  146. <view @click='regionchange1'>{{region1}}</view>
  147. <u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1" ></u-picker>
  148. </view>
  149. </view>
  150. <view v-if='!checked' class="c-row b-b">
  151. <text class="tit">产出年份</text>
  152. <picker @change="nianChange" :value="nianIndex" :range="nianType" class="con-list">
  153. <view class="con-list">
  154. {{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
  155. </view>
  156. </picker>
  157. </view>
  158. <view v-if='!checked' class="c-row b-b">
  159. <text class="tit">包装方式</text>
  160. <picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
  161. <view class="con-list">
  162. {{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
  163. </view>
  164. </picker>
  165. </view>
  166. <view v-if='!checked&&baoIndex==2||!checked&&baoIndex==3' class="c-row b-b">
  167. <text class="tit">袋装备注</text>
  168. <view class="con-list">
  169. <input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
  170. </view>
  171. </view>
  172. <view v-if='!checked' class="c-row">
  173. <text class="tit">运费承担方</text>
  174. <picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
  175. <view class="con-list">
  176. {{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
  177. </view>
  178. </picker>
  179. </view>
  180. </view>
  181. <button @click="commit()" class="btn">重新发布</button>
  182. </view>
  183. </template>
  184. <script>
  185. import {
  186. mapState
  187. } from 'vuex';
  188. export default {
  189. data() {
  190. return {
  191. types: '',
  192. goods:{},
  193. typesType: ["现货", "期货"],
  194. typesIndex: 0,
  195. deptList: {
  196. buyer:"",
  197. salePlanTypeKey:0,
  198. grainKey:0,
  199. gradeKey:0,
  200. packingTypeKey:0,
  201. freightPayerKey:-1,
  202. priceType: "定价采购",
  203. procurementPlanType:"现货",
  204. grain:"不限",
  205. grade:"不限",
  206. outputYear:"2020",
  207. packingType:"不限",
  208. freightPayer:"",
  209. },
  210. params:{
  211. province: true,
  212. city: true,
  213. area: true,
  214. },
  215. params1:{
  216. province: true,
  217. city: true,
  218. },
  219. checked:true,
  220. insertProcurementPlanInfo: {},
  221. liIndex: -1,
  222. liType: ['塔粮', '筛粮', '中粒', '大粒'],
  223. pinIndex: -1,
  224. pinType: ['一等品', '二等品', '三等品', '等外'],
  225. nianIndex: 3,
  226. nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
  227. '2011'
  228. ],
  229. id:0,
  230. sendText:'获取验证码',
  231. show:false,
  232. show1:false,
  233. region:'请选择收货地区',
  234. region1:'请选择产地',
  235. baoIndex: -1,
  236. baoType: ['散装', '大袋', '小袋'],
  237. chengIndex: -1,
  238. chengType: ['可议', '买方承担', '卖方承担'],
  239. codestatus: false,
  240. sendDisabled: false,
  241. sendText: '获取验证码',
  242. verifyCode:"",
  243. }
  244. },
  245. computed: {
  246. ...mapState(['hasLogin','userInfo'])
  247. },
  248. onLoad(options){
  249. this.id=options.id
  250. this.getList()
  251. },
  252. onShow() {
  253. var that = this
  254. this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
  255. commonId: that.userInfo.id
  256. }).then(res => {
  257. if (res.data.code == 200) {
  258. if (res.data.data.customerTypeFlag == 1) {
  259. that.$set(that.deptList, 'buyer', res.data.data.customerName)
  260. } else {
  261. that.$set(that.deptList, 'buyer', res.data.data.compName)
  262. }
  263. that.goods = res.data.data
  264. }
  265. uni.hideLoading()
  266. })
  267. },
  268. methods: {
  269. getList(){
  270. this.$api.doRequest('get','/procurementPlanInfo/getProcurementPlan',{id:this.id}).then(res => {
  271. if(res.data.code==200){
  272. this.deptList = res.data.data
  273. if (this.deptList.waterContent != null || this.deptList.bulkDensity != null || this
  274. .deptList.jiaorenli != null || this.deptList.impurity != null || this.deptList
  275. .mildewGrain != null || this.deptList.imperfectGrain != null || this.deptList
  276. .protein != null || this.deptList.grade != null || this.deptList.outputYear != null ||
  277. this.deptList.packingType != null || this.deptList.freightPayer != null) {
  278. this.checked = false
  279. }
  280. if(this.deptList.procurementPlanType == '期货'){
  281. let number = this.deptList.basisPrice
  282. this.deptList.basisPrice = Math.abs(number)
  283. }
  284. this.region1=this.deptList.outputPrivate+'-'+this.deptList.outputCity
  285. this.region=this.deptList.receivePrivate+'-'+this.deptList.receiveCity+'-'+this.deptList.receiveArea
  286. if(this.deptList.procurementPlanTypeKey==2){
  287. this.typesIndex=1
  288. }else if(this.deptList.procurementPlanTypeKey==1){
  289. this.typesIndex=0
  290. }
  291. this.liIndex = this.deptList.grainKey
  292. this.baoIndex=this.deptList.packingTypeKey
  293. this.pinIndex=this.deptList.gradeKey
  294. if(this.deptList.freightPayerKey==1){
  295. this.chengIndex=0
  296. }else if(this.deptList.freightPayerKey==2){
  297. this.chengIndex=1
  298. }else if(this.deptList.freightPayerKey==3){
  299. this.chengIndex=2
  300. }
  301. }
  302. })
  303. .catch(res => {
  304. uni.showToast({
  305. title: res.errmsg,
  306. icon:'none',
  307. duration: 2000
  308. })
  309. });
  310. },
  311. getcode(){
  312. var that = this
  313. if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.deptList.buyerPhone)){
  314. this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.deptList.buyerPhone}).then(res => {
  315. if(res.data.code==200){
  316. that.sendDisabled = true
  317. let sec = 60
  318. let interval = setInterval(() => {
  319. sec--;
  320. that.sendText = sec + 's后重发'
  321. if (sec <= 0) {
  322. that.sendDisabled = false
  323. that.sendText = "获取验证码"
  324. clearInterval(interval)
  325. }
  326. }, 1000)
  327. }else{
  328. uni.showToast({
  329. title: res.data.message,
  330. icon:'none',
  331. duration: 2000
  332. })
  333. }
  334. })
  335. .catch(res => {
  336. uni.showToast({
  337. title: res.data.message,
  338. icon:'none',
  339. duration: 2000
  340. })
  341. });
  342. }else{
  343. uni.showToast({
  344. title: '请输入正确的手机号',
  345. icon:'none',
  346. duration: 2000
  347. })
  348. }
  349. },
  350. regionpicker(e){
  351. this.deptList.receivePrivate=e.province.label
  352. this.deptList.receiveCity=e.city.label
  353. this.deptList.receiveArea=e.area.label
  354. this.region=e.province.label+'-'+e.city.label+'-'+e.area.label
  355. },
  356. regionchange(){
  357. this.show=true
  358. },
  359. regionpicker1(e){
  360. this.deptList.outputPrivate=e.province.label
  361. this.deptList.outputCity=e.city.label
  362. this.region1=e.province.label+'-'+e.city.label
  363. },
  364. regionchange1(){
  365. this.show1=true
  366. },
  367. checkedbox(e){
  368. this.checked = !this.checked
  369. },
  370. typeChange(e) {
  371. this.typesIndex = e.detail.value
  372. if(e.detail.value==0){
  373. this.deptList.priceType = '定价采购'
  374. this.deptList.procurementPlanTypeKey =2
  375. }else{
  376. this.deptList.priceType = '期货盘面价+基差'
  377. this.deptList.procurementPlanTypeKey =1
  378. }
  379. this.deptList.procurementPlanType = this.typesType[this.typesIndex];
  380. },
  381. navToDetailPage() {
  382. // if (index == 1) {
  383. uni.navigateTo({
  384. url: `/pageD/myRelease/Identity_switching?id=`+this.id
  385. })
  386. },
  387. commit() {
  388. // if (!this.deptList.goodsName) {
  389. // this.$api.msg('货名1不能为空')
  390. // return
  391. // }
  392. if (!this.deptList.title) {
  393. this.$api.msg('标题不能为空')
  394. return
  395. }
  396. if (this.deptList.title.length>16||this.deptList.title.length<2) {
  397. this.$api.msg('标题输入错误')
  398. return
  399. }
  400. if (!this.deptList.goodsName) {
  401. this.$api.msg('货名不能为空')
  402. return
  403. }
  404. if (this.deptList.goodsName.length>6||this.deptList.goodsName.length<1) {
  405. this.$api.msg('货名输入错误')
  406. return
  407. }
  408. if (!this.deptList.plannedPurchaseVolume) {
  409. this.$api.msg('采购量不能为空')
  410. return
  411. }
  412. if (this.deptList.plannedPurchaseVolume>100000||this.deptList.plannedPurchaseVolume<1) {
  413. this.$api.msg('采购量输入错误')
  414. return
  415. }
  416. // var plannedPurchaseVolume = this.deptList.plannedPurchaseVolume.toString()
  417. if (this.deptList.plannedPurchaseVolume.toString().indexOf(".") != -1) {
  418. if(this.deptList.plannedPurchaseVolume.split('.')[1].length>2){
  419. this.$api.msg('采购量输入错误')
  420. return
  421. }
  422. }
  423. if (!this.deptList.minimumVolume) {
  424. this.$api.msg('最小成交量不能为空')
  425. return
  426. }
  427. if (this.deptList.minimumVolume>100000||this.deptList.minimumVolume<1) {
  428. this.$api.msg('最小成交量输入错误')
  429. return
  430. }
  431. if (this.deptList.minimumVolume.toString().indexOf('.')!=-1) {
  432. if(this.deptList.minimumVolume.split('.')[1].length>2){
  433. this.$api.msg('最小成交量输入错误')
  434. return
  435. }
  436. }
  437. if (!this.deptList.procurementPlanType) {
  438. this.$api.msg('类型不能为空')
  439. return
  440. }
  441. if (!this.deptList.priceType) {
  442. this.$api.msg('价格类型不能为空')
  443. return
  444. }
  445. if(this.deptList.procurementPlanType == '现货'){
  446. if (!this.deptList.procurementPrice) {
  447. this.$api.msg('单价不能为空')
  448. return
  449. }
  450. if (this.deptList.procurementPrice>100000||this.deptList.procurementPrice<1) {
  451. this.$api.msg('单价输入错误')
  452. return
  453. }
  454. if (this.deptList.procurementPrice.indexOf('.')!=-1) {
  455. if(this.deptList.procurementPrice.split('.')[1].length>2){
  456. this.$api.msg('单价输入错误')
  457. return
  458. }
  459. }
  460. }else if(this.deptList.procurementPlanType == '期货'){
  461. if (!this.deptList.basisPrice) {
  462. this.$api.msg('基差不能为空')
  463. return
  464. }
  465. if (this.deptList.basisPrice>10000||this.deptList.basisPrice<1) {
  466. this.$api.msg('基差输入错误')
  467. return
  468. }
  469. if (this.deptList.basisPrice.toString().indexOf('.')!=-1) {
  470. if(this.deptList.basisPrice.toString().split('.')[1].length>2){
  471. this.$api.msg('基差输入错误')
  472. return
  473. }
  474. }
  475. }
  476. if (!this.deptList.buyerPhone) {
  477. this.$api.msg('买方手机号不能为空')
  478. return
  479. }
  480. if(!this.verifyCode){
  481. this.$api.msg('验证码不能为空')
  482. return
  483. }
  484. if(this.checked == false){
  485. if (this.deptList.waterContent&&this.deptList.waterContent<1||
  486. this.deptList.waterContent&&this.deptList.waterContent>40) {
  487. this.$api.msg('水分输入错误')
  488. return
  489. }
  490. if (this.deptList.waterContent&&this.deptList.waterContent.indexOf('.')!=-1) {
  491. if(this.deptList.waterContent.split('.')[1].length>2){
  492. this.$api.msg('水分输入错误')
  493. return
  494. }
  495. }
  496. if (this.deptList.bulkDensity&&this.deptList.bulkDensity<500||
  497. this.deptList.bulkDensity&&this.deptList.bulkDensity>1000) {
  498. this.$api.msg('容重输入错误')
  499. return
  500. }
  501. if (this.deptList.jiaorenli&&this.deptList.jiaorenli<1||
  502. this.deptList.jiaorenli&&this.deptList.jiaorenli>40) {
  503. this.$api.msg('热损伤输入错误')
  504. return
  505. }
  506. if (this.deptList.jiaorenli&&this.deptList.jiaorenli.indexOf('.')!=-1) {
  507. if(this.deptList.jiaorenli.split('.')[1].length>2){
  508. this.$api.msg('热损伤输入错误')
  509. return
  510. }
  511. }
  512. if (this.deptList.impurity&&this.deptList.impurity<1||
  513. this.deptList.impurity&&this.deptList.impurity>40) {
  514. this.$api.msg('杂质输入错误')
  515. return
  516. }
  517. if (this.deptList.impurity&&this.deptList.impurity.indexOf('.')!=-1) {
  518. if(this.deptList.impurity.split('.')[1].length>2){
  519. this.$api.msg('杂质输入错误')
  520. return
  521. }
  522. }
  523. if (this.deptList.mildewGrain&&this.deptList.mildewGrain<1||
  524. this.deptList.mildewGrain&&this.deptList.mildewGrain>40) {
  525. this.$api.msg('霉变粒输入错误')
  526. return
  527. }
  528. if (this.deptList.mildewGrain&&this.deptList.mildewGrain.indexOf('.')!=-1) {
  529. if(this.deptList.mildewGrain.split('.')[1].length>2){
  530. this.$api.msg('霉变粒输入错误')
  531. return
  532. }
  533. }
  534. if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain<1||
  535. this.deptList.imperfectGrain&&this.deptList.imperfectGrain>40) {
  536. this.$api.msg('不完整粒输入错误')
  537. return
  538. }
  539. if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain.indexOf('.')!=-1) {
  540. if(this.deptList.imperfectGrain.split('.')[1].length>2){
  541. this.$api.msg('不完整粒输入错误')
  542. return
  543. }
  544. }
  545. if (this.deptList.protein && this.deptList.protein < 1 ||
  546. this.deptList.protein && this.deptList.protein > 80) {
  547. this.$api.msg('蛋白输入错误')
  548. return
  549. }
  550. if (this.deptList.protein && this.deptList.protein.indexOf('.')!=-1) {
  551. if(this.deptList.protein.split('.')[1].length>2){
  552. this.$api.msg('蛋白输入错误')
  553. return
  554. }
  555. }
  556. }
  557. this.insertProcurementPlanInfo = this.deptList
  558. if(this.deptList.procurementPlanType == '期货'){
  559. this.insertProcurementPlanInfo.basisPrice=-this.insertProcurementPlanInfo.basisPrice
  560. }
  561. this.insertProcurementPlanInfo.commonId = this.userInfo.id
  562. this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  563. uni.showModal({
  564. content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
  565. success: (res) => {
  566. if(res.confirm) {
  567. var that = this
  568. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  569. phone: this.deptList.buyerPhone,
  570. verifyCode: this.verifyCode
  571. }).then(res => {
  572. if (res.data.code == 200) {
  573. this.$api.doRequest('post', '/procurementPlanInfo/api/editProcurementPlan', this
  574. .insertProcurementPlanInfo).then(res => {
  575. if(res.data.code==200){
  576. uni.showToast({
  577. title: "发布成功",
  578. icon: 'none',
  579. duration: 2000
  580. })
  581. setTimeout(function(){
  582. uni.navigateBack({
  583. delta:2
  584. })
  585. },2000)
  586. this.deptList={}
  587. uni.navigateTo({
  588. url: `/pages/release/release`
  589. })
  590. }else{
  591. uni.showToast({
  592. title: res.data.message,
  593. icon: 'none',
  594. duration: 2000
  595. })
  596. }
  597. })
  598. .catch(res => {
  599. uni.showToast({
  600. title: res.errmsg,
  601. icon: 'none',
  602. duration: 2000
  603. })
  604. });
  605. }
  606. else if(res.data.code=='11003'){
  607. uni.showModal({
  608. title: '提示',
  609. content: '验证码不正确',
  610. });
  611. }
  612. else {
  613. uni.showToast({
  614. title: res.data.message,
  615. icon: 'none',
  616. duration: 2000
  617. })
  618. }
  619. })
  620. .catch(res => {
  621. uni.showToast({
  622. title: res.data.message,
  623. icon: 'none',
  624. duration: 2000
  625. })
  626. });
  627. }
  628. }
  629. })
  630. },
  631. liChange(e) {
  632. this.liIndex = e.detail.value
  633. this.litypes = this.liType[this.liIndex];
  634. this.deptList.grainKey = e.detail.value+1
  635. this.deptList.grain = this.liType[this.liIndex]
  636. },
  637. pinChange(e) {
  638. this.pinIndex = e.detail.value
  639. this.pintypes = this.pinType[this.pinIndex];
  640. this.deptList.gradeKey = e.detail.value
  641. this.deptList.grade = this.pinType[this.pinIndex]
  642. },
  643. nianChange(e) {
  644. this.nianIndex = e.detail.value
  645. this.niantypes = this.nianType[this.nianIndex];
  646. this.deptList.outputYear = this.nianType[this.niantypes]
  647. },
  648. baoChange(e) {
  649. this.baoIndex = e.detail.value
  650. this.baotypes = this.baoType[this.baoIndex];
  651. this.deptList.packingTypeKey = e.detail.value
  652. this.deptList.packingType = this.baoType[this.baoIndex];
  653. },
  654. chengChange(e) {
  655. this.chengIndex = e.detail.value
  656. this.chengtypes = this.chengType[this.chengIndex];
  657. this.deptList.freightPayerKey = e.detail.value+1
  658. this.deptList.freightPayer = this.chengType[this.chengIndex];
  659. }
  660. }
  661. }
  662. </script>
  663. <style>
  664. .center {
  665. padding: 10px 20px;
  666. background-color: #F5F6FA;
  667. }
  668. .c-row {
  669. display: -webkit-box;
  670. display: -webkit-flex;
  671. display: flex;
  672. -webkit-box-align: center;
  673. -webkit-align-items: center;
  674. align-items: center;
  675. padding: 20rpx 30rpx;
  676. position: relative;
  677. }
  678. .con-list {
  679. -webkit-box-flex: 1;
  680. -webkit-flex: 1;
  681. flex: 1;
  682. display: -webkit-box;
  683. display: -webkit-flex;
  684. display: flex;
  685. -webkit-box-orient: vertical;
  686. -webkit-box-direction: normal;
  687. -webkit-flex-direction: column;
  688. flex-direction: column;
  689. color: #AFB3BF;
  690. line-height: 40rpx;
  691. text-align: right;
  692. padding-right: 20rpx;
  693. font-size: 14px;
  694. }
  695. .area{
  696. background-color: #FFFFFF;
  697. border-radius: 20px;
  698. margin-top: 10px;
  699. }
  700. .btn{
  701. margin-top: 10px;
  702. border-radius: 20px;
  703. background-color: #22C572;
  704. color: #FFFFFF;
  705. }
  706. .getcode {
  707. font-size: 14px;
  708. position: absolute;
  709. top: 50%;
  710. transform: translateY(-50%);
  711. color: #AFB3BF;
  712. background: #F5F6F9;
  713. height: 30px;
  714. line-height: 30px;
  715. }
  716. .getcode.active {
  717. background: #22C572;
  718. color: #fff;
  719. }
  720. </style>