sellEdit.vue 24 KB

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