sellGrain.vue 22 KB

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