123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961 |
- <template>
- <view class="center">
- <view class="area">
- <view class="c-row b-b">
- <text class="tit">名头</text>
- <view class="con-list">
- <text @click="navToDetailPage">{{deptList.buyer}}<text class='tip_text cuIcon-right'></text></text>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">标题</text>
- <view class="con-list">
- <input maxlength='16' minlength='2' placeholder="请输入标题,不超过16个字" name="input"
- v-model="deptList.title"></input>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">货名</text>
- <view class="con-list">
- <input placeholder="请输入货名,如玉米" name="input" v-model="deptList.goodsName"></input>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">采购量(吨)</text>
- <view class="con-list">
- <input placeholder="请输入采购重量,如1000" name="input" v-model="deptList.plannedPurchaseVolume"></input>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">最小成交量(吨)</text>
- <view class="con-list">
- <input placeholder="请输入最小成交量" name="input" v-model="deptList.minimumVolume"></input>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">类型</text>
- <view class="con-list">
- {{deptList.procurementPlanType}}
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">价格类型</text>
- <view class="con-list">
- {{deptList.priceType}}
- </view>
- </view>
- <view class="c-row b-b" v-if="this.typesIndex != 1">
- <text class="tit">单价(元/吨)</text>
- <view class="con-list">
- <input placeholder="请填写单价" name="input" v-model="deptList.procurementPrice"></input>
- </view>
- </view>
- <view class="c-row b-b" v-if="this.typesIndex == 1">
- <text class="tit">基差(元/吨)</text>
- <view class="con-list">
- <input placeholder="请输入基差" name="input" v-model="deptList.basisPrice"></input>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">收货地区</text>
- <view class="con-list">
- <view @click='regionchange'>{{region}}</view>
- <u-picker :params='params' @confirm='regionpicker' mode="region" v-model="show"></u-picker>
- </view>
- </view>
- <view class="c-row b-b">
- <text class="tit">买方手机号</text>
- <view class="con-list">
- <input placeholder="请输入买方手机号" @input='phoneinput' name="input"
- v-model="deptList.buyerPhone"></input>
- </view>
- </view>
- <view class="c-row">
- <button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
- class='getcode'>{{sendText}}</button>
- <view class="con-list">
- <input v-model='verifyCode' placeholder="请输入验证码" type="text">
- </view>
- </view>
- </view>
- <view class="area">
- <view class="c-row b-b">
- <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>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">水分(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写水分占比" name="input" v-model="deptList.waterContent"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">容重(g/L)<= </text>
- <view class="con-list">
- <input placeholder="请填写容重" name="input" v-model="deptList.bulkDensity"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">热损伤(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写热损伤占比" name="input" v-model="deptList.jiaorenli"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">杂质(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写杂质占比" name="input" v-model="deptList.impurity"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">霉变粒(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写霉变粒占比" name="input" v-model="deptList.mildewGrain"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">不完整粒(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写不完整粒占比" name="input" v-model="deptList.imperfectGrain"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">蛋白(%)<= </text>
- <view class="con-list">
- <input placeholder="请填写蛋白占比" name="input" v-model="deptList.protein"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">粒型 </text>
- <picker @change="liChange" :value="liIndex" :range="liType" class="con-list" v-model="deptList.grain">
- <view class="con-list">
- {{liIndex>-1?liType[liIndex]:'请选择粒型'}}
- </view>
- </picker>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">品级 </text>
- <picker @change="pinChange" :value="pinIndex" :range="pinType" class="con-list"
- v-model="deptList.grade">
- <view class="con-list">
- {{pinIndex>-1?pinType[pinIndex]:'请选择品级'}}
- </view>
- </picker>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">产地</text>
- <view class="con-list">
- <view @click='regionchange1'>{{region1}}</view>
- <u-picker :params='params1' @confirm='regionpicker1' mode="region" v-model="show1"></u-picker>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">产出年份</text>
- <view class="con-list">
- <view @click='yearchange'>{{deptList.outputYear == null?"请选择出厂年份":deptList.outputYear}}</view>
- <u-picker :params='params2' @confirm='yearpicker($event)' v-model="show2" mode="time"
- :start-year="startData" :end-year="endData">
- </u-picker>
- </view>
- </view>
- <view v-if='checked' class="c-row b-b">
- <text class="tit">包装方式</text>
- <picker @change="baoChange" :value="baoIndex" :range="baoType" class="con-list">
- <view class="con-list">
- {{baoIndex>-1?baoType[baoIndex]:'请选择包装方式'}}
- </view>
- </picker>
- </view>
- <view v-if='checked&&baoIndex!=0' class="c-row b-b">
- <text class="tit">袋装备注</text>
- <view class="con-list">
- <input placeholder="请填写袋装备注" name="input" v-model="deptList.baggingNotes"></input>
- </view>
- </view>
- <view v-if='checked' class="c-row">
- <text class="tit">运费承担方</text>
- <picker @change="chengChange" :value="chengIndex" :range="chengType" class="con-list">
- <view class="con-list">
- {{chengIndex>-1?chengType[chengIndex]:'请选择运费承担方'}}
- </view>
- </picker>
- </view>
- </view>
- <view class="remark">
- <view class="c-row b-b">
- <text class="tit">备注</text>
- </view>
- <view style='position:relative;' class="wrap no-boder">
- <u-input class='textarea' v-model="deptList.remark" :type="type" :border="border" :height="height"
- :auto-height="autoHeight" maxlength="500" />
- <view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
- {{deptList.remark.length}}/500个字
- </view>
- </view>
- <view class="c-row b-b" style="display: block;">
- <text class="tit">附件</text>
- <view style="display: flex;flex-wrap: wrap;">
- <view v-for='(item,index) in imglist2' v-if="imglist2 && imglist2.length > 0"
- style="position: relative;margin-left: 20rpx;">
- <view class="delete_img" @click="deleteImg(index)">X</view>
- <image :src="item.appendixPath" mode="" style="width: 100px;height: 100px;"></image>
- </view>
- <view class="biankuang" @click="uploadClick" v-if="imglist2.length < 30">
- <view class="tubiao">
- <image class="upload" src="../../static/img/oa_office/upload.png" mode="">
- </image>
- <view class="" style="color:#8c8f98;">
- 选择图片
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <button @click="commit()" class="btn">重新发布</button>
- </view>
- </template>
- <script>
- import * as config from '../../config'
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- dotStyle: false,
- currentImg: 0,
- imgUrl: [],
- type: 'textarea',
- border: true,
- height: 150,
- autoHeight: true,
- types: '',
- goods: {},
- typesType: ["现货", "期货"],
- typesIndex: 0,
- deptList: {
- buyer: "",
- salePlanTypeKey: 0,
- grainKey: 0,
- gradeKey: 0,
- packingTypeKey: 0,
- freightPayerKey: -1,
- priceType: "定价采购",
- procurementPlanType: "现货",
- grain: "塔粮",
- grade: "一等品",
- outputYear: "2020",
- packingType: "散装",
- freightPayer: "",
- imglist2: [], //展示
- imglist: [], //存
- },
- imglist2: [], //展示
- imglist: [], //存
- params: {
- province: true,
- city: true,
- area: true,
- },
- params1: {
- province: true,
- city: true,
- },
- checked: true,
- insertProcurementPlanInfo: {},
- liIndex: -1,
- liType: ['塔粮', '筛粮', '中粒', '大粒'],
- pinIndex: -1,
- pinType: ['一等品', '二等品', '三等品', '等外'],
- nianIndex: 3,
- nianType: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014', '2013', '2012',
- '2011'
- ],
- id: 0,
- sendText: '获取验证码',
- show: false,
- show1: false,
- show2: false,
- region: '请选择收货地区',
- region1: '请选择产地',
- baoIndex: -1,
- baoType: ['散装', '大袋', '小袋'],
- chengIndex: -1,
- chengType: ['可议', '买方承担', '卖方承担'],
- codestatus: true,
- sendDisabled: false,
- sendText: '获取验证码',
- verifyCode: "",
- params2: {
- year: true,
- },
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- startData() {
- var data = new Date()
- return data.getFullYear() - 30
- },
- endData() {
- var data = new Date()
- return data.getFullYear()
- }
- },
- onLoad(options) {
- this.id = options.id
- this.getList()
- },
- onShow() {
- var that = this
- this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
- commonId: that.userInfo.id
- }).then(res => {
- if (res.data.code == 200) {
- if (res.data.data.customerTypeFlag == 1) {
- that.$set(that.deptList, 'buyer', res.data.data.customerName)
- } else {
- that.$set(that.deptList, 'buyer', res.data.data.compName)
- }
- that.goods = res.data.data
- }
- uni.hideLoading()
- })
- },
- watch: {
- imglist: {
- handler: function() {
- this.$api.doRequest('get', 'appendix/query/getFileList', {
- appendixIds: this.imglist.toString()
- }).then(res => {
- this.imglist2 = res.data.data
- for (let i = 0; i < this.imglist2.length; i++) {
- if (this.imglist2[i].appendixPath) {
- this.imgUrl.push(this.imglist2[i].appendixPath)
- }
- }
- })
- },
- deep: true
- }
- },
- methods: {
- deleteImg(index) {
- this.imglist.splice(index, 1)
- },
- phoneinput(e) {
- if (e.detail.value.length == 11) {
- this.codestatus = true
- }
- },
- async uploadClick() {
- let baseUrlNew = config.def().baseUrlNew
- console.log('baseUrlNew',baseUrlNew)
- uni.chooseImage({
- count:10,
- success: (chooseImageRes) => {
- console.log('chooseImageRes',chooseImageRes)
- let files = []
- for (let item of chooseImageRes.tempFiles) {
- files.push({
- name: 'fileName',
- url : item.path
- });
- }
- console.log(files)
- for (let i = 0; i < files.length; i++) {
- uni.uploadFile({
- url: baseUrlNew + 'appendix/api/uploadFiles',
- // url: baseUrlNew+'appendix/api/uploadFiles', //仅为示例,非真实的接口地址
- // files: files[i],
- filePath:files[i].url,
- name:files[i].name,
- formData: {
- // fileName: chooseImageRes.tempFiles[0],
- companyId: "2710b21efc1e4393930c5dc800010dc4",
- modelId: '',
- vesselId: '',
- },
- success: (uploadFileRes) => {
- console.log(JSON.parse(uploadFileRes.data))
- var data = JSON.parse(uploadFileRes.data).data
- this.$api.doRequest('post', '/appendix/api/saveFiles', {
- newAppendixs: [data],
- oldAppendixIds: ""
- }).then(res => {
- this.imglist.push(res.data.data[0])
- console.log(res)
- })
- console.log(uploadFileRes.data);
- },
- fail(res) {
-
- console.log(res);
- }
- });
- }
-
- }
- });
- },
- getList() {
- this.$api.doRequest('get', '/procurementPlanInfo/getProcurementPlan', {
- id: this.id
- }).then(res => {
- if (res.data.code == 200) {
- this.deptList = res.data.data
- this.imglist = this.deptList.addressUrl.split(',')
- if (this.deptList.waterContent != null || this.deptList.bulkDensity != null || this
- .deptList.jiaorenli != null || this.deptList.impurity != null || this.deptList
- .mildewGrain != null || this.deptList.imperfectGrain != null || this.deptList
- .protein != null || this.deptList.grade != null || this.deptList.outputYear != null ||
- this.deptList.packingType != null || this.deptList.freightPayer != null) {
- this.checked = false
- }
- let number = this.deptList.basisPrice
- this.deptList.basisPrice = Math.abs(number)
- if (this.deptList.outputPrivate && this.deptList.outputCity) {
- this.region1 = this.deptList.outputPrivate + '-' + this.deptList.outputCity
- }
- if (this.deptList.procurementPlanType == '期货') {
- let number = this.deptList.basisPrice
- this.deptList.basisPrice = Math.abs(number)
- }
- this.region = this.deptList.receivePrivate + '-' + this.deptList.receiveCity + '-' + this
- .deptList.receiveArea
- if (this.deptList.procurementPlanTypeKey == 2) {
- this.typesIndex = 1
- } else if (this.deptList.procurementPlanTypeKey == 1) {
- this.typesIndex = 0
- }
- this.liIndex = this.deptList.grainKey
- this.baoIndex = this.deptList.packingTypeKey
- this.pinIndex = this.deptList.gradeKey
- if (this.deptList.freightPayerKey == 1) {
- this.chengIndex = 0
- } else if (this.deptList.freightPayerKey == 2) {
- this.chengIndex = 1
- } else if (this.deptList.freightPayerKey == 3) {
- this.chengIndex = 2
- }
- }
- })
- .catch(res => {
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- yearpicker(e) {
- if (e != null) {
- this.morestatus = true
- } else {
- this.morestatus = false
- }
- this.deptList.outputYear = e.year
- },
- yearchange() {
- this.show2 = true
- },
- getcode() {
- var that = this
- if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.deptList.buyerPhone)) {
- this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
- phone: this.deptList.buyerPhone
- }).then(res => {
- if (res.data.code == 200) {
- that.sendDisabled = true
- let sec = 60
- let interval = setInterval(() => {
- sec--;
- that.sendText = sec + 's后重发'
- if (sec <= 0) {
- that.sendDisabled = false
- that.sendText = "获取验证码"
- clearInterval(interval)
- }
- }, 1000)
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- });
- } else {
- uni.showToast({
- title: '请输入正确的手机号',
- icon: 'none',
- duration: 2000
- })
- }
- },
- regionpicker(e) {
- this.deptList.receivePrivate = e.province.label
- this.deptList.receiveCity = e.city.label
- this.deptList.receiveArea = e.area.label
- this.region = e.province.label + '-' + e.city.label + '-' + e.area.label
- },
- regionchange() {
- this.show = true
- },
- regionpicker1(e) {
- this.deptList.outputPrivate = e.province.label
- this.deptList.outputCity = e.city.label
- this.region1 = e.province.label + '-' + e.city.label
- },
- regionchange1() {
- this.show1 = true
- },
- checkedbox(e) {
- this.checked = !this.checked
- },
- typeChange(e) {
- this.typesIndex = e.detail.value
- if (e.detail.value == 0) {
- this.deptList.priceType = '定价采购'
- this.deptList.procurementPlanTypeKey = 2
- } else {
- this.deptList.priceType = '期货盘面价+基差'
- this.deptList.procurementPlanTypeKey = 1
- }
- this.deptList.procurementPlanType = this.typesType[this.typesIndex];
- },
- navToDetailPage() {
- // if (index == 1) {
- uni.navigateTo({
- url: `/pageD/myRelease/Identity_switching?id=` + this.id
- })
- },
- commit() {
- // if (!this.deptList.goodsName) {
- // this.$api.msg('货名1不能为空')
- // return
- // }
- if (!this.deptList.title) {
- this.$api.msg('标题不能为空')
- return
- }
- if (this.deptList.title.length > 16 || this.deptList.title.length < 2) {
- this.$api.msg('标题输入错误')
- return
- }
- if (!this.deptList.goodsName) {
- this.$api.msg('货名不能为空')
- return
- }
- if (this.deptList.goodsName.length > 6 || this.deptList.goodsName.length < 1) {
- this.$api.msg('货名输入错误')
- return
- }
- if (!this.deptList.plannedPurchaseVolume) {
- this.$api.msg('采购量不能为空')
- return
- }
- if (this.deptList.plannedPurchaseVolume > 100000 || this.deptList.plannedPurchaseVolume < 1) {
- this.$api.msg('采购量输入错误')
- return
- }
- // var plannedPurchaseVolume = this.deptList.plannedPurchaseVolume.toString()
- if (this.deptList.plannedPurchaseVolume.toString().indexOf(".") != -1) {
- if (this.deptList.plannedPurchaseVolume.split('.')[1].length > 2) {
- this.$api.msg('采购量输入错误')
- return
- }
- }
- if (!this.deptList.minimumVolume) {
- this.$api.msg('最小成交量不能为空')
- return
- }
- if (this.deptList.minimumVolume > 100000 || this.deptList.minimumVolume < 1) {
- this.$api.msg('最小成交量输入错误')
- return
- }
- if (this.deptList.minimumVolume.toString().indexOf('.') != -1) {
- if (this.deptList.minimumVolume.split('.')[1].length > 2) {
- this.$api.msg('最小成交量输入错误')
- return
- }
- }
- if (!this.deptList.procurementPlanType) {
- this.$api.msg('类型不能为空')
- return
- }
- if (!this.deptList.priceType) {
- this.$api.msg('价格类型不能为空')
- return
- }
- if (this.deptList.procurementPlanType == '现货') {
- if (!this.deptList.procurementPrice) {
- this.$api.msg('单价不能为空')
- return
- }
- if (this.deptList.procurementPrice > 100000 || this.deptList.procurementPrice < 1) {
- this.$api.msg('单价输入错误')
- return
- }
- if (this.deptList.procurementPrice.indexOf('.') != -1) {
- if (this.deptList.procurementPrice.split('.')[1].length > 2) {
- this.$api.msg('单价输入错误')
- return
- }
- }
- } else if (this.deptList.procurementPlanType == '期货') {
- if (!String(this.deptList.basisPrice)) {
- this.$api.msg('基差不能为空')
- return
- }
- if (this.deptList.basisPrice > 10000 || this.deptList.basisPrice < 0) {
- this.$api.msg('基差输入错误')
- return
- }
- if (this.deptList.basisPrice.toString().indexOf('.') != -1) {
- if (this.deptList.basisPrice.toString().split('.')[1].length > 2) {
- this.$api.msg('基差输入错误')
- return
- }
- }
- }
- if (!this.deptList.buyerPhone) {
- this.$api.msg('买方手机号不能为空')
- return
- }
- if (!this.verifyCode) {
- this.$api.msg('验证码不能为空')
- return
- }
- if (this.checked == false) {
- if (this.deptList.waterContent && this.deptList.waterContent < 0 ||
- this.deptList.waterContent && this.deptList.waterContent > 40) {
- this.$api.msg('水分输入错误')
- return
- }
- if (this.deptList.waterContent && this.deptList.waterContent.indexOf('.') != -1) {
- if (this.deptList.waterContent.split('.')[1].length > 2) {
- this.$api.msg('水分输入错误')
- return
- }
- }
- if (this.deptList.bulkDensity && this.deptList.bulkDensity < 0 ||
- this.deptList.bulkDensity && this.deptList.bulkDensity > 1000) {
- this.$api.msg('容重输入错误')
- return
- }
- if (this.deptList.jiaorenli && this.deptList.jiaorenli < 0 ||
- this.deptList.jiaorenli && this.deptList.jiaorenli > 40) {
- this.$api.msg('热损伤输入错误')
- return
- }
- if (this.deptList.jiaorenli && this.deptList.jiaorenli.indexOf('.') != -1) {
- if (this.deptList.jiaorenli.split('.')[1].length > 2) {
- this.$api.msg('热损伤输入错误')
- return
- }
- }
- if (this.deptList.impurity && this.deptList.impurity < 0 ||
- this.deptList.impurity && this.deptList.impurity > 40) {
- this.$api.msg('杂质输入错误')
- return
- }
- if (this.deptList.impurity && this.deptList.impurity.indexOf('.') != -1) {
- if (this.deptList.impurity.split('.')[1].length > 2) {
- this.$api.msg('杂质输入错误')
- return
- }
- }
- if (this.deptList.mildewGrain && this.deptList.mildewGrain < 0 ||
- this.deptList.mildewGrain && this.deptList.mildewGrain > 40) {
- this.$api.msg('霉变粒输入错误')
- return
- }
- if (this.deptList.mildewGrain && this.deptList.mildewGrain.indexOf('.') != -1) {
- if (this.deptList.mildewGrain.split('.')[1].length > 2) {
- this.$api.msg('霉变粒输入错误')
- return
- }
- }
- if (this.deptList.imperfectGrain && this.deptList.imperfectGrain < 0 ||
- this.deptList.imperfectGrain && this.deptList.imperfectGrain > 40) {
- this.$api.msg('不完整粒输入错误')
- return
- }
- if (this.deptList.imperfectGrain && this.deptList.imperfectGrain.indexOf('.') != -1) {
- if (this.deptList.imperfectGrain.split('.')[1].length > 2) {
- this.$api.msg('不完整粒输入错误')
- return
- }
- }
- if (this.deptList.protein && this.deptList.protein < 0 ||
- this.deptList.protein && this.deptList.protein > 80) {
- this.$api.msg('蛋白输入错误')
- return
- }
- if (this.deptList.protein && this.deptList.protein.indexOf('.') != -1) {
- if (this.deptList.protein.split('.')[1].length > 2) {
- this.$api.msg('蛋白输入错误')
- return
- }
- }
- }
- this.insertProcurementPlanInfo = this.deptList
- if (this.deptList.procurementPlanType == '期货') {
- this.insertProcurementPlanInfo.basisPrice = -this.insertProcurementPlanInfo.basisPrice
- }
- this.insertProcurementPlanInfo.commonId = this.userInfo.id
- this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
- if (this.imglist.length > 0) {
- this.insertProcurementPlanInfo.addressUrl = this.imglist.toString()
- }
- uni.showModal({
- content: '重新发布后交易信息将进入待审核状态,是否确定重新发布?',
- success: (res) => {
- if (res.confirm) {
- var that = this
- this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
- phone: this.deptList.buyerPhone,
- verifyCode: this.verifyCode
- }).then(res => {
- if (res.data.code == 200) {
- this.$api.doRequest('post',
- '/procurementPlanInfo/api/editProcurementPlan', this
- .insertProcurementPlanInfo).then(res => {
- if (res.data.code == 200) {
- uni.showToast({
- title: "发布成功",
- icon: 'none',
- duration: 2000
- })
- setTimeout(function() {
- uni.navigateBack({
- delta: 2
- })
- }, 2000)
- this.deptList = {}
- uni.navigateTo({
- url: `/pages/release/release`
- })
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- } else if (res.data.code == '11003') {
- uni.showModal({
- title: '提示',
- content: '验证码不正确',
- });
- } else {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- });
- }
- }
- })
- },
- liChange(e) {
- this.liIndex = e.detail.value
- this.litypes = this.liType[this.liIndex];
- this.deptList.grainKey = e.detail.value + 1
- this.deptList.grain = this.liType[this.liIndex]
- },
- pinChange(e) {
- this.pinIndex = e.detail.value
- this.pintypes = this.pinType[this.pinIndex];
- this.deptList.gradeKey = e.detail.value
- this.deptList.grade = this.pinType[this.pinIndex]
- },
- nianChange(e) {
- this.nianIndex = e.detail.value
- this.niantypes = this.nianType[this.nianIndex];
- this.deptList.outputYear = this.nianType[this.niantypes]
- },
- baoChange(e) {
- this.baoIndex = e.detail.value
- this.baotypes = this.baoType[this.baoIndex];
- this.deptList.packingTypeKey = e.detail.value
- this.deptList.packingType = this.baoType[this.baoIndex];
- },
- chengChange(e) {
- this.chengIndex = e.detail.value
- this.chengtypes = this.chengType[this.chengIndex];
- this.deptList.freightPayerKey = e.detail.value + 1
- this.deptList.freightPayer = this.chengType[this.chengIndex];
- }
- }
- }
- </script>
- <style>
- .center {
- padding: 10px 20px;
- background-color: #F5F6FA;
- }
- .c-row {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- padding: 20rpx 30rpx;
- position: relative;
- }
- .con-list {
- -webkit-box-flex: 1;
- -webkit-flex: 1;
- flex: 1;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- -webkit-flex-direction: column;
- flex-direction: column;
- line-height: 40rpx;
- text-align: right;
- padding-right: 20rpx;
- font-size: 14px;
- }
- .con-list input {
- font-size: 14px !important;
- }
- .area {
- background-color: #FFFFFF;
- border-radius: 20px;
- margin-top: 10px;
- }
- .btn {
- margin-top: 10px;
- border-radius: 20px;
- background-color: #22C572;
- color: #FFFFFF;
- }
- .getcode {
- font-size: 14px;
- color: #AFB3BF;
- background: #F5F6F9;
- height: 30px;
- line-height: 30px;
- }
- .getcode.active {
- background: #22C572;
- color: #fff;
- }
- .remark {
- background-color: #FFFFFF;
- border-radius: 20px;
- margin-top: 10px;
- }
- .wrap {
- padding-top: 5px;
- font-size: 14px;
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- input {
- font-size: 14px;
- }
- }
- .textarea {
- background: #F9F9FA;
- border: 1px solid #EEEEEE;
- }
- .delete_img {
- position: absolute;
- z-index: 100;
- left: 84px;
- color: #ffffff;
- font-size: 28rpx;
- border: 1px;
- border-radius: 5rpx;
- width: 32rpx;
- height: 32rpx;
- background-color: #ff0000;
- text-align: center;
- }
- .tubiao {
- margin: 0 auto;
- text-align: center;
- margin-top: 35rpx;
- }
-
- .biankuang {
- border: 1px dashed #AFB3BF;
- border-radius: 10rpx;
- width: 200rpx;
- height: 200rpx;
- margin-left: 20rpx;
- }
-
- .upload {
- width: 80rpx;
- height: 80rpx;
- }
- </style>
|