buyGrain.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  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>
  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.plannedPurchaseVolume"></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.procurementPlanType">
  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. {{deptList.priceType}}
  47. </view>
  48. </view>
  49. <view class="c-row b-b" v-if="this.typesIndex != 1">
  50. <text class="tit">单价(元/吨)</text>
  51. <view class="con-list">
  52. <input placeholder="请填写单价" name="input" v-model="deptList.unitPrice"></input>
  53. </view>
  54. </view>
  55. <view class="c-row b-b" v-if="this.typesIndex == 1">
  56. <text class="tit">基差(元/吨)</text>
  57. <view class="con-list">
  58. <input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
  59. </view>
  60. </view>
  61. <view class="c-row b-b">
  62. <text class="tit">收货地区</text>
  63. <view class="con-list">
  64. <view @click='regionchange'>{{region}}</view>
  65. <u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
  66. </view>
  67. </view>
  68. <view class="c-row b-b">
  69. <text class="tit">买方手机号</text>
  70. <view class="con-list">
  71. <input placeholder="请输入买方手机号" name="input" v-model="deptList.buyerPhone"></input>
  72. </view>
  73. </view>
  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 style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  81. <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
  82. class='getcode'>{{sendText}}</button>
  83. <view style='width:70%;position:relative;margin-left: 200px;'>
  84. <view class="con-list">
  85. <input v-model='verifyCode' placeholder="请输入验证码" type="text">
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="buylow">
  91. <view class="c-row ">
  92. <checkbox style='transform: scale(0.8);' :checked="checked" @click='checkedbox'></checkbox><text
  93. style="font-size: 14px; ">完善更多信息<text
  94. style="font-size: 10px; color: #AFB3BF;">(选填,可由客服人员代为完善)</text></text>
  95. </view>
  96. <view v-if='!checked' class="c-row b-b">
  97. <text class="tit">水分(%)<= </text>
  98. <view class="con-list">
  99. <input placeholder="请填写水分占比" name="input" v-model="deptList.waterContent"></input>
  100. </view>
  101. </view>
  102. <view v-if='!checked' class="c-row b-b">
  103. <text class="tit">容重(g/L)<= </text>
  104. <view class="con-list">
  105. <input placeholder="请填写容重" name="input" v-model="deptList.bulkDensity"></input>
  106. </view>
  107. </view>
  108. <view v-if='!checked' class="c-row b-b">
  109. <text class="tit">热损伤(%)<= </text>
  110. <view class="con-list">
  111. <input placeholder="请填写热损伤占比" name="input" v-model="deptList.jiaorenli"></input>
  112. </view>
  113. </view>
  114. <view v-if='!checked' class="c-row b-b">
  115. <text class="tit">杂质(%)<= </text>
  116. <view class="con-list">
  117. <input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
  118. </view>
  119. </view>
  120. <view v-if='!checked' class="c-row b-b">
  121. <text class="tit">霉变粒(%)<= </text>
  122. <view class="con-list">
  123. <input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
  124. </view>
  125. </view>
  126. <view v-if='!checked' class="c-row b-b">
  127. <text class="tit">不完整粒(%)<= </text>
  128. <view class="con-list">
  129. <input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
  130. </view>
  131. </view>
  132. <view v-if='!checked' class="c-row b-b">
  133. <text class="tit">蛋白(%)<= </text>
  134. <view class="con-list">
  135. <input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
  136. </view>
  137. </view>
  138. <view v-if='!checked' class="c-row b-b">
  139. <text class="tit">粒型 </text>
  140. <picker @change="liChange" :value="liIndex" :range="liType" class="con-list" v-model="deptList.grain">
  141. <view class="con-list">
  142. {{liIndex>-1?liType[liIndex]:'请选择粒型'}}
  143. </view>
  144. </picker>
  145. </view>
  146. <view v-if='!checked' class="c-row b-b">
  147. <text class="tit">品级 </text>
  148. <picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list">
  149. <view class="con-list">
  150. {{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
  151. </view>
  152. </picker>
  153. </view>
  154. <view v-if='!checked' class="c-row b-b">
  155. <text class="tit">产地</text>
  156. <view class="con-list">
  157. <view @click='regionchange1'>{{region1}}</view>
  158. <u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1"></u-picker>
  159. </view>
  160. </view>
  161. <view v-if='!checked' class="c-row b-b">
  162. <text class="tit">产出年份</text>
  163. <picker @change="nianChange" :value="nianIndex" :range="nianType" class="con-list">
  164. <view class="con-list">
  165. {{nianIndex>-1?nianType[nianIndex]:'请选择产出年份'}}
  166. </view>
  167. </picker>
  168. </view>
  169. <view v-if='!checked' class="c-row b-b">
  170. <text class="tit">包装方式</text>
  171. <picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
  172. <view class="con-list">
  173. {{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
  174. </view>
  175. </picker>
  176. </view>
  177. <view v-if='!checked&&baoIndex==2||!checked&&baoIndex==3' class="c-row b-b">
  178. <text class="tit">袋装备注</text>
  179. <view class="con-list">
  180. <input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
  181. </view>
  182. </view>
  183. <view v-if='!checked' class="c-row b-b">
  184. <text class="tit">运费承担方</text>
  185. <picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
  186. <view class="con-list">
  187. {{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
  188. </view>
  189. </picker>
  190. </view>
  191. </view>
  192. <button @click="commit()" class="btn">发布</button>
  193. </view>
  194. </template>
  195. <script>
  196. import {
  197. mapState
  198. } from 'vuex';
  199. export default {
  200. data() {
  201. return {
  202. types: '',
  203. goods: {},
  204. typesType: ["现货", "期货"],
  205. typesIndex: 0,
  206. deptList: {
  207. salePlanTypeKey: 0,
  208. grainKey: 0,
  209. gradeKey: 0,
  210. packingTypeKey: 0,
  211. freightPayerKey: 0,
  212. priceType: "定价采购",
  213. procurementPlanType: "现货",
  214. grain: "塔粮",
  215. grade: "不限(默认)",
  216. outputYear: "2020",
  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: 0,
  232. liType: ['塔粮', '筛粮', '中粒', '大粒'],
  233. pinIndex: 0,
  234. pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
  235. nianIndex: 3,
  236. nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
  237. '2011'
  238. ],
  239. show: false,
  240. show1: false,
  241. region: '请选择收货地区',
  242. region1: '请选择产地',
  243. baoIndex: 0,
  244. baoType: ['不限(默认)', '散装', '大袋', '小袋'],
  245. chengIndex: -1,
  246. chengType: ['可议', '买方承担', '卖方承担'],
  247. codestatus: false,
  248. sendDisabled: false,
  249. sendText: '获取验证码',
  250. verifyCode:"",
  251. verification:true,
  252. // DriverViewInfo:{},
  253. }
  254. },
  255. computed: {
  256. ...mapState(['hasLogin', 'userInfo'])
  257. },
  258. onLoad(options) {
  259. if (options.customerName) {
  260. this.deptList.buyer = 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, 'buyer', res.data.data.customerName)
  271. } else {
  272. that.$set(this.deptList, 'buyer', 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.buyerPhone,
  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.buyerPhone)) {
  312. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  313. phone: that.deptList.buyerPhone
  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.receivePrivate = e.province.label
  354. this.deptList.receiveCity = e.city.label
  355. this.deptList.receiveArea = 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.procurementPlanTypeKey = e.detail.value + 1
  376. this.deptList.procurementPlanType = this.typesType[this.typesIndex];
  377. if (this.typesIndex == 0) {
  378. this.deptList.priceType = '定价采购'
  379. } else {
  380. this.deptList.priceType = '期货盘面价+基差'
  381. }
  382. },
  383. navToDetailPage() {
  384. uni.navigateTo({
  385. url: `/pageD/myRelease/Identity_switching`
  386. })
  387. },
  388. commit() {
  389. if (!this.deptList.title) {
  390. this.$api.msg('标题不能为空')
  391. return
  392. }
  393. if (this.deptList.title.length > 16 || this.deptList.title.length < 2) {
  394. this.$api.msg('标题输入错误')
  395. return
  396. }
  397. if (!this.deptList.goodsName) {
  398. this.$api.msg('货名不能为空')
  399. return
  400. }
  401. if (this.deptList.goodsName.length > 6 || this.deptList.goodsName.length < 1) {
  402. this.$api.msg('货名输入错误')
  403. return
  404. }
  405. if (!this.deptList.plannedPurchaseVolume) {
  406. this.$api.msg('采购量不能为空')
  407. return
  408. }
  409. if (this.deptList.plannedPurchaseVolume > 100000 || this.deptList.plannedPurchaseVolume < 1) {
  410. this.$api.msg('采购量输入错误')
  411. return
  412. }
  413. if (this.deptList.plannedPurchaseVolume.indexOf('.') != -1) {
  414. if (this.deptList.plannedPurchaseVolume.split('.')[1].length > 2) {
  415. this.$api.msg('采购量输入错误')
  416. return
  417. }
  418. }
  419. if (!this.deptList.minimumVolume) {
  420. this.$api.msg('最小成交量不能为空')
  421. return
  422. }
  423. if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
  424. this.$api.msg('最小成交量输入错误')
  425. return
  426. }
  427. if (this.deptList.minimumVolume.indexOf('.') != -1) {
  428. if (this.deptList.minimumVolume.split('.')[1].length > 2) {
  429. this.$api.msg('最小成交量输入错误')
  430. return
  431. }
  432. }
  433. if (!this.deptList.procurementPlanType) {
  434. this.$api.msg('类型不能为空')
  435. return
  436. }
  437. if (!this.deptList.priceType) {
  438. this.$api.msg('价格类型不能为空')
  439. return
  440. }
  441. if (this.deptList.procurementPlanType == '现货') {
  442. if (!this.deptList.unitPrice) {
  443. this.$api.msg('单价不能为空')
  444. return
  445. }
  446. if (this.deptList.unitPrice > 100000 || this.deptList.unitPrice < 1) {
  447. this.$api.msg('单价输入错误')
  448. return
  449. }
  450. if (this.deptList.unitPrice.indexOf('.') != -1) {
  451. if (this.deptList.unitPrice.split('.')[1].length > 2) {
  452. this.$api.msg('单价输入错误')
  453. return
  454. }
  455. }
  456. } else if (this.deptList.procurementPlanType == '期货') {
  457. if (!this.deptList.basisPrice) {
  458. this.$api.msg('基差(元/吨)不能为空')
  459. return
  460. }
  461. if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
  462. this.$api.msg('基差输入错误')
  463. return
  464. }
  465. if (this.deptList.basisPrice.indexOf('.') != -1) {
  466. if (this.deptList.basisPrice.split('.')[1].length > 2) {
  467. this.$api.msg('基差输入错误')
  468. return
  469. }
  470. }
  471. }
  472. if (!this.deptList.buyerPhone) {
  473. this.$api.msg('买方手机号不能为空')
  474. return
  475. }
  476. if (this.checked == false) {
  477. if (this.deptList.waterContent && this.deptList.waterContent < 1 ||
  478. this.deptList.waterContent && this.deptList.waterContent > 40) {
  479. this.$api.msg('水分输入错误')
  480. return
  481. }
  482. if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
  483. if (this.deptList.waterContent.split('.')[1].length > 2) {
  484. this.$api.msg('水分输入错误')
  485. return
  486. }
  487. }
  488. if (this.deptList.bulkDensity && this.deptList.bulkDensity < 500 ||
  489. this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
  490. this.$api.msg('容重输入错误')
  491. return
  492. }
  493. if (this.deptList.jiaorenli && this.deptList.jiaorenli < 1 ||
  494. this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
  495. this.$api.msg('热损伤输入错误')
  496. return
  497. }
  498. if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
  499. if (this.deptList.jiaorenli.split('.')[1].length > 2) {
  500. this.$api.msg('热损伤输入错误')
  501. return
  502. }
  503. }
  504. if (this.deptList.impurity && this.deptList.impurity < 1 ||
  505. this.deptList.impurity && this.deptList.impurity > 40) {
  506. this.$api.msg('杂质输入错误')
  507. return
  508. }
  509. if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
  510. if (this.deptList.impurity.split('.')[1].length > 2) {
  511. this.$api.msg('杂质输入错误')
  512. return
  513. }
  514. }
  515. if (this.deptList.mildewGrain && this.deptList.mildewGrain < 1 ||
  516. this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
  517. this.$api.msg('霉变粒输入错误')
  518. return
  519. }
  520. if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
  521. if (this.deptList.mildewGrain.split('.')[1].length > 2) {
  522. this.$api.msg('霉变粒输入错误')
  523. return
  524. }
  525. }
  526. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 1 ||
  527. this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
  528. this.$api.msg('不完整粒输入错误')
  529. return
  530. }
  531. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
  532. if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
  533. this.$api.msg('不完整粒输入错误')
  534. return
  535. }
  536. }
  537. if (this.deptList.protein && this.deptList.protein < 1 ||
  538. this.deptList.protein && this.deptList.protein > 80) {
  539. this.$api.msg('蛋白输入错误')
  540. return
  541. }
  542. if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
  543. if (this.deptList.protein.split('.')[1].length > 2) {
  544. this.$api.msg('蛋白输入错误')
  545. return
  546. }
  547. }
  548. }
  549. if(this.amendprice() == false){
  550. this.$api.msg('验证码输入有误!')
  551. return
  552. }
  553. this.insertProcurementPlanInfo = this.deptList
  554. this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
  555. this.insertProcurementPlanInfo.commonId = this.userInfo.id
  556. this.insertProcurementPlanInfo.procurementPlanNo='CGJH'+this.getdate()+this.verifyinit()
  557. this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  558. this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
  559. .insertProcurementPlanInfo).then(res => {
  560. if (res.data.code == 200) {
  561. uni.showToast({
  562. title: "发布成功",
  563. icon: 'none',
  564. })
  565. // setTimeout(() => {
  566. // uni.navigateBack({})
  567. // }, 1000)
  568. this.deptList = {}
  569. uni.navigateTo({
  570. url: `/pages/release/release`
  571. })
  572. } else {
  573. uni.showToast({
  574. title: res.data.message,
  575. icon: 'none',
  576. duration: 2000
  577. })
  578. }
  579. })
  580. .catch(res => {
  581. uni.showToast({
  582. title: res.errmsg,
  583. icon: 'none',
  584. duration: 2000
  585. })
  586. });
  587. },
  588. liChange(e) {
  589. this.liIndex = e.detail.value
  590. this.litypes = this.liType[this.liIndex];
  591. this.deptList.grainKey = e.detail.value + 1
  592. this.deptList.grain = this.liType[this.liIndex]
  593. },
  594. pinChange(e) {
  595. this.pinIndex = e.detail.value
  596. this.pintypes = this.pinType[this.pinIndex];
  597. this.deptList.gradeKey = e.detail.value
  598. this.deptList.grade = this.pinType[this.pinIndex]
  599. },
  600. nianChange(e) {
  601. this.nianIndex = e.detail.value
  602. this.niantypes = this.nianType[this.nianIndex];
  603. this.deptList.outputYear = this.baoType[this.baoIndex]
  604. },
  605. baoChange(e) {
  606. this.baoIndex = e.detail.value
  607. this.baotypes = this.baoType[this.baoIndex];
  608. this.deptList.packingTypeKey = e.detail.value
  609. this.deptList.packingType = this.baoType[this.baoIndex];
  610. },
  611. getdate() {
  612. var date = new Date()
  613. var year = date.getFullYear() //获取完整的年份(4位)
  614. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  615. var datetime = date.getDate() //获取当前日(1-31)
  616. if (mouth < 10) {
  617. mouth = '0' + mouth
  618. }
  619. if (datetime < 10) {
  620. datetime = '0' + datetime
  621. }
  622. return year + mouth + datetime
  623. },
  624. verifyinit() {
  625. var arr = []
  626. for (var i = 48; i < 123; i++) {
  627. if (i > 57 && i < 65) continue
  628. if (i > 90 && i < 97) continue
  629. arr.push(String.fromCharCode(i))
  630. }
  631. arr.sort(function() {
  632. return Math.random() - 0.5
  633. })
  634. arr.length = 4
  635. return arr.join('')
  636. },
  637. chengChange(e) {
  638. this.chengIndex = e.detail.value
  639. this.chengtypes = this.chengType[this.chengIndex];
  640. this.deptList.freightPayerKey = e.detail.value + 1
  641. this.deptList.freightPayer = this.chengType[this.chengIndex];
  642. }
  643. }
  644. }
  645. </script>
  646. <style>
  647. .center {
  648. padding: 10px 20px;
  649. background-color: #F5F6FA;
  650. }
  651. .c-row {
  652. display: -webkit-box;
  653. display: -webkit-flex;
  654. display: flex;
  655. -webkit-box-align: center;
  656. -webkit-align-items: center;
  657. align-items: center;
  658. padding: 20rpx 30rpx;
  659. position: relative;
  660. }
  661. .con-list {
  662. -webkit-box-flex: 1;
  663. -webkit-flex: 1;
  664. flex: 1;
  665. display: -webkit-box;
  666. display: -webkit-flex;
  667. display: flex;
  668. -webkit-box-orient: vertical;
  669. -webkit-box-direction: normal;
  670. -webkit-flex-direction: column;
  671. flex-direction: column;
  672. color: #AFB3BF;
  673. line-height: 40rpx;
  674. text-align: right;
  675. padding-right: 20rpx;
  676. font-size: 14px;
  677. }
  678. .buyup {
  679. background-color: #FFFFFF;
  680. border-radius: 20px;
  681. margin-top: 10px;
  682. }
  683. .buylow {
  684. background-color: #FFFFFF;
  685. border-radius: 20px;
  686. margin-top: 10px;
  687. }
  688. .btn {
  689. border-radius: 20px;
  690. margin-top: 10px;
  691. background-color: #22C572;
  692. color: #FFFFFF;
  693. }
  694. .validate {
  695. width: 100px;
  696. height: 32px;
  697. background-color: #F5F6F9;
  698. color: #AFB3BF;
  699. border-radius: 10px;
  700. border: none;
  701. text-align: center;
  702. line-height: 30px;
  703. }
  704. .getcode {
  705. font-size: 14px;
  706. position: absolute;
  707. top: 50%;
  708. transform: translateY(-50%);
  709. color: #AFB3BF;
  710. background: #F5F6F9;
  711. height: 30px;
  712. line-height: 30px;
  713. }
  714. .getcode.active {
  715. border: none;
  716. }
  717. .getcode.active {
  718. background: #22C572;
  719. color: #fff;
  720. }
  721. </style>