|
@@ -9,7 +9,7 @@
|
|
|
<view style="flex:1;margin-left:25px">
|
|
|
<text>发布供应</text>
|
|
|
</view>
|
|
|
- <view v-if="(selectValue=='个人'&&stepIndex==3)||(selectValue=='公司'&&stepIndex==3)">
|
|
|
+ <view>
|
|
|
<button plain="true" style="margin-right: 4px;border-radius: 24px;height:32px;line-height: 32px;font-size:15px;margin-top:4px;color:#1d60b1;border-color:#1d60b1;" @click="saveForm(1)">暂存</button>
|
|
|
<!-- <text style="margin-right: 4px;padding: 6px 15px;background-color:#00000026;border-radius: 30px;color: #3D7EFF;" @click="saveForm(1)">暂存</text> -->
|
|
|
</view>
|
|
@@ -452,11 +452,7 @@
|
|
|
text: '其他'
|
|
|
}
|
|
|
],
|
|
|
- extList: [{
|
|
|
- prodDesc: "",
|
|
|
- prodName: "",
|
|
|
- prodSpec: "",
|
|
|
- }],
|
|
|
+ extList: [],
|
|
|
// 机械五金/仪器仪表/耗材/其他
|
|
|
formInfo: {
|
|
|
jobTitle: '',
|
|
@@ -521,6 +517,8 @@
|
|
|
searchValue: '',
|
|
|
items: [],
|
|
|
org: {},
|
|
|
+ isEdit:false,
|
|
|
+ editItem:{}
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -535,7 +533,50 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(props) {
|
|
|
+ console.error(props.sid);
|
|
|
+ if(props.sid){
|
|
|
+ this.isEdit = true;
|
|
|
+ this.editItem = JSON.parse(uni.getStorageSync(props.sid)||'{}');
|
|
|
+
|
|
|
+ this.content = this.editItem.content;
|
|
|
+ this.selectValue2 = this.editItem.type==1?'产品':'服务';
|
|
|
+ this.selectValue3 = this.editItem.secType;
|
|
|
+ this.brand = this.editItem.brand;
|
|
|
+ this.selectValue = this.editItem.subject=='1'?'公司':'个人';
|
|
|
+
|
|
|
+
|
|
|
+ this.fileDetailList = this.editItem.fileDetailList;
|
|
|
+
|
|
|
+ for(let i=0;i<this.fileDetailList.length;i++){
|
|
|
+ this.fileDetailList[i].path = this.fileDetailList[i].ftpUrl
|
|
|
+ if(this.isImage(this.fileDetailList[i].fileName)){
|
|
|
+ this.imgList.push({
|
|
|
+ name: this.fileDetailList[i].fileName,
|
|
|
+ url: this.fileDetailList[i].ftpUrl,
|
|
|
+ path: this.fileDetailList[i].path
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.imgList.push({
|
|
|
+ name: this.fileDetailList[i].fileName,
|
|
|
+ url: this.fileDetailList[i].ftpUrl,
|
|
|
+ path: this.fileDetailList[i].path
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.selectValue2=='产品'){
|
|
|
+ this.selectValue4 = this.editItem.secType;
|
|
|
+ this.isMedical = this.editItem.isMedical;
|
|
|
+ this.extList = this.editItem.shareExt;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.org.name = this.editItem.company;
|
|
|
+ this.formInfo.jobTitle = this.editItem.jobTitle;
|
|
|
+ this.formInfo.contactPerson = this.editItem.contactPerson;
|
|
|
+ this.formInfo.contactMethod = this.editItem.contactMethod;
|
|
|
+ this.formInfo.contactNickName = this.formInfo.contactNickName;
|
|
|
+ }
|
|
|
this.getCompany();
|
|
|
},
|
|
|
methods: {
|
|
@@ -545,6 +586,13 @@
|
|
|
nextStep() {
|
|
|
//todo 检查
|
|
|
let that = this;
|
|
|
+ if(this.stepIndex==1&&this.extList.length==0){
|
|
|
+ this.extList.push({
|
|
|
+ prodDesc: "",
|
|
|
+ prodName: "",
|
|
|
+ prodSpec: "",
|
|
|
+ })
|
|
|
+ }
|
|
|
if(this.stepIndex==2&&that.selectValue2=='产品'){
|
|
|
for(let i=0;i<this.extList.length;i++){
|
|
|
if(!this.extList[i].prodName||!this.extList[i].prodSpec){
|
|
@@ -556,6 +604,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if(this.stepIndex==2&&that.selectValue2=='服务'){
|
|
|
|
|
@@ -631,15 +680,8 @@
|
|
|
return false;
|
|
|
}
|
|
|
let that = this;
|
|
|
- if(this.formInfo.agree.length<1){
|
|
|
- uni.showToast({
|
|
|
- title: '请勾选同意平台核查所填信息的真实性',
|
|
|
- duration: 2000,
|
|
|
- icon:'none'
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(that.selectValue2=='服务'){
|
|
|
+
|
|
|
+ if(status!=1&&that.selectValue2=='服务'){
|
|
|
if(!this.content&&this.fileDetailList.length<1){
|
|
|
uni.showToast({
|
|
|
title: '请输入服务介绍或上传图片/文件',
|
|
@@ -650,7 +692,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(that.selectValue2=='产品'){
|
|
|
+ if(status!=1&&that.selectValue2=='产品'){
|
|
|
|
|
|
for(let i=0;i<this.extList.length;i++){
|
|
|
if(!this.extList[i].prodName||!this.extList[i].prodSpec){
|
|
@@ -664,6 +706,15 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(status!=1&&this.formInfo.agree.length<1){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请勾选同意平台核查所填信息的真实性',
|
|
|
+ duration: 2000,
|
|
|
+ icon:'none'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
let params = {
|
|
|
|
|
|
};
|
|
@@ -680,6 +731,9 @@
|
|
|
userNo: uni.getStorageSync('userNo'),
|
|
|
status: status==1?status:undefined,
|
|
|
brand: that.brand,
|
|
|
+ id: that.isEdit?that.editItem.id:undefined,
|
|
|
+ bisNo: that.isEdit?that.editItem.bisNo:undefined,
|
|
|
+ version: that.isEdit?that.editItem.version:undefined
|
|
|
}
|
|
|
if(that.selectValue=='公司'){
|
|
|
postData.companyEntity = {};
|
|
@@ -725,7 +779,7 @@
|
|
|
icon:'none'
|
|
|
});
|
|
|
that.canSave = false;
|
|
|
- request.post('/slbResourceShare/add', params).then(res => {
|
|
|
+ request.post(that.isEdit?'/slbResourceShare/update':'/slbResourceShare/add', params).then(res => {
|
|
|
that.canSave = true;
|
|
|
if (res.success) {
|
|
|
uni.showToast({
|