sellGrain.vue 23 KB

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