sellGrain.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  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>
  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==2||!checked&&baoIndex==3' 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 b-b">
  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. salePlanTypeKey:0,
  209. grainKey:0,
  210. gradeKey:0,
  211. packingTypeKey:0,
  212. freightPayerKey:-1,
  213. priceType: "定价采购",
  214. procurementPlanType: "现货",
  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: true,
  231. insertSalePlanInfo: {},
  232. liIndex: 0,
  233. liType: ['塔粮', '筛粮', '中粒', '大粒'],
  234. pinIndex: 0,
  235. pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
  236. nianIndex: 3,
  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. region1: '请选择产地',
  244. baoIndex: 0,
  245. baoType: ['不限(默认)', '散装', '大袋', '小袋'],
  246. chengIndex: -1,
  247. chengType: ['可议', '买方承担', '卖方承担'],
  248. codestatus: false,
  249. sendDisabled: false,
  250. sendText: '获取验证码',
  251. verifyCode:"",
  252. verification:true,
  253. }
  254. },
  255. computed: {
  256. ...mapState(['hasLogin', 'userInfo'])
  257. },
  258. onLoad(options) {
  259. if (options.customerName) {
  260. this.deptList.seller = options.customerName
  261. }
  262. },
  263. onShow() {
  264. var that = this
  265. this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
  266. commonId: this.userInfo.id
  267. }).then(res => {
  268. if (res.data.code == 200) {
  269. if (res.data.data.customerTypeFlag == 1) {
  270. that.$set(this.deptList, 'seller', res.data.data.customerName)
  271. } else {
  272. that.$set(this.deptList, 'seller', res.data.data.compName)
  273. }
  274. this.goods = res.data.data
  275. }
  276. uni.hideLoading()
  277. })
  278. },
  279. methods: {
  280. async amendprice() {
  281. var that = this
  282. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  283. phone: this.deptList.sellerPhone,
  284. verifyCode: this.verifyCode
  285. }).then(res => {
  286. if (res.data.code == 200) {
  287. } else {
  288. that.verification = false
  289. console.log(that.verification,"1")
  290. uni.showToast({
  291. title: res.data.message,
  292. icon: 'none',
  293. duration: 2000
  294. })
  295. return false
  296. }
  297. })
  298. .catch(res => {
  299. that.verification = false
  300. console.log(that.verification,"2")
  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. },
  358. regionchange() {
  359. this.show = true
  360. },
  361. regionpicker1(e) {
  362. this.deptList.outputPrivate = e.province.label
  363. this.deptList.outputCity = e.city.label
  364. this.region1 = e.province.label + '-' + e.city.label
  365. },
  366. regionchange1() {
  367. this.show1 = true
  368. },
  369. checkedbox(e) {
  370. this.checked = !this.checked
  371. },
  372. typeChange(e) {
  373. this.typesIndex = e.detail.value
  374. this.types = this.typesType[this.typesIndex];
  375. this.deptList.salePlanTypeKey = e.detail.value+1
  376. this.deptList.salePlanType = this.typesType[this.typesIndex];
  377. if (this.typesIndex == 0) {
  378. this.deptList.priceType = '定价采购'
  379. } else {
  380. this.deptList.priceType = '期货盘面价+基差'
  381. }
  382. },
  383. navToDetailPage() {
  384. // if (index == 1) {
  385. uni.navigateTo({
  386. url: `/pageD/myRelease/Identity_switching`
  387. })
  388. },
  389. commit() {
  390. if (!this.deptList.title) {
  391. this.$api.msg('标题不能为空')
  392. return
  393. }
  394. if (this.deptList.title.length > 16 || this.deptList.title.length < 2) {
  395. this.$api.msg('标题输入错误')
  396. return
  397. }
  398. if (!this.deptList.goodsName) {
  399. this.$api.msg('货名不能为空')
  400. return
  401. }
  402. if (this.deptList.goodsName.length > 6 || this.deptList.goodsName.length < 1) {
  403. this.$api.msg('货名输入错误')
  404. return
  405. }
  406. if (!this.deptList.plannedSaleVolume) {
  407. this.$api.msg('出货量不能为空')
  408. return
  409. }
  410. if (this.deptList.plannedSaleVolume > 100000 || this.deptList.plannedSaleVolume < 1) {
  411. this.$api.msg('出货量输入错误')
  412. return
  413. }
  414. if (this.deptList.plannedSaleVolume.indexOf('.') != -1) {
  415. if (this.deptList.plannedSaleVolume.split('.')[1].length > 2) {
  416. this.$api.msg('出货量输入错误')
  417. return
  418. }
  419. }
  420. if (!this.deptList.minimumVolume) {
  421. this.$api.msg('最小成交量不能为空')
  422. return
  423. }
  424. if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
  425. this.$api.msg('最小成交量输入错误')
  426. return
  427. }
  428. if (this.deptList.minimumVolume.indexOf('.') != -1) {
  429. if (this.deptList.minimumVolume.split('.')[1].length > 2) {
  430. this.$api.msg('最小成交量输入错误')
  431. return
  432. }
  433. }
  434. if (!this.deptList.salePlanType) {
  435. this.$api.msg('类型不能为空')
  436. return
  437. }
  438. if (!this.deptList.priceType) {
  439. this.$api.msg('价格类型不能为空')
  440. return
  441. }
  442. if (this.deptList.salePlanType == '现货') {
  443. if (!this.deptList.salePrice) {
  444. this.$api.msg('单价不能为空')
  445. return
  446. }
  447. if (this.deptList.salePrice > 100000 || this.deptList.salePrice < 1) {
  448. this.$api.msg('单价输入错误')
  449. return
  450. }
  451. if (this.deptList.salePrice.indexOf('.') != -1) {
  452. if (this.deptList.salePrice.split('.')[1].length > 2) {
  453. this.$api.msg('单价输入错误')
  454. return
  455. }
  456. }
  457. } else if (this.deptList.salePlanType == '期货') {
  458. if (!this.deptList.basisPrice) {
  459. this.$api.msg('基差(元/吨)不能为空')
  460. return
  461. }
  462. if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
  463. this.$api.msg('基差输入错误')
  464. return
  465. }
  466. if (this.deptList.basisPrice.indexOf('.') != -1) {
  467. if (this.deptList.basisPrice.split('.')[1].length > 2) {
  468. this.$api.msg('基差输入错误')
  469. return
  470. }
  471. }
  472. }
  473. if (!this.deptList.sellerPhone) {
  474. this.$api.msg('卖方手机号不能为空')
  475. return
  476. }
  477. if (this.deptList.sellerPhone.length!=11) {
  478. this.$api.msg('卖方手机号输入错误')
  479. return
  480. }
  481. if (this.checked == false) {
  482. if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
  483. this.deptList.waterContent && this.deptList.waterContent > 40) {
  484. this.$api.msg('水分输入错误')
  485. return
  486. }
  487. if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
  488. if (this.deptList.waterContent.split('.')[1].length > 2) {
  489. this.$api.msg('水分输入错误')
  490. return
  491. }
  492. }
  493. if (this.deptList.bulkDensity && this.deptList.bulkDensity < 500 ||
  494. this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
  495. this.$api.msg('容重输入错误')
  496. return
  497. }
  498. if (this.deptList.jiaorenli && this.deptList.jiaorenli < 1 ||
  499. this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
  500. this.$api.msg('热损伤输入错误')
  501. return
  502. }
  503. if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
  504. if (this.deptList.jiaorenli.split('.')[1].length > 2) {
  505. this.$api.msg('热损伤输入错误')
  506. return
  507. }
  508. }
  509. if (this.deptList.impurity && this.deptList.impurity < 1 ||
  510. this.deptList.impurity && this.deptList.impurity > 40) {
  511. this.$api.msg('杂质输入错误')
  512. return
  513. }
  514. if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
  515. if (this.deptList.impurity.split('.')[1].length > 2) {
  516. this.$api.msg('杂质输入错误')
  517. return
  518. }
  519. }
  520. if (this.deptList.mildewGrain && this.deptList.mildewGrain < 1 ||
  521. this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
  522. this.$api.msg('霉变粒输入错误')
  523. return
  524. }
  525. if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
  526. if (this.deptList.mildewGrain.split('.')[1].length > 2) {
  527. this.$api.msg('霉变粒输入错误')
  528. return
  529. }
  530. }
  531. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 1 ||
  532. this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
  533. this.$api.msg('不完整粒输入错误')
  534. return
  535. }
  536. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
  537. if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
  538. this.$api.msg('不完整粒输入错误')
  539. return
  540. }
  541. }
  542. if (this.deptList.protein && this.deptList.protein < 1 ||
  543. this.deptList.protein && this.deptList.protein > 80) {
  544. this.$api.msg('蛋白输入错误')
  545. return
  546. }
  547. if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
  548. if (this.deptList.protein.split('.')[1].length > 2) {
  549. this.$api.msg('蛋白输入错误')
  550. return
  551. }
  552. }
  553. }
  554. if(this.amendprice() == false){
  555. this.$api.msg('验证码输入有误!')
  556. return
  557. }
  558. // this.insertProcurementPlanInfo = this.deptList
  559. // this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
  560. // this.insertProcurementPlanInfo.commonId = this.userInfo.id
  561. // this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  562. this.insertSalePlanInfo = this.deptList
  563. this.insertSalePlanInfo.basisPrice = -this.insertSalePlanInfo.basisPrice
  564. this.insertSalePlanInfo.commonId = this.userInfo.id
  565. this.insertSalePlanInfo.salePlanNo='XSJH'+this.getdate()+this.verifyinit()
  566. this.insertSalePlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  567. this.$api.doRequest('post', '/salePlanInfo/api/insertSalePlanInfo', this
  568. .insertSalePlanInfo).then(res => {
  569. if (res.data.code == 200) {
  570. uni.showToast({
  571. title: "发布成功",
  572. icon: 'none',
  573. })
  574. // setTimeout(() => {
  575. // uni.navigateBack({})
  576. // }, 1000)
  577. this.deptList = {}
  578. uni.navigateTo({
  579. url: `/pages/release/release`
  580. })
  581. } else {
  582. uni.showToast({
  583. title: res.data.message,
  584. icon: 'none',
  585. duration: 2000
  586. })
  587. }
  588. })
  589. .catch(res => {
  590. uni.showToast({
  591. title: res.errmsg,
  592. icon: 'none',
  593. duration: 2000
  594. })
  595. });
  596. },
  597. liChange(e) {
  598. this.liIndex = e.detail.value
  599. this.litypes = this.liType[this.liIndex];
  600. this.deptList.grainKey = e.detail.value+1
  601. this.deptList.grain = this.liType[this.liIndex]
  602. },
  603. pinChange(e) {
  604. this.pinIndex = e.detail.value
  605. this.pintypes = this.pinType[this.pinIndex];
  606. this.deptList.gradeKey = e.detail.value
  607. this.deptList.grade = this.pinType[this.pinIndex]
  608. },
  609. nianChange(e) {
  610. this.nianIndex = e.detail.value
  611. this.niantypes = this.nianType[this.nianIndex];
  612. this.deptList.outputYear = this.baoType[this.baoIndex]
  613. },
  614. baoChange(e) {
  615. this.baoIndex = e.detail.value
  616. this.baotypes = this.baoType[this.baoIndex];
  617. this.deptList.packingTypeKey = e.detail.value
  618. this.deptList.packingType = this.baoType[this.baoIndex];
  619. },
  620. getdate() {
  621. var date = new Date()
  622. var year = date.getFullYear() //获取完整的年份(4位)
  623. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  624. var datetime = date.getDate() //获取当前日(1-31)
  625. if (mouth < 10) {
  626. mouth = '0' + mouth
  627. }
  628. if (datetime < 10) {
  629. datetime = '0' + datetime
  630. }
  631. return year + mouth + datetime
  632. },
  633. verifyinit() {
  634. var arr = []
  635. for (var i = 48; i < 123; i++) {
  636. if (i > 57 && i < 65) continue
  637. if (i > 90 && i < 97) continue
  638. arr.push(String.fromCharCode(i))
  639. }
  640. arr.sort(function() {
  641. return Math.random() - 0.5
  642. })
  643. arr.length = 4
  644. return arr.join('')
  645. },
  646. chengChange(e) {
  647. this.chengIndex = e.detail.value
  648. this.chengtypes = this.chengType[this.chengIndex];
  649. this.deptList.freightPayerKey = e.detail.value+1
  650. this.deptList.freightPayer = this.chengType[this.chengIndex];
  651. }
  652. }
  653. }
  654. </script>
  655. <style>
  656. .center {
  657. padding: 10px 20px;
  658. background-color: #F5F6FA;
  659. }
  660. .c-row {
  661. display: -webkit-box;
  662. display: -webkit-flex;
  663. display: flex;
  664. -webkit-box-align: center;
  665. -webkit-align-items: center;
  666. align-items: center;
  667. padding: 20rpx 30rpx;
  668. position: relative;
  669. }
  670. .con-list {
  671. -webkit-box-flex: 1;
  672. -webkit-flex: 1;
  673. flex: 1;
  674. display: -webkit-box;
  675. display: -webkit-flex;
  676. display: flex;
  677. -webkit-box-orient: vertical;
  678. -webkit-box-direction: normal;
  679. -webkit-flex-direction: column;
  680. flex-direction: column;
  681. color: #AFB3BF;
  682. line-height: 40rpx;
  683. text-align: right;
  684. padding-right: 20rpx;
  685. font-size: 14px;
  686. }
  687. .buyup {
  688. background-color: #FFFFFF;
  689. border-radius: 20px;
  690. margin-top: 10px;
  691. }
  692. .buylow {
  693. background-color: #FFFFFF;
  694. border-radius: 20px;
  695. margin-top: 10px;
  696. }
  697. .btn {
  698. border-radius: 20px;
  699. margin-top: 10px;
  700. background-color: #22C572;
  701. color: #FFFFFF;
  702. }
  703. .validate {
  704. width: 100px;
  705. height: 32px;
  706. background-color: #F5F6F9;
  707. color: #AFB3BF;
  708. border-radius: 10px;
  709. border: none;
  710. text-align: center;
  711. line-height: 30px;
  712. }
  713. .getcode {
  714. font-size: 14px;
  715. position: absolute;
  716. top: 50%;
  717. transform: translateY(-50%);
  718. color: #AFB3BF;
  719. background: #F5F6F9;
  720. height: 30px;
  721. line-height: 30px;
  722. }
  723. .getcode.active {
  724. border: none;
  725. }
  726. .getcode.active {
  727. background: #22C572;
  728. color: #fff;
  729. }
  730. </style>