|
@@ -81,12 +81,12 @@
|
|
|
<input placeholder="请输入买方手机号" name="input" v-model="deptList.sellerPhone"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="c-row">
|
|
|
+ <view class="c-row">
|
|
|
<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
|
|
|
class='getcode'>{{sendText}}</button>
|
|
|
- <view class="con-list">
|
|
|
- <input v-model='verifyCode' maxlength="6" placeholder="请输入验证码" type="text">
|
|
|
- </view>
|
|
|
+ <view class="con-list">
|
|
|
+ <input v-model='verifyCode' maxlength="6" placeholder="请输入验证码" type="text">
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="buylow">
|
|
@@ -157,9 +157,10 @@
|
|
|
<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 @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">
|
|
@@ -185,18 +186,57 @@
|
|
|
</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: ["现货", "期货"],
|
|
@@ -209,7 +249,11 @@
|
|
|
outputYear: "2020",
|
|
|
packingType: "可议",
|
|
|
freightPayer: "",
|
|
|
+ imglist2: [], //展示
|
|
|
+ imglist: [], //存
|
|
|
},
|
|
|
+ imglist2: [], //展示
|
|
|
+ imglist: [], //存
|
|
|
params: {
|
|
|
province: true,
|
|
|
city: true,
|
|
@@ -246,14 +290,14 @@
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['hasLogin', 'userInfo']),
|
|
|
- startData(){
|
|
|
- var data = new Date()
|
|
|
- return data.getFullYear() - 30
|
|
|
- },
|
|
|
- endData(){
|
|
|
- var data = new Date()
|
|
|
- return data.getFullYear()
|
|
|
- }
|
|
|
+ startData() {
|
|
|
+ var data = new Date()
|
|
|
+ return data.getFullYear() - 30
|
|
|
+ },
|
|
|
+ endData() {
|
|
|
+ var data = new Date()
|
|
|
+ return data.getFullYear()
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.getList(options)
|
|
@@ -275,24 +319,98 @@
|
|
|
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].appendixName) {
|
|
|
+ // this.imglist2[i].type = this.imglist2[i].appendixName.split(".")[1]
|
|
|
+ // }
|
|
|
+ if (this.imglist2[i].appendixPath) {
|
|
|
+ this.imgUrl.push(this.imglist2[i].appendixPath)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ deleteImg(index) {
|
|
|
+ this.imglist.splice(index, 1)
|
|
|
+ },
|
|
|
yearpicker(e) {
|
|
|
- if(e!=null){
|
|
|
- this.morestatus=true
|
|
|
- }else{
|
|
|
- this.morestatus=false
|
|
|
+ if (e != null) {
|
|
|
+ this.morestatus = true
|
|
|
+ } else {
|
|
|
+ this.morestatus = false
|
|
|
}
|
|
|
this.deptList.outputYear = e.year
|
|
|
},
|
|
|
yearchange() {
|
|
|
this.show2 = 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(options) {
|
|
|
this.$api.doRequest('get', '/salePlanInfo/getSalePlanInfo', {
|
|
|
id: options.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
|
|
@@ -300,10 +418,10 @@
|
|
|
this.deptList.packingType != null || this.deptList.freightPayer != null) {
|
|
|
this.checked = false
|
|
|
}
|
|
|
- if(this.deptList.outputPrivate&&this.deptList.outputCity){
|
|
|
+ if (this.deptList.outputPrivate && this.deptList.outputCity) {
|
|
|
this.region1 = this.deptList.outputPrivate + '-' + this.deptList.outputCity
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.region = this.deptList.sendPrivate + '-' + this.deptList.sendCity + '-' + this
|
|
|
.deptList.sendArea
|
|
|
// if(this.deptList.salePlanTypeKey==2){
|
|
@@ -332,14 +450,13 @@
|
|
|
|
|
|
})
|
|
|
.catch(res => {
|
|
|
- if(res.errmsg){
|
|
|
+ if (res.errmsg) {
|
|
|
uni.showToast({
|
|
|
title: res.errmsg,
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
title: "系统异常,请联系管理员",
|
|
|
icon: 'none',
|
|
@@ -599,6 +716,9 @@
|
|
|
if (this.deptList.salePlanType == '期货') {
|
|
|
this.insertProcurementPlanInfo.basisPrice = this.insertProcurementPlanInfo.basisPrice
|
|
|
}
|
|
|
+ if (this.imglist.length > 0) {
|
|
|
+ this.insertProcurementPlanInfo.addressUrl = this.imglist.toString()
|
|
|
+ }
|
|
|
this.insertProcurementPlanInfo.commonId = this.userInfo.id
|
|
|
this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
|
|
|
uni.showModal({
|
|
@@ -611,7 +731,8 @@
|
|
|
verifyCode: this.verifyCode
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
- that.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', that
|
|
|
+ that.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo',
|
|
|
+ that
|
|
|
.insertProcurementPlanInfo).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
// uni.showToast({
|
|
@@ -632,14 +753,13 @@
|
|
|
}
|
|
|
})
|
|
|
.catch(res => {
|
|
|
- if(res.errmsg){
|
|
|
+ if (res.errmsg) {
|
|
|
uni.showToast({
|
|
|
title: res.errmsg,
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
title: "系统异常,请联系管理员",
|
|
|
icon: 'none',
|
|
@@ -673,7 +793,7 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// this.$api.doRequest('post', '/salePlanInfo/api/editSalePlanInfo', this
|
|
|
// .insertProcurementPlanInfo).then(res => {
|
|
|
// if (res.data.code == 200) {
|
|
@@ -772,9 +892,11 @@
|
|
|
padding-right: 20rpx;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
- .con-list input{
|
|
|
- font-size:14px !important;
|
|
|
- }
|
|
|
+
|
|
|
+ .con-list input {
|
|
|
+ font-size: 14px !important;
|
|
|
+ }
|
|
|
+
|
|
|
.buyup {
|
|
|
background-color: #FFFFFF;
|
|
|
border-radius: 20px;
|
|
@@ -787,6 +909,12 @@
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
|
|
|
+ .remark {
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 20px;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
.btn {
|
|
|
border-radius: 20px;
|
|
|
margin-top: 10px;
|
|
@@ -813,8 +941,92 @@
|
|
|
line-height: 30px;
|
|
|
}
|
|
|
|
|
|
+ .no-boder {
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .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;
|
|
|
+ }
|
|
|
.getcode.active {
|
|
|
background: #22C572;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ .fujian{
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ color: $font-color-dark;
|
|
|
+ line-height: 40upx;
|
|
|
+ text-align: right;
|
|
|
+ padding-right: 20upx;
|
|
|
+ }
|
|
|
+ .swiper .dots {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 53px;
|
|
|
+ background: rgba(255, 255, 255, 0.4);
|
|
|
+ border-radius: 0px 11px 11px 0px;
|
|
|
+ width: 58.5px;
|
|
|
+ height: 23px;
|
|
|
+ line-height: 23px;
|
|
|
+ text-align: center;
|
|
|
+ padding: 3px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ .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;
|
|
|
+ }
|
|
|
+ .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>
|