buyGrain.vue 24 KB

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