1、新增旧货市场
2、新增用户等级
This commit is contained in:
+74
-44
@@ -30,13 +30,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 手动填写 -->
|
||||
<template v-if="form1.data.fillType == 0">
|
||||
<template v-if="form1.data.fillType === 0">
|
||||
<view class="form-title-wrap">
|
||||
<view class="goods-info-title">
|
||||
<view class="form-title">
|
||||
商品信息
|
||||
</view>
|
||||
<text class="enquiry-no">询价单编号: {{ enquiryNo }}</text>
|
||||
<text class="enquiry-no">询价单编号: {{ form1.data.enquiryNo }}</text>
|
||||
</view>
|
||||
<view class="sales-code flex justify-end items-center">
|
||||
<text>金九信业务员编号:</text>
|
||||
@@ -51,8 +51,32 @@
|
||||
</view>
|
||||
</template>
|
||||
<!-- 批量上传 -->
|
||||
<template v-else>
|
||||
<view class="form-title-wrap mt-20">
|
||||
<view class="goods-info-title mb-20">
|
||||
<view class="form-title">
|
||||
采购单或附件上传
|
||||
</view>
|
||||
</view>
|
||||
<text class="ml-20 text-main text-28">上传自有采购单图片或文档,支持jpg/png/word/excel</text>
|
||||
</view>
|
||||
<vk-data-upload v-model="form1.data.multiFiles" accept="*"></vk-data-upload>
|
||||
<view class="form-title-wrap mt-20">
|
||||
<view class="goods-info-title">
|
||||
<view class="form-title">
|
||||
主要商品分类筛选
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex flex-wrap justify-start items-start my-20">
|
||||
<text v-for="(item, index) in goodsList" :key="index" @click="changeMultiGoods(item)"
|
||||
:class="[productIdList.includes(item._id) ? 'text-main' : '']"
|
||||
class="mr-25 mb-20 pointer">{{ item.name }}
|
||||
</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view v-if="form1.data.fillType == 0" class="btn-add-outer">
|
||||
<view v-if="form1.data.fillType === 0" class="btn-add-outer">
|
||||
<el-button @click="addProduct" type="primary" size="small" plain icon="el-icon-plus"
|
||||
class="empty-bg-plain-btn">添加商品
|
||||
</el-button>
|
||||
@@ -247,7 +271,7 @@
|
||||
</view>
|
||||
<view class="p-30">
|
||||
<view class="mb-20 flex justify-start items-center">
|
||||
<el-radio v-model="form1.data.signMethod" :label="0">法大大</el-radio>
|
||||
<el-radio v-model="form1.data.signMethod" :label="0">平台交易</el-radio>
|
||||
<el-radio v-model="form1.data.signMethod" :label="1">线下签约</el-radio>
|
||||
</view>
|
||||
<view v-if="form1.data.signMethod === 0">
|
||||
@@ -340,11 +364,11 @@
|
||||
<el-row :gutter="10" class="mb-20">
|
||||
<el-col :span="12" class="flex justify-start items-center">
|
||||
<text style="width: 160px">公司信息:</text>
|
||||
<el-input v-model="company.companyName" placeholder="" disabled/>
|
||||
<el-input v-model="company.companyName" placeholder=""/>
|
||||
</el-col>
|
||||
<el-col :span="12" class="flex justify-start items-center">
|
||||
<text style="width: 160px">公司联系方式:</text>
|
||||
<el-input v-model="company.legalMobile" disabled/>
|
||||
<el-input v-model="company.legalMobile"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
@@ -362,7 +386,7 @@
|
||||
</el-form>
|
||||
|
||||
<view class="form-footer">
|
||||
<el-button type="" @click="draft">保存草稿</el-button>
|
||||
<el-button @click="draft">保存草稿</el-button>
|
||||
<el-button type="primary" @click="submit">提交询价单</el-button>
|
||||
</view>
|
||||
<!-- <el-divider content-position="left">其他设置</el-divider> -->
|
||||
@@ -386,6 +410,7 @@ export default {
|
||||
components: {Gap, EnquiryTemplate},
|
||||
data() {
|
||||
return {
|
||||
disabled: false,
|
||||
provinceData: provinces,
|
||||
cityData: citys,
|
||||
areaData: areas,
|
||||
@@ -395,19 +420,23 @@ export default {
|
||||
},
|
||||
enquiryNo: '',
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
productList: [{}],
|
||||
productList: [],
|
||||
productIdList: [],
|
||||
baseAttributes: [],
|
||||
categoryTreeData: [],
|
||||
checkCategoryList: [],
|
||||
projectProvinceIndex: null,
|
||||
projectCityIndex: null,
|
||||
projectAreaIndex: null,
|
||||
goodsList: [],
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
fillType: 0,
|
||||
enquiryNo: dayjs().format('YYYYMMDD') + (Math.ceil(Math.random() * 10000)).toString(),
|
||||
// extraAttributes: {},
|
||||
// attributes: {},
|
||||
multiFiles: [],
|
||||
invoice: false,
|
||||
invoiceType: 0,
|
||||
invoiceOther: '',
|
||||
@@ -518,7 +547,6 @@ export default {
|
||||
{value: 5, label: "其他付款方式"},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
key: "", title: "", type: 'group', showLabel: false, justify: "start", columns: [
|
||||
{
|
||||
@@ -682,12 +710,11 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.enquiryNo = dayjs().format('YYYYMMDD') + (Math.ceil(Math.random() * 10000)).toString()
|
||||
onLoad(option) {
|
||||
const company = vk.getVuex('$user.userInfo.company')
|
||||
this.company.companyName = company?.companyName
|
||||
this.company.legalMobile = company?.legalMobile
|
||||
this.getAttributes()
|
||||
this.getGoodsList()
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
@@ -699,19 +726,30 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
if (option.id) this.getInfo(option.id)
|
||||
},
|
||||
methods: {
|
||||
getAttributes() {
|
||||
// vk.callFunction({
|
||||
// url: 'client/enquiry/attributes/pub/getList',
|
||||
// title: '请求中...',
|
||||
// data: {
|
||||
// pageSize: 1000
|
||||
// },
|
||||
// success: (res) => {
|
||||
// this.baseAttributes = res.rows
|
||||
// }
|
||||
// });
|
||||
getInfo(_id){
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id
|
||||
},
|
||||
success: (res) => {
|
||||
this.form1.data = res.data
|
||||
this.productList = res.data.productList
|
||||
}
|
||||
})
|
||||
},
|
||||
getGoodsList() {
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/template/pub/getList',
|
||||
title: '请求中',
|
||||
success: ({rows}) => {
|
||||
this.goodsList = rows
|
||||
}
|
||||
})
|
||||
},
|
||||
addProduct() {
|
||||
this.productList.push({})
|
||||
@@ -735,26 +773,12 @@ export default {
|
||||
this.submitAll()
|
||||
},
|
||||
async submitAll() {
|
||||
// 手动填写表单校验
|
||||
// if (this.form1.data.fillType == 0) {
|
||||
// const verifyTasks = []
|
||||
// for (var i = 0; i < this.productList.length; i++) {
|
||||
// const valid = new Promise((resolve, reject) => {
|
||||
// console.log(this.$refs['product' + i]);
|
||||
// console.log(this.$refs['product' + i][0].$refs);
|
||||
// this.$refs['product' + i][0].$refs.form1.validate((valid) => {
|
||||
// if (valid) {
|
||||
// resolve(valid)
|
||||
// } else {
|
||||
// reject()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// verifyTasks.push(valid)
|
||||
// }
|
||||
//
|
||||
// await Promise.all(verifyTasks)
|
||||
// }
|
||||
if (this.form1.data.fillType === 1) {
|
||||
this.productList = []
|
||||
this.productIdList.forEach(goodsId => {
|
||||
this.productList.push({goodsId})
|
||||
})
|
||||
}
|
||||
this.form1.data.productList = this.productList
|
||||
if (this.projectProvinceIndex !== null) {
|
||||
this.form1.data.province = this.provinceData[this.projectProvinceIndex].code
|
||||
@@ -765,6 +789,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.disabled = true
|
||||
// this.$refs.form1.submitForm()
|
||||
vk.callFunction({
|
||||
url: 'client/enquiry/sheet/kh/add',
|
||||
@@ -775,11 +800,16 @@ export default {
|
||||
message: "提交成功",
|
||||
type: 'success'
|
||||
})
|
||||
this.disabled = false
|
||||
vk.navigateBack()
|
||||
}
|
||||
})
|
||||
},
|
||||
changeMultiGoods(item) {
|
||||
const index = this.productIdList.indexOf(item._id)
|
||||
if (index === -1) this.productIdList.push(item._id)
|
||||
else this.productIdList.splice(index, 1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user