buyEdit.vue 21 KB

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