buyEdit.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  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. if(res.errmsg){
  324. uni.showToast({
  325. title: res.errmsg,
  326. icon: 'none',
  327. duration: 2000
  328. })
  329. }
  330. else{
  331. uni.showToast({
  332. title: "系统异常,请联系管理员",
  333. icon: 'none',
  334. duration: 2000
  335. })
  336. }
  337. });
  338. },
  339. yearpicker(e) {
  340. if(e!=null){
  341. this.morestatus=true
  342. }else{
  343. this.morestatus=false
  344. }
  345. this.deptList.outputYear = e.year
  346. },
  347. yearchange() {
  348. this.show2 = true
  349. },
  350. getcode(){
  351. var that = this
  352. if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.deptList.buyerPhone)){
  353. this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.deptList.buyerPhone}).then(res => {
  354. if(res.data.code==200){
  355. that.sendDisabled = true
  356. let sec = 60
  357. let interval = setInterval(() => {
  358. sec--;
  359. that.sendText = sec + 's后重发'
  360. if (sec <= 0) {
  361. that.sendDisabled = false
  362. that.sendText = "获取验证码"
  363. clearInterval(interval)
  364. }
  365. }, 1000)
  366. }else{
  367. uni.showToast({
  368. title: res.data.message,
  369. icon:'none',
  370. duration: 2000
  371. })
  372. }
  373. })
  374. .catch(res => {
  375. uni.showToast({
  376. title: res.data.message,
  377. icon:'none',
  378. duration: 2000
  379. })
  380. });
  381. }else{
  382. uni.showToast({
  383. title: '请输入正确的手机号',
  384. icon:'none',
  385. duration: 2000
  386. })
  387. }
  388. },
  389. regionpicker(e){
  390. this.deptList.receivePrivate=e.province.label
  391. this.deptList.receiveCity=e.city.label
  392. this.deptList.receiveArea=e.area.label
  393. this.region=e.province.label+'-'+e.city.label+'-'+e.area.label
  394. },
  395. regionchange(){
  396. this.show=true
  397. },
  398. regionpicker1(e){
  399. this.deptList.outputPrivate=e.province.label
  400. this.deptList.outputCity=e.city.label
  401. this.region1=e.province.label+'-'+e.city.label
  402. },
  403. regionchange1(){
  404. this.show1=true
  405. },
  406. checkedbox(e){
  407. this.checked = !this.checked
  408. },
  409. typeChange(e) {
  410. this.typesIndex = e.detail.value
  411. if(e.detail.value==0){
  412. this.deptList.priceType = '定价采购'
  413. this.deptList.procurementPlanTypeKey =2
  414. }else{
  415. this.deptList.priceType = '期货盘面价+基差'
  416. this.deptList.procurementPlanTypeKey =1
  417. }
  418. this.deptList.procurementPlanType = this.typesType[this.typesIndex];
  419. },
  420. navToDetailPage() {
  421. // if (index == 1) {
  422. uni.navigateTo({
  423. url: `/pageD/myRelease/Identity_switching?id=`+this.id
  424. })
  425. },
  426. commit() {
  427. // if (!this.deptList.goodsName) {
  428. // this.$api.msg('货名1不能为空')
  429. // return
  430. // }
  431. if (!this.deptList.title) {
  432. this.$api.msg('标题不能为空')
  433. return
  434. }
  435. if (this.deptList.title.length>16||this.deptList.title.length<2) {
  436. this.$api.msg('标题输入错误')
  437. return
  438. }
  439. if (!this.deptList.goodsName) {
  440. this.$api.msg('货名不能为空')
  441. return
  442. }
  443. if (this.deptList.goodsName.length>6||this.deptList.goodsName.length<1) {
  444. this.$api.msg('货名输入错误')
  445. return
  446. }
  447. if (!this.deptList.plannedPurchaseVolume) {
  448. this.$api.msg('采购量不能为空')
  449. return
  450. }
  451. if (this.deptList.plannedPurchaseVolume>100000||this.deptList.plannedPurchaseVolume<1) {
  452. this.$api.msg('采购量输入错误')
  453. return
  454. }
  455. // var plannedPurchaseVolume = this.deptList.plannedPurchaseVolume.toString()
  456. if (this.deptList.plannedPurchaseVolume.toString().indexOf(".") != -1) {
  457. if(this.deptList.plannedPurchaseVolume.split('.')[1].length>2){
  458. this.$api.msg('采购量输入错误')
  459. return
  460. }
  461. }
  462. if (!this.deptList.minimumVolume) {
  463. this.$api.msg('最小成交量不能为空')
  464. return
  465. }
  466. if (this.deptList.minimumVolume>100000||this.deptList.minimumVolume<1) {
  467. this.$api.msg('最小成交量输入错误')
  468. return
  469. }
  470. if (this.deptList.minimumVolume.toString().indexOf('.')!=-1) {
  471. if(this.deptList.minimumVolume.split('.')[1].length>2){
  472. this.$api.msg('最小成交量输入错误')
  473. return
  474. }
  475. }
  476. if (!this.deptList.procurementPlanType) {
  477. this.$api.msg('类型不能为空')
  478. return
  479. }
  480. if (!this.deptList.priceType) {
  481. this.$api.msg('价格类型不能为空')
  482. return
  483. }
  484. if(this.deptList.procurementPlanType == '现货'){
  485. if (!this.deptList.procurementPrice) {
  486. this.$api.msg('单价不能为空')
  487. return
  488. }
  489. if (this.deptList.procurementPrice>100000||this.deptList.procurementPrice<1) {
  490. this.$api.msg('单价输入错误')
  491. return
  492. }
  493. if (this.deptList.procurementPrice.indexOf('.')!=-1) {
  494. if(this.deptList.procurementPrice.split('.')[1].length>2){
  495. this.$api.msg('单价输入错误')
  496. return
  497. }
  498. }
  499. }else if(this.deptList.procurementPlanType == '期货'){
  500. if (!String(this.deptList.basisPrice)) {
  501. this.$api.msg('基差不能为空')
  502. return
  503. }
  504. if (this.deptList.basisPrice>10000||this.deptList.basisPrice<0) {
  505. this.$api.msg('基差输入错误')
  506. return
  507. }
  508. if (this.deptList.basisPrice.toString().indexOf('.')!=-1) {
  509. if(this.deptList.basisPrice.toString().split('.')[1].length>2){
  510. this.$api.msg('基差输入错误')
  511. return
  512. }
  513. }
  514. }
  515. if (!this.deptList.buyerPhone) {
  516. this.$api.msg('买方手机号不能为空')
  517. return
  518. }
  519. if(!this.verifyCode){
  520. this.$api.msg('验证码不能为空')
  521. return
  522. }
  523. if(this.checked == false){
  524. if (this.deptList.waterContent&&this.deptList.waterContent<0||
  525. this.deptList.waterContent&&this.deptList.waterContent>40) {
  526. this.$api.msg('水分输入错误')
  527. return
  528. }
  529. if (this.deptList.waterContent&&this.deptList.waterContent.indexOf('.')!=-1) {
  530. if(this.deptList.waterContent.split('.')[1].length>2){
  531. this.$api.msg('水分输入错误')
  532. return
  533. }
  534. }
  535. if (this.deptList.bulkDensity&&this.deptList.bulkDensity<0||
  536. this.deptList.bulkDensity&&this.deptList.bulkDensity>1000) {
  537. this.$api.msg('容重输入错误')
  538. return
  539. }
  540. if (this.deptList.jiaorenli&&this.deptList.jiaorenli<0||
  541. this.deptList.jiaorenli&&this.deptList.jiaorenli>40) {
  542. this.$api.msg('热损伤输入错误')
  543. return
  544. }
  545. if (this.deptList.jiaorenli&&this.deptList.jiaorenli.indexOf('.')!=-1) {
  546. if(this.deptList.jiaorenli.split('.')[1].length>2){
  547. this.$api.msg('热损伤输入错误')
  548. return
  549. }
  550. }
  551. if (this.deptList.impurity&&this.deptList.impurity<0||
  552. this.deptList.impurity&&this.deptList.impurity>40) {
  553. this.$api.msg('杂质输入错误')
  554. return
  555. }
  556. if (this.deptList.impurity&&this.deptList.impurity.indexOf('.')!=-1) {
  557. if(this.deptList.impurity.split('.')[1].length>2){
  558. this.$api.msg('杂质输入错误')
  559. return
  560. }
  561. }
  562. if (this.deptList.mildewGrain&&this.deptList.mildewGrain<0||
  563. this.deptList.mildewGrain&&this.deptList.mildewGrain>40) {
  564. this.$api.msg('霉变粒输入错误')
  565. return
  566. }
  567. if (this.deptList.mildewGrain&&this.deptList.mildewGrain.indexOf('.')!=-1) {
  568. if(this.deptList.mildewGrain.split('.')[1].length>2){
  569. this.$api.msg('霉变粒输入错误')
  570. return
  571. }
  572. }
  573. if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain<0||
  574. this.deptList.imperfectGrain&&this.deptList.imperfectGrain>40) {
  575. this.$api.msg('不完整粒输入错误')
  576. return
  577. }
  578. if (this.deptList.imperfectGrain&&this.deptList.imperfectGrain.indexOf('.')!=-1) {
  579. if(this.deptList.imperfectGrain.split('.')[1].length>2){
  580. this.$api.msg('不完整粒输入错误')
  581. return
  582. }
  583. }
  584. if (this.deptList.protein && this.deptList.protein < 0 ||
  585. this.deptList.protein && this.deptList.protein > 80) {
  586. this.$api.msg('蛋白输入错误')
  587. return
  588. }
  589. if (this.deptList.protein && this.deptList.protein.indexOf('.')!=-1) {
  590. if(this.deptList.protein.split('.')[1].length>2){
  591. this.$api.msg('蛋白输入错误')
  592. return
  593. }
  594. }
  595. }
  596. this.insertProcurementPlanInfo = this.deptList
  597. if(this.deptList.procurementPlanType == '期货'){
  598. this.insertProcurementPlanInfo.basisPrice=-this.insertProcurementPlanInfo.basisPrice
  599. }
  600. this.insertProcurementPlanInfo.commonId = this.userInfo.id
  601. this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  602. uni.showModal({
  603. content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
  604. success: (res) => {
  605. if(res.confirm) {
  606. var that = this
  607. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  608. phone: this.deptList.buyerPhone,
  609. verifyCode: this.verifyCode
  610. }).then(res => {
  611. if (res.data.code == 200) {
  612. this.$api.doRequest('post', '/procurementPlanInfo/api/editProcurementPlan', this
  613. .insertProcurementPlanInfo).then(res => {
  614. if(res.data.code==200){
  615. uni.showToast({
  616. title: "发布成功",
  617. icon: 'none',
  618. duration: 2000
  619. })
  620. setTimeout(function(){
  621. uni.navigateBack({
  622. delta:2
  623. })
  624. },2000)
  625. this.deptList={}
  626. uni.navigateTo({
  627. url: `/pages/release/release`
  628. })
  629. }else{
  630. uni.showToast({
  631. title: res.data.message,
  632. icon: 'none',
  633. duration: 2000
  634. })
  635. }
  636. })
  637. .catch(res => {
  638. if(res.errmsg){
  639. uni.showToast({
  640. title: res.errmsg,
  641. icon: 'none',
  642. duration: 2000
  643. })
  644. }
  645. else{
  646. uni.showToast({
  647. title: "系统异常,请联系管理员",
  648. icon: 'none',
  649. duration: 2000
  650. })
  651. }
  652. });
  653. }
  654. else if(res.data.code=='11003'){
  655. uni.showModal({
  656. title: '提示',
  657. content: '验证码不正确',
  658. });
  659. }
  660. else {
  661. uni.showToast({
  662. title: res.data.message,
  663. icon: 'none',
  664. duration: 2000
  665. })
  666. }
  667. })
  668. .catch(res => {
  669. uni.showToast({
  670. title: res.data.message,
  671. icon: 'none',
  672. duration: 2000
  673. })
  674. });
  675. }
  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+1
  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.niantypes]
  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. .area{
  746. background-color: #FFFFFF;
  747. border-radius: 20px;
  748. margin-top: 10px;
  749. }
  750. .btn{
  751. margin-top: 10px;
  752. border-radius: 20px;
  753. background-color: #22C572;
  754. color: #FFFFFF;
  755. }
  756. .getcode {
  757. font-size: 14px;
  758. color: #AFB3BF;
  759. background: #F5F6F9;
  760. height: 30px;
  761. line-height: 30px;
  762. }
  763. .getcode.active {
  764. background: #22C572;
  765. color: #fff;
  766. }
  767. </style>