buyEdit.vue 23 KB

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