sellEdit.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  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. if(res.errmsg){
  330. uni.showToast({
  331. title: res.errmsg,
  332. icon: 'none',
  333. duration: 2000
  334. })
  335. }
  336. else{
  337. uni.showToast({
  338. title: "系统异常,请联系管理员",
  339. icon: 'none',
  340. duration: 2000
  341. })
  342. }
  343. });
  344. },
  345. getcode() {
  346. var that = this
  347. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(that.deptList.sellerPhone)) {
  348. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  349. phone: that.deptList.sellerPhone
  350. }).then(res => {
  351. if (res.data.code == 200) {
  352. that.sendDisabled = true
  353. let sec = 60
  354. let interval = setInterval(() => {
  355. sec--;
  356. that.sendText = sec + 's后重发'
  357. if (sec <= 0) {
  358. that.sendDisabled = false
  359. that.sendText = "获取验证码"
  360. clearInterval(interval)
  361. }
  362. }, 1000)
  363. } else {
  364. uni.showToast({
  365. title: res.data.message,
  366. icon: 'none',
  367. duration: 2000
  368. })
  369. return
  370. }
  371. })
  372. .catch(res => {
  373. uni.showToast({
  374. title: res.data.message,
  375. icon: 'none',
  376. duration: 2000
  377. })
  378. return
  379. });
  380. } else {
  381. uni.showToast({
  382. title: '请输入正确的手机号',
  383. icon: 'none',
  384. duration: 2000
  385. })
  386. }
  387. },
  388. regionpicker(e) {
  389. this.deptList.sendPrivate = e.province.label
  390. this.deptList.sendCity = e.city.label
  391. this.deptList.sendArea = e.area.label
  392. this.region = e.province.label + '-' + e.city.label + '-' + e.area.label
  393. },
  394. regionchange() {
  395. this.show = true
  396. },
  397. regionpicker1(e) {
  398. this.deptList.outputPrivate = e.province.label
  399. this.deptList.outputCity = e.city.label
  400. this.region1 = e.province.label + '-' + e.city.label
  401. },
  402. regionchange1() {
  403. this.show1 = true
  404. },
  405. checkedbox(e) {
  406. this.checked = !this.checked
  407. },
  408. typeChange(e) {
  409. this.typesIndex = e.detail.value
  410. this.types = this.typesType[this.typesIndex];
  411. this.deptList.salePlanTypeKey = e.detail.value
  412. this.deptList.salePlanType = this.typesType[this.typesIndex];
  413. if (this.typesIndex == 0) {
  414. this.deptList.priceType = '定价采购'
  415. } else {
  416. this.deptList.priceType = '期货盘面价+基差'
  417. }
  418. },
  419. navToDetailPage() {
  420. // if (index == 1) {
  421. uni.navigateTo({
  422. url: `/pageD/myRelease/Identity_switching`
  423. })
  424. },
  425. commit() {
  426. if (!this.deptList.title) {
  427. this.$api.msg('标题不能为空')
  428. return
  429. }
  430. if (this.deptList.title.length > 16 || this.deptList.title.length < 2) {
  431. this.$api.msg('标题输入错误')
  432. return
  433. }
  434. if (!this.deptList.goodsName) {
  435. this.$api.msg('货名不能为空')
  436. return
  437. }
  438. if (this.deptList.goodsName.length > 6 || this.deptList.goodsName.length < 1) {
  439. this.$api.msg('货名输入错误')
  440. return
  441. }
  442. if (!this.deptList.plannedSaleVolume) {
  443. this.$api.msg('出货量不能为空')
  444. return
  445. }
  446. if (this.deptList.plannedSaleVolume > 100000 || this.deptList.plannedSaleVolume < 1) {
  447. this.$api.msg('出货量输入错误')
  448. return
  449. }
  450. if (this.deptList.plannedSaleVolume.toString().indexOf('.') != -1) {
  451. if (this.deptList.plannedSaleVolume.split('.')[1].length > 2) {
  452. this.$api.msg('出货量输入错误')
  453. return
  454. }
  455. }
  456. if (!this.deptList.minimumVolume) {
  457. this.$api.msg('最小成交量不能为空')
  458. return
  459. }
  460. if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
  461. this.$api.msg('最小成交量输入错误')
  462. return
  463. }
  464. if (this.deptList.minimumVolume.toString().indexOf('.') != -1) {
  465. if (this.deptList.minimumVolume.split('.')[1].length > 2) {
  466. this.$api.msg('最小成交量输入错误')
  467. return
  468. }
  469. }
  470. if (!this.deptList.salePlanType) {
  471. this.$api.msg('类型不能为空')
  472. return
  473. }
  474. if (!this.deptList.priceType) {
  475. this.$api.msg('价格类型不能为空')
  476. return
  477. }
  478. if (this.deptList.salePlanType == '现货') {
  479. if (!this.deptList.salePrice) {
  480. this.$api.msg('单价不能为空')
  481. return
  482. }
  483. if (this.deptList.salePrice > 100000 || this.deptList.salePrice < 1) {
  484. this.$api.msg('单价输入错误')
  485. return
  486. }
  487. if (this.deptList.salePrice.indexOf('.') != -1) {
  488. if (this.deptList.salePrice.split('.')[1].length > 2) {
  489. this.$api.msg('单价输入错误')
  490. return
  491. }
  492. }
  493. } else if (this.deptList.salePlanType == '期货') {
  494. if (!String(this.deptList.basisPrice)) {
  495. this.$api.msg('基差(元/吨)不能为空')
  496. return
  497. }
  498. // if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 1) {
  499. // this.$api.msg('基差输入错误')
  500. // return
  501. // }
  502. // if (this.deptList.basisPrice.indexOf('.') != -1) {
  503. // if (this.deptList.basisPrice.split('.')[1].length > 2) {
  504. // this.$api.msg('基差输入错误')
  505. // return
  506. // }
  507. // }
  508. }
  509. if (!this.deptList.sellerPhone) {
  510. this.$api.msg('卖方手机号不能为空')
  511. return
  512. }
  513. if (!this.verifyCode) {
  514. this.$api.msg('验证码不能为空')
  515. return
  516. }
  517. if (this.checked == false) {
  518. if (this.deptList.waterContent && this.deptList.waterContent < 0 ||
  519. this.deptList.waterContent && this.deptList.waterContent > 40) {
  520. this.$api.msg('水分输入错误')
  521. return
  522. }
  523. if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
  524. if (this.deptList.waterContent.split('.')[1].length > 2) {
  525. this.$api.msg('水分输入错误')
  526. return
  527. }
  528. }
  529. if (this.deptList.bulkDensity && this.deptList.bulkDensity < 0 ||
  530. this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
  531. this.$api.msg('容重输入错误')
  532. return
  533. }
  534. if (this.deptList.jiaorenli && this.deptList.jiaorenli < 0 ||
  535. this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
  536. this.$api.msg('热损伤输入错误')
  537. return
  538. }
  539. if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
  540. if (this.deptList.jiaorenli.split('.')[1].length > 2) {
  541. this.$api.msg('热损伤输入错误')
  542. return
  543. }
  544. }
  545. if (this.deptList.impurity && this.deptList.impurity < 0 ||
  546. this.deptList.impurity && this.deptList.impurity > 40) {
  547. this.$api.msg('杂质输入错误')
  548. return
  549. }
  550. if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
  551. if (this.deptList.impurity.split('.')[1].length > 2) {
  552. this.$api.msg('杂质输入错误')
  553. return
  554. }
  555. }
  556. if (this.deptList.mildewGrain && this.deptList.mildewGrain < 0 ||
  557. this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
  558. this.$api.msg('霉变粒输入错误')
  559. return
  560. }
  561. if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
  562. if (this.deptList.mildewGrain.split('.')[1].length > 2) {
  563. this.$api.msg('霉变粒输入错误')
  564. return
  565. }
  566. }
  567. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 0 ||
  568. this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
  569. this.$api.msg('不完整粒输入错误')
  570. return
  571. }
  572. if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
  573. if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
  574. this.$api.msg('不完整粒输入错误')
  575. return
  576. }
  577. }
  578. if (this.deptList.protein && this.deptList.protein < 0 ||
  579. this.deptList.protein && this.deptList.protein > 80) {
  580. this.$api.msg('蛋白输入错误')
  581. return
  582. }
  583. if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
  584. if (this.deptList.protein.split('.')[1].length > 2) {
  585. this.$api.msg('蛋白输入错误')
  586. return
  587. }
  588. }
  589. }
  590. this.insertProcurementPlanInfo = this.deptList
  591. if (this.deptList.salePlanType == '期货') {
  592. this.insertProcurementPlanInfo.basisPrice = this.insertProcurementPlanInfo.basisPrice
  593. }
  594. this.insertProcurementPlanInfo.commonId = this.userInfo.id
  595. this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
  596. uni.showModal({
  597. content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
  598. success: (res) => {
  599. if (res.confirm) {
  600. var that = this
  601. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  602. phone: this.deptList.sellerPhone,
  603. verifyCode: this.verifyCode
  604. }).then(res => {
  605. if (res.data.code == 200) {
  606. that.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', that
  607. .insertProcurementPlanInfo).then(res => {
  608. if (res.data.code == 200) {
  609. // uni.showToast({
  610. // title: "发布成功",
  611. // icon: 'none',
  612. // })
  613. that.$api.msg('重新发布成功')
  614. that.deptList = {}
  615. uni.navigateTo({
  616. url: `/pages/release/release`
  617. })
  618. } else {
  619. uni.showToast({
  620. title: res.data.message,
  621. icon: 'none',
  622. duration: 2000
  623. })
  624. }
  625. })
  626. .catch(res => {
  627. if(res.errmsg){
  628. uni.showToast({
  629. title: res.errmsg,
  630. icon: 'none',
  631. duration: 2000
  632. })
  633. }
  634. else{
  635. uni.showToast({
  636. title: "系统异常,请联系管理员",
  637. icon: 'none',
  638. duration: 2000
  639. })
  640. }
  641. });
  642. } else if (res.data.code == '11003') {
  643. uni.showModal({
  644. title: '提示',
  645. content: '验证码不正确',
  646. });
  647. } else {
  648. uni.showToast({
  649. title: res.data.message,
  650. icon: 'none',
  651. duration: 2000
  652. })
  653. return
  654. }
  655. })
  656. .catch(res => {
  657. uni.showToast({
  658. title: res.data.message,
  659. icon: 'none',
  660. duration: 2000
  661. })
  662. return
  663. });
  664. }
  665. }
  666. })
  667. // this.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', this
  668. // .insertProcurementPlanInfo).then(res => {
  669. // if (res.data.code == 200) {
  670. // uni.showToast({
  671. // title: "发布成功",
  672. // icon: 'none',
  673. // })
  674. // // setTimeout(() => {
  675. // // uni.navigateBack({})
  676. // // }, 1000)
  677. // this.deptList = {}
  678. // uni.navigateTo({
  679. // url: `/pages/release/release`
  680. // })
  681. // } else {
  682. // uni.showToast({
  683. // title: res.data.message,
  684. // icon: 'none',
  685. // duration: 2000
  686. // })
  687. // }
  688. // })
  689. // .catch(res => {
  690. // uni.showToast({
  691. // title: res.errmsg,
  692. // icon: 'none',
  693. // duration: 2000
  694. // })
  695. // });
  696. },
  697. liChange(e) {
  698. this.liIndex = e.detail.value
  699. this.litypes = this.liType[this.liIndex];
  700. this.deptList.grainKey = e.detail.value
  701. this.deptList.grain = this.liType[this.liIndex]
  702. },
  703. pinChange(e) {
  704. this.pinIndex = e.detail.value
  705. this.pintypes = this.pinType[this.pinIndex];
  706. this.deptList.gradeKey = e.detail.value
  707. this.deptList.grade = this.pinType[this.pinIndex]
  708. },
  709. nianChange(e) {
  710. this.nianIndex = e.detail.value
  711. this.niantypes = this.nianType[this.nianIndex];
  712. this.deptList.outputYear = this.nianType[this.nianIndex]
  713. },
  714. baoChange(e) {
  715. this.baoIndex = e.detail.value
  716. this.baotypes = this.baoType[this.baoIndex];
  717. this.deptList.packingTypeKey = e.detail.value
  718. this.deptList.packingType = this.baoType[this.baoIndex];
  719. },
  720. chengChange(e) {
  721. this.chengIndex = e.detail.value
  722. this.chengtypes = this.chengType[this.chengIndex];
  723. this.deptList.freightPayerKey = e.detail.value + 1
  724. this.deptList.freightPayer = this.chengType[this.chengIndex];
  725. }
  726. }
  727. }
  728. </script>
  729. <style>
  730. .center {
  731. padding: 10px 20px;
  732. background-color: #F5F6FA;
  733. }
  734. .c-row {
  735. display: -webkit-box;
  736. display: -webkit-flex;
  737. display: flex;
  738. -webkit-box-align: center;
  739. -webkit-align-items: center;
  740. align-items: center;
  741. padding: 20rpx 30rpx;
  742. position: relative;
  743. }
  744. .con-list {
  745. -webkit-box-flex: 1;
  746. -webkit-flex: 1;
  747. flex: 1;
  748. display: -webkit-box;
  749. display: -webkit-flex;
  750. display: flex;
  751. -webkit-box-orient: vertical;
  752. -webkit-box-direction: normal;
  753. -webkit-flex-direction: column;
  754. flex-direction: column;
  755. line-height: 40rpx;
  756. text-align: right;
  757. padding-right: 20rpx;
  758. font-size: 14px;
  759. }
  760. .con-list input{
  761. font-size:14px !important;
  762. }
  763. .buyup {
  764. background-color: #FFFFFF;
  765. border-radius: 20px;
  766. margin-top: 10px;
  767. }
  768. .buylow {
  769. background-color: #FFFFFF;
  770. border-radius: 20px;
  771. margin-top: 10px;
  772. }
  773. .btn {
  774. border-radius: 20px;
  775. margin-top: 10px;
  776. background-color: #22C572;
  777. color: #FFFFFF;
  778. }
  779. .validate {
  780. width: 100px;
  781. height: 32px;
  782. background-color: #F5F6F9;
  783. color: #AFB3BF;
  784. border-radius: 10px;
  785. border: none;
  786. text-align: center;
  787. line-height: 30px;
  788. }
  789. .getcode {
  790. font-size: 14px;
  791. color: #AFB3BF;
  792. background: #F5F6F9;
  793. height: 30px;
  794. line-height: 30px;
  795. }
  796. .getcode.active {
  797. background: #22C572;
  798. color: #fff;
  799. }
  800. </style>