sellGrain.vue 23 KB

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