diff --git a/common/css/common.css b/common/css/common.css
index 3f14716..ab4d191 100644
--- a/common/css/common.css
+++ b/common/css/common.css
@@ -2104,6 +2104,10 @@ input:disabled {
width: 100%;
}
+.w-1200 {
+ width: 1200px
+}
+
.empty-bg-plain-btn {
background: none !important;
}
@@ -2386,6 +2390,10 @@ input:disabled {
padding: 30rpx;
}
+.p-40 {
+ padding: 40rpx;
+}
+
.px-20 {
padding: 0 20rpx;
}
@@ -2647,6 +2655,11 @@ input:disabled {
line-height: 40rpx;
}
+.text-50 {
+ font-size: 50rpx;
+ line-height: 50rpx;
+}
+
.rounded {
border-radius: 10rpx;
}
@@ -2664,23 +2677,31 @@ input:disabled {
}
.border {
- border: 1rpx solid #bbb;
+ border: 1rpx solid #F1F5F9;
}
.border-top {
- border-top: 1rpx solid #bbb;
+ border-top: 1rpx solid #F1F5F9;
}
.border-bottom {
- border-bottom: 1rpx solid #bbb;
+ border-bottom: 1rpx solid #F1F5F9;
}
.border-left {
- border-left: 1rpx solid #bbb;
+ border-left: 1rpx solid #F1F5F9;
}
.border-right {
- border-right: 1rpx solid #bbb;
+ border-right: 1rpx solid #F1F5F9;
+}
+
+.bg-gray{
+ background-color: #DDD;
+}
+
+.bg-gray-light{
+ background-color: #F9F9F9;
}
.footer {
diff --git a/components/category-bar/category-bar.vue b/components/category-bar/category-bar.vue
index de33579..eacf036 100644
--- a/components/category-bar/category-bar.vue
+++ b/components/category-bar/category-bar.vue
@@ -81,7 +81,8 @@
旧货交易
-
+
金久信黄页
@@ -28,7 +28,14 @@
return {
};
- }
+ },
+ methods:{
+ jump(url){
+ vk.navigateTo({
+ url
+ })
+ }
+ }
}
diff --git a/components/top-bar/top-bar.vue b/components/top-bar/top-bar.vue
index cadd134..0708380 100644
--- a/components/top-bar/top-bar.vue
+++ b/components/top-bar/top-bar.vue
@@ -25,7 +25,9 @@
买家中心
卖家中心
我的加工
- 金久信学堂
+
+ 金久信学堂
+
合同管理
订单管理
退出登录
diff --git a/pages.json b/pages.json
index 29f2581..7891d5d 100644
--- a/pages.json
+++ b/pages.json
@@ -1,190 +1,193 @@
{
- "pages": [
- {
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "金久信钢城"
- }
- },
- {
- "path": "pages/error/404/404",
- "style": {
- "navigationBarTitleText": "404"
- }
- }
- ,{
- "path" : "pages/auth/register/register",
- "style" :
- {
+ "pages": [
+ {
+ "path": "pages/index/index",
+ "style": {
+ "navigationBarTitleText": "金久信钢城"
+ }
+ },
+ {
+ "path": "pages/error/404/404",
+ "style": {
+ "navigationBarTitleText": "404"
+ }
+ },
+ {
+ "path": "pages/auth/register/register",
+ "style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
-
- }
- ,{
- "path" : "pages/auth/login/login",
- "style" :
- {
+ },
+ {
+ "path": "pages/auth/login/login",
+ "style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
}
-
- }
- ,{
- "path" : "pages/spot/release/release",
- "style" :
- {
+ },
+ {
+ "path": "pages/spot/release/release",
+ "style": {
"navigationBarTitleText": "发布现货",
"enablePullDownRefresh": false
}
-
- }
- ,{
- "path" : "pages/spot/goods/goods",
- "style" :
- {
+ },
+ {
+ "path": "pages/spot/goods/goods",
+ "style": {
"navigationBarTitleText": "现货市场",
"enablePullDownRefresh": false
}
-
- }
- ,{
- "path" : "pages/user/user",
- "style" :
- {
+ },
+ {
+ "path": "pages/spot/goods/my",
+ "style": {
+ "navigationBarTitleText": "我发布的现货",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/user/user",
+ "style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
-
},
{
- "path" : "pages/spot/goods/detail",
- "style" :
- {
- "navigationBarTitleText" : "",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/company/company",
- "style" :
- {
- "navigationBarTitleText" : "黄页",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/enquiry/release",
- "style" :
- {
- "navigationBarTitleText" : "发布询价",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/enquiry/list",
- "style" :
- {
- "navigationBarTitleText" : "询价",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/enquiry/my",
- "style" :
- {
- "navigationBarTitleText" : "我发布的询价单",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/enquiry/detail",
- "style" :
- {
- "navigationBarTitleText" : "报价单详情",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/enquiry/quote",
- "style" :
- {
- "navigationBarTitleText" : "填写报价单",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/contract/index",
- "style" :
- {
- "navigationBarTitleText" : "合同管理",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/process/list",
- "style" :
- {
- "navigationBarTitleText" : "找加工",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/process/release",
- "style" :
- {
- "navigationBarTitleText" : "发布找加工",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/process/quote",
- "style" :
- {
- "navigationBarTitleText" : "加工报价",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/process/detail",
- "style" :
- {
- "navigationBarTitleText" : "加工单详情",
- "enablePullDownRefresh" : false
- }
- },
- {
- "path" : "pages/process/my",
- "style" :
- {
- "navigationBarTitleText" : "我的加工单",
- "enablePullDownRefresh" : false
+ "path": "pages/spot/goods/detail",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false
}
},
{
- "path" : "pages/checkout/checkout",
- "style" :
- {
- "navigationBarTitleText" : "",
- "enablePullDownRefresh" : false
- }
+ "path": "pages/company/company",
+ "style": {
+ "navigationBarTitleText": "黄页",
+ "enablePullDownRefresh": false
+ }
},
{
- "path" : "pages/article/list",
- "style" :
- {
- "navigationBarTitleText" : "金久信学堂",
- "enablePullDownRefresh" : false
+ "path": "pages/enquiry/release",
+ "style": {
+ "navigationBarTitleText": "发布询价",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/enquiry/list",
+ "style": {
+ "navigationBarTitleText": "询价",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/enquiry/my",
+ "style": {
+ "navigationBarTitleText": "我发布的询价单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/enquiry/detail",
+ "style": {
+ "navigationBarTitleText": "报价单详情",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/enquiry/quote",
+ "style": {
+ "navigationBarTitleText": "填写报价单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/contract/index",
+ "style": {
+ "navigationBarTitleText": "合同管理",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/process/list",
+ "style": {
+ "navigationBarTitleText": "找加工",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/process/release",
+ "style": {
+ "navigationBarTitleText": "发布找加工",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/process/quote",
+ "style": {
+ "navigationBarTitleText": "加工报价",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/process/detail",
+ "style": {
+ "navigationBarTitleText": "加工单详情",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/process/my",
+ "style": {
+ "navigationBarTitleText": "我的加工单",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/checkout/checkout",
+ "style": {
+ "navigationBarTitleText": "",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/article/list",
+ "style": {
+ "navigationBarTitleText": "金久信学堂",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/user/school",
+ "style": {
+ "navigationBarTitleText": "金久信学堂",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/yellowPage/list",
+ "style": {
+ "navigationBarTitleText": "金久信黄页",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/yellowPage/info",
+ "style": {
+ "navigationBarTitleText": "详情",
+ "enablePullDownRefresh": false
}
}
],
- "globalStyle": {
- "navigationBarTextStyle": "black",
- "navigationBarTitleText": "金久信钢城",
- "navigationStyle": "custom",
- // #ifndef MP-ALIPAY
- "navigationBarBackgroundColor": "#F8F8F8",
- // #endif
- "backgroundColor": "#F8F8F8"
- }
+ "globalStyle": {
+ "navigationBarTextStyle": "black",
+ "navigationBarTitleText": "金久信钢城",
+ "navigationStyle": "custom",
+ // #ifndef MP-ALIPAY
+ "navigationBarBackgroundColor": "#F8F8F8",
+ // #endif
+ "backgroundColor": "#F8F8F8"
+ }
}
diff --git a/pages/article/list.vue b/pages/article/list.vue
index 4c280c6..873dbaa 100644
--- a/pages/article/list.vue
+++ b/pages/article/list.vue
@@ -7,7 +7,7 @@
@@ -107,6 +107,11 @@ export default {
})
this.list = rows
},
+ toMySchool(){
+ vk.navigateTo({
+ url: '/pages/user/school'
+ })
+ }
},
onLoad() {
this.getCateList()
diff --git a/pages/contract/index.vue b/pages/contract/index.vue
index 24a1b25..475f2cd 100644
--- a/pages/contract/index.vue
+++ b/pages/contract/index.vue
@@ -5,7 +5,7 @@
- -->
- 修改合同内容
@@ -129,6 +129,7 @@ export default {
data() {
return {
pageIndex: 1,
+ menuIndex: '0',
formData: {
status: 0,
tradeMethod: null
@@ -138,12 +139,18 @@ export default {
form1: {
// 表单请求数据,此处可以设置默认值
data: {
- contractId: ''
+ contractId: '',
+ signEndDate: '',
+ title: '',
+ contractFile: '',
+ buyerSignKeyword: '',
+ sellerSignKeyword: '',
+ otherFile: '',
},
// 表单属性
props: {
// 表单请求地址
- action: "client/contract/kh/launch",
+ action: 'client/contract/kh/launch',
// 表单字段显示规则
columns: [{
key: "title",
@@ -232,11 +239,12 @@ export default {
},
methods: {
menuSelect(e) {
+ this.menuIndex = String(e)
this.formData.status = Number(e)
this.query(1)
},
async query(pageIndex) {
- const tableData = await vk.callFunction({
+ this.tableData = await vk.callFunction({
url: 'client/contract/kh/getList',
title: '请求中...',
data: {
@@ -246,24 +254,38 @@ export default {
},
});
-
- // tableData.rows.forEach(item => {
-
- // })
-
- this.tableData = tableData
},
/**
- * @param {Object} item
* 创建合同
+ * @param contract
*/
createContract(contract) {
this.form1.data.contractId = contract._id
+ this.form1.props.action = 'client/contract/kh/launch'
+ this.form1.props.show = true
+ },
+ async changeContract(contract){
+ this.form1.data.contractId = contract._id
+ const res = await vk.callFunction({
+ url: 'client/contract/kh/getDetail',
+ title: '请求中...',
+ data: {
+ contractId: contract._id
+ },
+ });
+ this.form1.data.signEndDate = res.signEndDate
+ this.form1.data.title = res.docTitle
+ this.form1.data.contractFile = res.contractBase
+ this.form1.data.buyerSignKeyword = res.buyerSignKeyword
+ this.form1.data.sellerSignKeyword = res.sellerSignKeyword
+ this.form1.data.otherFile = res.otherFile
this.form1.props.show = true
},
onFormSuccess() {
this.form1.props.show = false
this.form1.data.contractId = null
+ this.formData.status = 1
+ this.menuIndex = '1'
this.query(1)
},
/**
diff --git a/pages/enquiry/components/template.vue b/pages/enquiry/components/template.vue
index 18ea685..badcd85 100644
--- a/pages/enquiry/components/template.vue
+++ b/pages/enquiry/components/template.vue
@@ -176,7 +176,7 @@
-
diff --git a/pages/enquiry/detail.vue b/pages/enquiry/detail.vue
index 9e1b799..a5925ae 100644
--- a/pages/enquiry/detail.vue
+++ b/pages/enquiry/detail.vue
@@ -26,7 +26,7 @@
{{
- (sheet.quoteList && sheet.quoteList.rows && sheet.quoteList.rows.length > 0) ? sheet.quoteList.rows.length : 0
+ (sheet.quoteList && sheet.quoteList.length > 0) ? sheet.quoteList.length : 0
}}
家已报价
@@ -57,10 +57,10 @@
我要申请加工
+ v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价
查看收到的申请加工
+ v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价
@@ -190,13 +190,13 @@
报价
操作
-
+
{{ item.subjectName }}
{{ item._add_time_str }}
{{ item.subjectMobile }}
{{ item.totalPrice }}元
- 选择
+ 选择
@@ -312,7 +312,7 @@ export default {
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
- quoteId: item._id
+ quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
@@ -328,7 +328,7 @@ export default {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
- vk.toast(`${item._id}-按钮1`);
+ this.showDialog = true
}
},
]
diff --git a/pages/enquiry/list.vue b/pages/enquiry/list.vue
index 42bfa63..40f28e8 100644
--- a/pages/enquiry/list.vue
+++ b/pages/enquiry/list.vue
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@
-
+
全部
@@ -115,7 +115,7 @@
@@ -147,11 +147,13 @@ export default {
checkCompanyList: [],
attributes: [],
keyword: '',
+ queryParam: {},
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
+ console.log(data)
vk.callFunction({
url: `client/enquiry/sheet/pub/getList`,
data: data,
@@ -265,7 +267,7 @@ export default {
// 表格相关结束 -----------------------------------------------------------
};
},
- onLoad() {
+ onShow() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
@@ -318,13 +320,13 @@ export default {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
- if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
+ if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.getCertUrl()
+ vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
@@ -332,7 +334,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- vk.navigateTo('/pages/user/user?menu=business-card');
+ vk.navigateTo({url: '/pages/user/user?menu=business-card'});
})
} else {
vk.navigateTo({
@@ -345,30 +347,18 @@ export default {
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
- item.forEach(sitem => {
- categoryIds.push(sitem._id)
- })
+ // console.log(item)
+ // item.forEach(sitem => {
+ // categoryIds.push(sitem._id)
+ // })
+ categoryIds.push(item)
})
-
- let provinceCodes = this.checkProvinceList.map(item => item.code)
-
- if (provinceCodes.includes(9999)) {
- provinceCodes = []
+ this.queryParam.formData = {
+ keyword: this.keyword,
+ companyList: this.checkCompanyList,
+ categoryIds
}
-
- vk.callFunction({
- url: 'client/enquiry/sheet/pub/getList',
- data: {
- pageIndex: pageIndex,
- pageSize: 20,
- keyword: this.keyword,
- },
- success: (data) => {
- console.log('data: ', data);
-
- this.goodsData = data
- }
- });
+ this.$refs.table1.search()
},
getAttributes() {
vk.callFunction({
diff --git a/pages/enquiry/my.vue b/pages/enquiry/my.vue
index b45c2f9..e7e1f3d 100644
--- a/pages/enquiry/my.vue
+++ b/pages/enquiry/my.vue
@@ -15,7 +15,7 @@
diff --git a/pages/enquiry/quote.vue b/pages/enquiry/quote.vue
index 43b3fe3..ca8ab38 100644
--- a/pages/enquiry/quote.vue
+++ b/pages/enquiry/quote.vue
@@ -51,7 +51,7 @@ export default {
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
- {key: "totalPrice", title: "货款总价", type: "money"},
+ {key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
],
@@ -97,7 +97,7 @@ export default {
},
methods: {
onFormSuccess() {
-
+ vk.navigateBack()
},
// 提交报价单
async submit() {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 1b0c95c..bc96e38 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -9,7 +9,7 @@
@@ -66,8 +66,9 @@
- -
-
+
-
+
报价中
@@ -101,18 +102,20 @@
-
+
{{ item.name }}
库存:{{ item.stock }}吨
供货地:{{ item.addressStr }}
-
-
-
+
+
+
{{ item.user.person.personName }}
{{ item.user.company.companyName }}
- 立即查看
@@ -274,18 +277,17 @@ export default {
}
.goods-list {
-
display: flex;
-
+ flex-wrap: wrap;
}
.goods {
- width: 217px;
+ width: 200px;
//height: 280px;
background-color: #FFFFFF;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
text-align: center;
- margin-right: 20px;
+ //margin-right: 25px;
margin-bottom: 25px;
padding: 10px 20px;
@@ -295,6 +297,9 @@ export default {
height: 62px;
padding-top: 20px;
font-weight: bold;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ -webkit-line-clamp: 2;
}
&-stock {
@@ -308,7 +313,7 @@ export default {
}
&-image {
- width: 200px;
+ width: 100%;
height: 70px;
margin: 0 auto;
@@ -338,9 +343,6 @@ export default {
cursor: pointer;
}
- .goods-image {
- width: 100%;
- }
.goods-address {
color: gray;
diff --git a/pages/process/detail.vue b/pages/process/detail.vue
index 8589b3a..97f7eea 100644
--- a/pages/process/detail.vue
+++ b/pages/process/detail.vue
@@ -20,15 +20,15 @@
+ v-if="info.answerEndTime && dayjs().diff(dayjs(info.answerEndTime), 'second') < 0">
距离加工结束还有:
{{
- dayjs().diff(dayjs(info.answerEndTime), 'day')
+ dayjs(info.answerEndTime).diff(dayjs(), 'day')
}}
天
- {{ (dayjs().diff(dayjs(info.answerEndTime), 'hour')) % 24 }}
+ {{ (dayjs(info.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
时
@@ -41,10 +41,10 @@
我要申请加工
+ v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">我要申请加工
查看收到的申请加工
+ v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请加工
@@ -170,7 +170,7 @@
收到的加工申请
关闭
-
+
@@ -225,14 +225,15 @@ export default {
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
- createContract({totalPrice, uid}) {
+ createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
- quoteId: this.id,
+ sheetId: this.id,
+ quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
diff --git a/pages/process/list.vue b/pages/process/list.vue
index df1f57b..f2b9bfe 100644
--- a/pages/process/list.vue
+++ b/pages/process/list.vue
@@ -15,7 +15,7 @@
@@ -70,7 +70,7 @@
-
+
全部
@@ -97,8 +97,12 @@
+ :customRightBtns="table1.customRightBtns" :query-form-param="queryParam"
+ :pagination="true">
+
+ {{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请加工' }}
+
+
@@ -126,6 +130,7 @@ export default {
checkCategoryList: [],
showAllCompany: false,
keyword: '',
+ queryParam: {},
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
@@ -150,16 +155,16 @@ export default {
}
})
},
- customRightBtns: [{
- title: '申请加工',
- // icon: 'el-icon-search',
- type: 'primary',
- plain: true,
- onClick: ({_id}) => {
- this.toDetail(_id)
- // vk.navigateTo('/pages/process/detail?id=' + item._id);
- }
- },],
+ // customRightBtns: [{
+ // title: vk.getVuex('$user.userInfo._id') '申请加工',
+ // // icon: 'el-icon-search',
+ // type: 'primary',
+ // plain: true,
+ // onClick: ({_id}) => {
+ // this.toDetail(_id)
+ // // vk.navigateTo('/pages/process/detail?id=' + item._id);
+ // }
+ // },],
// 表格字段显示规则
columns: [
{
@@ -178,23 +183,23 @@ export default {
// return val.map(item=>item.procureNumber + item.procureUnit).join("/")
// }
},
- {
- key: "productList",
- title: "收货地",
- type: "text",
- formatter: (val, row, column, index) => {
- let str = ""
- try {
- str = val.map(item => {
- const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
- return addressStr
- }).join("/")
- } catch (err) {
- str = ""
- }
- return str
- }
- },
+ // {
+ // key: "productList",
+ // title: "收货地",
+ // type: "text",
+ // formatter: (val, row, column, index) => {
+ // let str = ""
+ // try {
+ // str = val.map(item => {
+ // const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
+ // return addressStr
+ // }).join("/")
+ // } catch (err) {
+ // str = ""
+ // }
+ // return str
+ // }
+ // },
{
key: "user",
title: "采购企业",
@@ -220,7 +225,9 @@ export default {
title: "发布时间",
type: "time",
},
-
+ {
+ key: "action", title: "操作", type: "html"
+ },
],
// 多选框选中的值
multipleSelection: [],
@@ -296,13 +303,13 @@ export default {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
- if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
+ if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.getCertUrl()
+ vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
@@ -310,7 +317,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- vk.navigateTo('/pages/user/user?menu=business-card');
+ vk.navigateTo({url: '/pages/user/user?menu=business-card'});
})
} else {
vk.navigateTo({
@@ -328,7 +335,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.getCertUrl()
+ vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
@@ -352,25 +359,26 @@ export default {
})
})
- let provinceCodes = this.checkProvinceList.map(item => item.code)
-
- if (provinceCodes.includes(9999)) {
- provinceCodes = []
+ this.queryParam.formData = {
+ keyword: this.keyword,
+ companyList: this.checkCompanyList,
+ categoryIds
}
+ this.$refs.table1.search()
- vk.callFunction({
- url: 'client/process/sheet/pub/getList',
- data: {
- pageIndex: pageIndex,
- pageSize: 20,
- keyword: this.keyword,
- },
- success: (data) => {
- console.log('data: ', data);
-
- this.goodsData = data
- }
- });
+ // vk.callFunction({
+ // url: 'client/process/sheet/pub/getList',
+ // data: {
+ // pageIndex: pageIndex,
+ // pageSize: 20,
+ // keyword: this.keyword,
+ // },
+ // success: (data) => {
+ // console.log('data: ', data);
+ //
+ // this.goodsData = data
+ // }
+ // });
},
getCertUrl() {
vk.callFunction({
diff --git a/pages/process/my.vue b/pages/process/my.vue
index 95d3213..ce9364b 100644
--- a/pages/process/my.vue
+++ b/pages/process/my.vue
@@ -15,7 +15,7 @@
diff --git a/pages/process/quote.vue b/pages/process/quote.vue
index 7431d41..cc90699 100644
--- a/pages/process/quote.vue
+++ b/pages/process/quote.vue
@@ -51,7 +51,7 @@ export default {
action: "client/process/quote/kh/addQuote",
// 表单字段显示规则
columns: [
- {key: "totalPrice", title: "货款总价", type: "money"},
+ {key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
],
@@ -97,7 +97,7 @@ export default {
},
methods: {
onFormSuccess() {
-
+ vk.navigateBack()
},
// 提交报价单
async submit() {
diff --git a/pages/process/release.vue b/pages/process/release.vue
index 6f3a42a..d284ae1 100644
--- a/pages/process/release.vue
+++ b/pages/process/release.vue
@@ -59,15 +59,11 @@
-
-
-
-
-
-
-
-
+
+
+
+
@@ -114,13 +110,17 @@
开票时间:
- {{ item }}
+ {{ item }}
+
发票种类:
- {{ item }}
+ {{
+ item
+ }}
+
其他要求:
diff --git a/pages/spot/goods/detail.vue b/pages/spot/goods/detail.vue
index 44556dc..f626c38 100644
--- a/pages/spot/goods/detail.vue
+++ b/pages/spot/goods/detail.vue
@@ -1,497 +1,593 @@
-
-
-
-
+
+
+
+
-
-
- 首页
-
- 现货市场
-
- {{product.name}}
-
-
+
+
+ 首页
+
+ 现货市场
+
+ {{ product.name }}
+
+
-
-
-
-
-
-
现货详情
-
- {{product.user.person.personName}}
-
- {{product.user.company.companyName}}
-
- 库存:{{product.stock}}吨
-
- 供货地:{{product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name}}
-
-
+
+
+
现货详情
+
+ {{ product.user.person.personName }}
+
+ {{ product.user.company.companyName }}
+
+ 库存:{{ product.stock }}吨
+
+ 供货地:{{ product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name }}
+
+
-
-
-
附件
-
-
-
+
+
+
附件
+
+
+
-
-
-
已收到的合作申请
-
-
-
-
+
+
+
已收到的合作申请
+
+
+
+
-
-
-
-
+
+
+ 收到的申请合作列表
+ 关闭
+
+
+
+
+ {{
+ item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
+ }}
+
+ {{ item._add_time_str }}
+
+ {{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
+
+
+ 查看申请详情
+
+
+
+
-
+
+
+
+
+
+
+
+ 关闭
+
+
+
+
\ No newline at end of file
diff --git a/pages/spot/goods/goods.vue b/pages/spot/goods/goods.vue
index 6808333..c067c69 100644
--- a/pages/spot/goods/goods.vue
+++ b/pages/spot/goods/goods.vue
@@ -22,7 +22,8 @@
发布现货
- 我发布的现货
+ 我发布的现货
+
@@ -94,13 +95,14 @@
-
+
{{ item.name }}
现货库存:{{ item.stock }}吨
供货地:{{ item.addressStr }}
-
-
-
+
+
+
{{ item.user.person.personName }}
{{ item.user.company.companyName }}
-
+
@@ -142,7 +144,7 @@ export default {
showAllProvince: false
};
},
- onLoad() {
+ onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
@@ -179,13 +181,13 @@ export default {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
- if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
+ if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- this.getCertUrl()
+ vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
@@ -315,6 +317,7 @@ export default {
width: 1200px;
margin: 20px auto;
display: flex;
+ flex-wrap: wrap;
}
diff --git a/pages/spot/goods/my.vue b/pages/spot/goods/my.vue
new file mode 100644
index 0000000..17f1d70
--- /dev/null
+++ b/pages/spot/goods/my.vue
@@ -0,0 +1,219 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 发布现货
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/spot/release/release.vue b/pages/spot/release/release.vue
index 43865e0..cf01bcb 100644
--- a/pages/spot/release/release.vue
+++ b/pages/spot/release/release.vue
@@ -160,7 +160,9 @@
});
},
methods: {
- onFormSuccess() {}
+ onFormSuccess() {
+ vk.navigateBack()
+ }
}
}
diff --git a/pages/user/components/business-card.vue b/pages/user/components/business-card.vue
index f970aff..c744c78 100644
--- a/pages/user/components/business-card.vue
+++ b/pages/user/components/business-card.vue
@@ -56,6 +56,16 @@
title: "职位",
type: "text"
},
+ {
+ key: "phone",
+ title: "联系电话",
+ type: "text"
+ },
+ {
+ key: "mobile",
+ title: "联系电话",
+ type: "text"
+ },
{
key: "address",
title: "地区",
@@ -165,7 +175,8 @@
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
- vk.userCenter.updateUser({
+ vk.callFunction({
+ url: 'client/user/kh/addAuth',
data: {
businessCard: formData
},
diff --git a/pages/user/components/personal.vue b/pages/user/components/personal.vue
index f3e8bdd..4a0038e 100644
--- a/pages/user/components/personal.vue
+++ b/pages/user/components/personal.vue
@@ -8,12 +8,25 @@
个人认证
企业认证
-
- 您还未提交您的个人资料
- 您还未提交您的企业资料
+
+
+ 您还未提交您的个人资料
+ 您还未提交您的企业资料
+
+
+ 审核中
+
+
+ 审核不通过:{{ form1.data.refuseReason }}
+
-
制作我的名片
+
+ 制作我的名片
+
去认证
+ 获取认证结果
@@ -39,7 +53,8 @@
企业授权人信息
-
+
添加授权人
@@ -48,7 +63,9 @@
-
{{
+
+ {{
vk.getVuex('$user.userInfo.accountType') === 2 ? '提交企业认证' : '提交个人认证'
}}
@@ -73,31 +90,33 @@ export default {
data: {
person: {},
company: {},
- manager: {},
+ manager: null,
fadadaConfirm: false,
authType: 1,
+ authStatus: null,
+ refuseReason: '',
},
// 表单属性
props: {
// 表单请求地址
- action: "user/kh/setCertification",
+ action: "client/user/kh/addAuth",
// 表单字段显示规则
columns: [
{
key: "authType", title: "认证方式", type: "radio",
data: [
{value: 1, label: "法大大接口认证"},
- {value: 2, label: "后台审核认证"},
+ {value: 2, label: "金九信平台审核"},
],
- showRule: ({fadadaConfirm}) => {
- return fadadaConfirm
+ showRule: ({authStatus}) => {
+ return authStatus === null || [-1, 2].includes(authStatus)
},
},
{
key: "toFadada", title: "认证方式", type: "html",
showLabel: false,
showRule: (formData) => {
- return formData.authType === 1 && (!formData.hasOwnProperty('fadadaConfirm') || !formData.fadadaConfirm)
+ return formData.authType === 1 && (!formData.hasOwnProperty('fadadaConfirm') || !formData.fadadaConfirm) && (formData.authStatus === null || [-1, 2].includes(formData.authStatus))
},
},
{
@@ -167,7 +186,7 @@ export default {
]
},
{
- key: "", title: "", type: "group", justify: "start",
+ key: "address", title: "", type: "group", justify: "start",
columns: [
{key: "addressRegion", title: "公司所在地", type: "address",},
{
@@ -179,6 +198,12 @@ export default {
},
]
},
+ {
+ key: "mobile",
+ title: "联系方式",
+ type: "text",
+ placeholder: "请输入您的联系方式",
+ },
{
key: "mailAddress",
title: "有效通信地址",
@@ -388,19 +413,20 @@ export default {
loading: false,
// 是否显示表单1 的弹窗
show: false,
- beforeAction: (formData) => {
- // const newFormData = _.pick(formData, ['contactWechat', 'contactEmail',
- // 'contactWechatImage', 'contactQq', 'mailAddress'
- // ])
- vk.userCenter.updateUser({
- data: {...formData, ...{manager: this.manageList[0]}},
- success: (data) => {
- // 成功后的逻辑
-
- }
- });
- return false;
- },
+ // beforeAction: (formData) => {
+ // // const newFormData = _.pick(formData, ['contactWechat', 'contactEmail',
+ // // 'contactWechatImage', 'contactQq', 'mailAddress'
+ // // ])
+ // // vk.userCenter.updateUser({
+ // // data: {...formData, ...{manager: this.manageList[0]}},
+ // // success: (data) => {
+ // // // 成功后的逻辑
+ // //
+ // // }
+ // // });
+ // // return false;
+ //
+ // },
}
},
// 表单相关结束-----------------------------------------------------------
@@ -417,7 +443,8 @@ export default {
success: (data) => {
this.form1.data = _.pick(data.userInfo, [
'fadadaConfirm', 'person', 'company', 'manager', 'contactWechat',
- 'contactEmail', 'contactWechatImage', 'contactQq', 'mailAddress'
+ 'contactEmail', 'contactWechatImage', 'contactQq', 'mailAddress',
+ 'authStatus', 'authType', 'refuseReason'
])
// if (!this.form1.data.hasOwnProperty('fadadaConfirm') || !this.form1.data.fadadaConfirm) this.form1.data.authType = 1
// this.form1.data.authType = 2
@@ -434,7 +461,7 @@ export default {
});
},
onFormSuccess1() {
- console.log(123);
+ window.location.reload()
},
getCertUrl() {
vk.callFunction({
@@ -448,8 +475,21 @@ export default {
this.manageList.push({})
},
allSubmit() {
- // this.form1.data.manager = this.manageList[0]
+ this.form1.data.authStatus = 0
+ this.form1.data.refuseReason = null
+ this.form1.data.manager = this.manageList[0]
this.$refs.form1.submitForm()
+ },
+ makeCard() {
+ this.$emit('makeCard')
+ },
+ getCertRes() {
+ vk.callFunction({
+ url: 'client/user/kh/getFadadaRes',
+ success: (res) => {
+ console.log(res)
+ }
+ })
}
}
}
diff --git a/pages/user/school.vue b/pages/user/school.vue
new file mode 100644
index 0000000..a517373
--- /dev/null
+++ b/pages/user/school.vue
@@ -0,0 +1,253 @@
+
+
+
+
+
+
+
+
+
+ 我的上传
+
+
+
+ 我的收藏
+
+
+
+ 我的下载
+
+
+
+
+
+
+ 累计上传
+ {{ list.length }}
+ 篇
+
+ 我要上传
+
+
+
+ 共计收藏
+ {{ list.length }}
+ 篇
+
+
+
+
+ 累计下载
+ {{ list.length }}
+ 篇
+
+ 我要上传
+
+
+
+
+
+ {{ item.name }}
+
+ {{ item._add_time_str }}
+ {{ item.viewNum }}人浏览
+ {{ item.downloadNum }}次下载
+ {{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}
+
+
+
+
+
+
+
+
+ 上传文档
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/user.vue b/pages/user/user.vue
index 13d478f..78c5fbf 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -49,11 +49,9 @@
data() {
return {
currMenu: 'fadada',
- // currMenu: 'fadada',
};
},
onLoad(options) {
- console.log(options);
if(options && options.menu) {
this.currMenu = options.menu
}
@@ -66,7 +64,7 @@
}
-
\ No newline at end of file
diff --git a/pages/yellowPage/list.vue b/pages/yellowPage/list.vue
new file mode 100644
index 0000000..f082283
--- /dev/null
+++ b/pages/yellowPage/list.vue
@@ -0,0 +1,307 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+ 全部
+
+
+
+ {{ item.name }}
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+ 全国
+
+
+
+ {{ item.name }}
+
+
+ 查看更多
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+ {{ item.manager.personName }}
+ {{ item.businessCard.position }}
+
+
+
+
+
+ 地址:{{ item.manager.address }}
+
+
+
+ 电话:{{ item.businessCard.phone }}
+
+
+
+ 手机:{{ item.businessCard.mobile }}
+
+
+
+ 邮箱:{{ item.businessCard.email }}
+
+
+
+ 网址:{{ item.businessCard.website }}
+
+
+
+ 主营业务:
+ {{ item.businessCard.mainBusiness }}
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/images/336a76fbf9fe44a07b5cfd4caf6f8bb9.jpg b/static/images/336a76fbf9fe44a07b5cfd4caf6f8bb9.jpg
new file mode 100644
index 0000000..f015c77
Binary files /dev/null and b/static/images/336a76fbf9fe44a07b5cfd4caf6f8bb9.jpg differ
diff --git a/static/images/600fc93e6b85324b3ea1373ee264290d.jpg b/static/images/600fc93e6b85324b3ea1373ee264290d.jpg
new file mode 100644
index 0000000..db61621
Binary files /dev/null and b/static/images/600fc93e6b85324b3ea1373ee264290d.jpg differ
diff --git a/static/images/authed.png b/static/images/authed.png
new file mode 100644
index 0000000..a8b226b
Binary files /dev/null and b/static/images/authed.png differ
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/admin/system/user/sys/changeStatus.js b/uniCloud-aliyun/cloudfunctions/router/service/admin/system/user/sys/changeStatus.js
index 352e457..0850e79 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/admin/system/user/sys/changeStatus.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/admin/system/user/sys/changeStatus.js
@@ -12,7 +12,7 @@ module.exports = {
let { uid } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
- const {id, authStatus} = data
+ const {id, authStatus, refuseReason} = data
const fadadaConfirm = authStatus === 1
await vk.baseDao.updateById({
dbName: 'uni-id-users',
@@ -20,6 +20,7 @@ module.exports = {
dataJson: {
authStatus,
fadadaConfirm,
+ refuseReason,
authTime: Date.now()
}
})
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/add.js b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/add.js
index 57a47d5..7ce20bb 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/add.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/add.js
@@ -12,34 +12,52 @@ module.exports = {
let {uid} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
-
+ data.transactionId = vk.pubfn.createOrderNo("C", 20)
const contractId = await vk.baseDao.add({
dbName: 'jjx-contract',
dataJson: {
...data, ...{
status: 0,
- userId: uid
+ userId: uid,
+ changeNum: 0
}
}
})
await vk.daoCenter.userContractDao.adds([
{
- transactionId: data.transactionId,
+ transactionId: vk.pubfn.createOrderNo("P", 20),
userId: uid,
role: 'buyer',
sign: false,
- contractId
+ contractId,
},
{
- transactionId: data.transactionId,
+ transactionId: vk.pubfn.createOrderNo("P", 20),
userId: data.seller,
role: 'seller',
sign: false,
- contractId
+ contractId,
}
])
+ if (data.type === 'process') {
+ await vk.baseDao.updateById({
+ dbName: 'jjx-process-sheet',
+ id: data.sheetId,
+ dataJson: {
+ status: 1
+ }
+ })
+ await vk.baseDao.updateById({
+ dbName: 'jjx-process-quote',
+ id: data.quoteId,
+ dataJson: {
+ status: 1
+ }
+ })
+ }
+
// 业务逻辑结束-----------------------------------------------------------
return res;
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/extSign.js b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/extSign.js
index 525d90e..f9ac557 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/extSign.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/extSign.js
@@ -22,6 +22,13 @@ module.exports = {
// msg: '请在个人中心上传印章'
// }
// }
+
+ const contract = await vk.baseDao.findByWhereJson({
+ dbName: dbName.contract,
+ whereJson: {
+ _id: contractId,
+ }
+ })
// 获取合同信息
const userContract = await vk.baseDao.selects({
@@ -54,7 +61,7 @@ module.exports = {
const fadadaUrl = await pubFun.fadadaUrl('extsign.api', {
transaction_id: userContract.transactionId,
- contract_id: userContract.contract.fadadaContractId,
+ contract_id: contract.transactionId,
customer_id: fadadaCustomerId,
doc_title: userContract.contract.docTitle,
sign_keyword: sign_keyword,
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/getList.js
index 52d811f..735c624 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/getList.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/getList.js
@@ -1,58 +1,59 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
- /**
- * 获取我的合同列表
- * @url client/enquiry/contract/kh/getList 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid, pageIndex, pageSize, tradeMethod, status } = data;
- let res = { code: 0, msg: "" };
- // 业务逻辑开始-----------------------------------------------------------
-
- const lastWhereJson = {}
- const whereJson = {
- userId: uid
- }
- if(tradeMethod != null) {
- lastWhereJson['contract.tradeMethod'] = tradeMethod
- }
-
- if(status != null) {
- lastWhereJson['contract.status'] = status
- }
+ /**
+ * 获取我的合同列表
+ * @url client/enquiry/contract/kh/getList 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid, pageIndex, pageSize, tradeMethod, status} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
- res = await vk.daoCenter.userContractDao.selects({
- data: {
- pageIndex,
- pageSize
- },
- whereJson: whereJson,
- foreignDB:[
- {
- dbName: dbName.contract,
- localKey:"contractId", // 主表外键字段名
- foreignKey: "_id", // 副表外键字段名
- as: "contract",
- limit: 1, // 当limit = 1时,以对象形式返回,否则以数组形式返回
- foreignDB: [
- {
- dbName: dbName.userContract,
- localKey:"_id", // 主表外键字段名
- foreignKey: "contractId", // 副表外键字段名
- as: "partyList",
- limit: 1000,
- }
- ]
- }
- ],
- lastWhereJson: lastWhereJson
- })
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ const lastWhereJson = {}
+ const whereJson = {
+ userId: uid
+ }
+ if (tradeMethod != null) {
+ lastWhereJson['contract.tradeMethod'] = tradeMethod
+ }
+
+ if (status != null) {
+ lastWhereJson['contract.status'] = status
+ }
+
+ res = await vk.daoCenter.userContractDao.selects({
+ data: {
+ pageIndex,
+ pageSize
+ },
+ whereJson: whereJson,
+ sortArr: [{"name": "_id", "type": "desc"}],
+ foreignDB: [
+ {
+ dbName: dbName.contract,
+ localKey: "contractId", // 主表外键字段名
+ foreignKey: "_id", // 副表外键字段名
+ as: "contract",
+ limit: 1, // 当limit = 1时,以对象形式返回,否则以数组形式返回
+ foreignDB: [
+ {
+ dbName: dbName.userContract,
+ localKey: "_id", // 主表外键字段名
+ foreignKey: "contractId", // 副表外键字段名
+ as: "partyList",
+ limit: 1000,
+ }
+ ]
+ }
+ ],
+ lastWhereJson: lastWhereJson
+ })
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/launch.js b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/launch.js
index f493db7..ed24566 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/launch.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/launch.js
@@ -1,64 +1,73 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
- /**
- * 发起/创建合同
- * @url client/contract/kh/launch 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid, contractId,title,contractFile,otherFile,signEndDate,buyerSignKeyword, sellerSignKeyword } = data;
- let res = { code: 0, msg: "" };
- // 业务逻辑开始-----------------------------------------------------------
-
- const contract = await vk.baseDao.findByWhereJson({
- dbName: dbName.contract,
- whereJson: {
- _id: contractId,
- userId: uid
- }
- })
- console.log('contract: ',dbName.contract,uid);
- const uploaddocs = await pubFun.fadada('uploaddocs.api', {
- contract_id: contract.fadadaContractId,
- doc_title: title,
- doc_url: contractFile,
- // file: doc_url,
- doc_type: '.pdf'
- })
-
- if(uploaddocs.code == 1000) {
- await vk.baseDao.update({
- dbName: dbName.contract,
- whereJson: {
- _id: contractId,
- userId: uid
- },
- dataJson: {
- status: 1,
- docTitle: title,
- signEndDate,
- otherFile,
- contractBase: contractFile,
- buyerSignKeyword,
- sellerSignKeyword
- }
- })
-
- res.data = uploaddocs.result
- }else {
- return {
- code: -1,
- msg: uploaddocs.msg
- }
- }
-
+ /**
+ * 发起/创建合同
+ * @url client/contract/kh/launch 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid, contractId, title, contractFile, otherFile, signEndDate, buyerSignKeyword, sellerSignKeyword} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
+
+ const contract = await vk.baseDao.findByWhereJson({
+ dbName: dbName.contract,
+ whereJson: {
+ _id: contractId,
+ userId: uid
+ }
+ })
+ console.log('contract: ', contract);
+ const newTransactionId = vk.pubfn.createOrderNo("C", 20)
+
+ await vk.baseDao.update({
+ dbName: dbName.contract,
+ whereJson: {
+ _id: contractId
+ },
+ dataJson: {
+ transactionId: newTransactionId,
+ }
+ })
+ const uploaddocs = await pubFun.fadada('uploaddocs.api', {
+ contract_id: newTransactionId,
+ doc_title: title,
+ doc_url: contractFile,
+ // file: doc_url,
+ doc_type: '.pdf'
+ })
+ if (parseInt(uploaddocs.code) === 1000) {
+ await vk.baseDao.update({
+ dbName: dbName.contract,
+ whereJson: {
+ _id: contractId,
+ userId: uid
+ },
+ dataJson: {
+ status: 1,
+ docTitle: title,
+ signEndDate,
+ otherFile,
+ contractBase: contractFile,
+ buyerSignKeyword,
+ sellerSignKeyword
+ }
+ })
+
+ res.data = uploaddocs.result
+ } else {
+ return {
+ code: -1,
+ msg: uploaddocs.msg
+ }
+ }
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/viewContract.js b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/viewContract.js
index 0acd604..f45eba5 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/viewContract.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/contract/kh/viewContract.js
@@ -23,13 +23,10 @@ module.exports = {
})
const viewRes = pubFun.fadadaUrl('viewContract.api', {
- contract_id: contract.fadadaContractId
+ contract_id: contract.transactionId
})
res.data = viewRes
-
-
-
// 业务逻辑结束-----------------------------------------------------------
return res;
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/addQuote.js b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/addQuote.js
index 1a908d1..3e26f72 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/addQuote.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/addQuote.js
@@ -19,13 +19,13 @@ module.exports = {
let managerName = ''
let managerMobile = ''
- if (accountType == 1) {
+ if (accountType === 1 && person.personName && person.mobile) {
subjectName = person.personName
subjectMobile = person.mobile
} else {
subjectName = company.companyName
subjectMobile = company.legalMobile
- if (manager.mobile && manager.personName) {
+ if (manager && manager.mobile && manager.personName) {
managerName = manager.personName
managerMobile = manager.mobile
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/confirmQuote.js b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/confirmQuote.js
index f91e7fa..f337cbc 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/confirmQuote.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/quote/kh/confirmQuote.js
@@ -2,144 +2,159 @@
const dbName = require('../../../../../dao/config.js')
module.exports = {
- /**
- * 同意合作
- * @url client/enquiry/quote/kh/confirmQuote 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let {
- data = {}, userInfo, util, filterResponse, originalParam
- } = event;
- let {
- customUtil,
- uniID,
- config,
- pubFun,
- vk,
- db,
- _
- } = util;
- let {
- uid,
- quoteId
- } = data;
- let res = {
- code: 0,
- msg: ""
- };
- // 业务逻辑开始-----------------------------------------------------------
+ /**
+ * 同意合作
+ * @url client/enquiry/quote/kh/confirmQuote 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {
+ data = {}, userInfo, util, filterResponse, originalParam
+ } = event;
+ let {
+ customUtil,
+ uniID,
+ config,
+ pubFun,
+ vk,
+ db,
+ _
+ } = util;
+ let {
+ uid,
+ quoteId
+ } = data;
+ let res = {
+ code: 0,
+ msg: ""
+ };
+ // 业务逻辑开始-----------------------------------------------------------
- // 修改报价单状态
- const quote = await vk.baseDao.updateAndReturn({
- dbName: 'jjx-enquiry-quote',
- whereJson: {
- _id: quoteId,
- status: 0
- },
- dataJson: {
- status: 1
- }
- })
-
- if (!quote) {
- return {
- code: -1,
- msg: '请刷新页面'
- }
- }
- // 获取乙方信息
- const quoteUser = await vk.baseDao.select({
- dbName: dbName.user,
- getMain: true,
- getOne: true,
- whereJson: {
- _id: quote.userId
- }
- })
+ // 修改报价单状态
+ const quote = await vk.baseDao.updateAndReturn({
+ dbName: 'jjx-enquiry-quote',
+ whereJson: {
+ _id: quoteId,
+ status: 0
+ },
+ dataJson: {
+ status: 1
+ }
+ })
- // 获取商品信息
- const productTitle = quote.productList.map(item => {
- return item.name
- }).join("/")
-
-
- // 获取询价单信息
- const sheet = await vk.baseDao.selects({
- dbName: dbName.enquirySheet,
- whereJson: {_id: quote.sheetId},
- getMain: true,
- getOne: true
- })
-
- const fadadaContractId = vk.pubfn.createOrderNo("E", 20)
- // 上传合同模板并填充
- // if(sheet.signMethod == 0 && sheet.contractType == 0) {
- // pubFun.fadada('generate_contract.api', {
- // template_id: '20231120',
- // contract_id: fadadaContractId,
- // parameter_map: JSON.stringify({
- // jiaName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
- // jiaDate: '',
- // jiaPhone: '',
- // yiName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
- // yiDate: '',
- // yiPhone: '',
- // sellerSupplement: '',
- // }),
- // })
- // }
+ if (!quote) {
+ return {
+ code: -1,
+ msg: '请刷新页面'
+ }
+ }
+ // 获取乙方信息
+ const quoteUser = await vk.baseDao.select({
+ dbName: dbName.user,
+ getMain: true,
+ getOne: true,
+ whereJson: {
+ _id: quote.userId
+ }
+ })
-
- // 新增合同记录
- const contractId = await vk.baseDao.add({
- dbName: 'jjx-contract',
- dataJson: {
- fadadaContractId: fadadaContractId,
- contractBase: '', // 原始合同
- contractHistory: [], // 历史合同
- contractFinal: '', // 归档合同
- status: 0,
- userId: uid,
- type: 'enquiry',
- quoteId: quoteId,
- sheetId: quote.sheetId,
- productList: quote.productList,
- productTitle,
- tradeMethod: quote.tradeMethod,
- partyCount: 2,
- signCount: 0,
- contractType: sheet.contractType,
- signMethod: sheet.signMethod,
- sellerSupplement: sheet.sellerSupplement,
- }
- })
-
- // 上传合同模板
-
- //新增 用户与合同的关联记录
- await vk.daoCenter.userContractDao.adds([
- {
- transactionId: vk.pubfn.createOrderNo("S", 20),
- userId: uid,
- role: 'buyer',
- sign: false,
- contractId
- },
- {
- transactionId: vk.pubfn.createOrderNo("S", 20),
- userId: quote.userId,
- role: 'seller',
- sign: false,
- contractId
- }
- ])
+ // 获取询价单信息
+ const sheet = await vk.baseDao.selects({
+ dbName: dbName.enquirySheet,
+ whereJson: {_id: quote.sheetId},
+ getMain: true,
+ getOne: true
+ })
+
+ // 获取商品信息
+ const productTitle = sheet.productList.map(item => {
+ return item.goodsName
+ }).join("/")
+
+ const fadadaContractId = vk.pubfn.createOrderNo("E", 20)
+ // 上传合同模板并填充
+ // if(sheet.signMethod == 0 && sheet.contractType == 0) {
+ // pubFun.fadada('generate_contract.api', {
+ // template_id: '20231120',
+ // contract_id: fadadaContractId,
+ // parameter_map: JSON.stringify({
+ // jiaName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
+ // jiaDate: '',
+ // jiaPhone: '',
+ // yiName: userInfo.accountType == 1?userInfo.person.personName: userInfo.company.companyName,
+ // yiDate: '',
+ // yiPhone: '',
+ // sellerSupplement: '',
+ // }),
+ // })
+ // }
+ // 新增合同记录
+ const contractId = await vk.baseDao.add({
+ dbName: 'jjx-contract',
+ dataJson: {
+ fadadaContractId: fadadaContractId,
+ contractBase: '', // 原始合同
+ contractHistory: [], // 历史合同
+ contractFinal: '', // 归档合同
+ status: 0,
+ userId: uid,
+ type: 'enquiry',
+ quoteId: quoteId,
+ sheetId: quote.sheetId,
+ productList: quote.productList,
+ productTitle,
+ tradeMethod: quote.tradeMethod,
+ partyCount: 2,
+ signCount: 0,
+ contractType: sheet.contractType,
+ signMethod: sheet.signMethod,
+ sellerSupplement: sheet.sellerSupplement,
+ transactionId: vk.pubfn.createOrderNo("C", 20),
+ amount: quote.totalPrice,
+ }
+ })
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ await vk.baseDao.updateById({
+ dbName: 'jjx-enquiry-sheet',
+ id: quote.sheetId,
+ dataJson: {
+ status: 1
+ }
+ })
+ await vk.baseDao.updateById({
+ dbName: 'jjx-enquiry-quote',
+ id: quoteId,
+ dataJson: {
+ status: 1
+ }
+ })
+
+ // 上传合同模板
+
+ //新增 用户与合同的关联记录
+ await vk.daoCenter.userContractDao.adds([
+ {
+ transactionId: vk.pubfn.createOrderNo("E", 20),
+ userId: uid,
+ role: 'buyer',
+ sign: false,
+ contractId
+ },
+ {
+ transactionId: vk.pubfn.createOrderNo("E", 20),
+ userId: quote.userId,
+ role: 'seller',
+ sign: false,
+ contractId
+ }
+ ])
+
+
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
\ No newline at end of file
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/kh/add.js b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/kh/add.js
index d97c304..8a8e050 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/kh/add.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/kh/add.js
@@ -22,7 +22,8 @@ module.exports = {
...data,
...{
answerNumber: 0,
- userId: uid
+ userId: uid,
+ status: 0
}
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js
index 9a73721..5139052 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js
@@ -1,60 +1,78 @@
'use strict';
module.exports = {
- /**
- * 获取用户发布的询价单
- * @url client/enquiry/sheet/pub/getList 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid, userId,pageIndex,pageSize,keyword,categoryIds,provinceCodes } = data;
- let res = { code: 0, msg: "" };
- // 业务逻辑开始-----------------------------------------------------------
- let dbName = "jjx-enquiry-sheet";
-
-
- let whereJson = {};
-
- if(vk.pubfn.isNotNull(keyword)) {
- whereJson.name = new RegExp(keyword)
- }
- if(vk.pubfn.isNotNull(categoryIds)) {
- whereJson.categoryIds = _.in(categoryIds)
- }
-
- if(vk.pubfn.isNotNull(provinceCodes)) {
- whereJson['address.province.code'] = _.in(provinceCodes)
- }
-
- res = await vk.baseDao.selects({
- dbName,
- pageIndex,
- pageSize,
- whereJson,
- foreignDB: [
- {
- dbName:"uni-id-users",
- localKey:"userId",
- foreignKey:"_id",
- as:"user",
- limit:1, // limit=1则以对象形式返回
- fieldJson:{
- _id: true,
- company: {
- companyName: true
- },
- person: {
- personName: true
- },
- businessCard: true,
- accountType: true,
- },
- },
+ /**
+ * 获取用户发布的询价单
+ * @url client/enquiry/sheet/pub/getList 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid, pageIndex, pageSize, keyword, categoryIds, provinceCodes, formData} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
+ let dbName = "jjx-enquiry-sheet";
- ]
- });
+
+ let whereJson = {};
+
+ if (vk.pubfn.isNotNull(keyword)) {
+ whereJson.name = new RegExp(keyword)
+ }
+
+ if (data.userId && vk.pubfn.isNotNull(data.userId)) {
+ whereJson.userId = data.userId
+ }else {
+ whereJson.status = 0
+ }
+
+ if (formData && formData.hasOwnProperty('userId') && vk.pubfn.isNotNull(formData.userId)) {
+ whereJson.userId = formData.userId
+ }else {
+ whereJson.status = 0
+ }
+
+ if (formData && formData.hasOwnProperty('companyList') && vk.pubfn.isNotNull(formData.companyList)) {
+ whereJson.userId = _.in(formData.companyList)
+ }
+
+ if (formData && formData.hasOwnProperty('categoryIds') && vk.pubfn.isNotNull(formData.categoryIds)) {
+ whereJson.categoryIds = _.in(formData.categoryIds)
+ }
+
+ if (vk.pubfn.isNotNull(provinceCodes)) {
+ whereJson['address.province.code'] = _.in(provinceCodes)
+ }
+
+ res = await vk.baseDao.selects({
+ dbName,
+ pageIndex,
+ pageSize,
+ whereJson,
+ sortArr: [{name: "_add_time", type: "desc"}],
+ foreignDB: [
+ {
+ dbName: "uni-id-users",
+ localKey: "userId",
+ foreignKey: "_id",
+ as: "user",
+ limit: 1, // limit=1则以对象形式返回
+ fieldJson: {
+ _id: true,
+ company: {
+ companyName: true
+ },
+ person: {
+ personName: true
+ },
+ businessCard: true,
+ accountType: true,
+ },
+ },
+
+ ]
+ });
const rows = res.rows
rows.forEach((row, rowIndex) => {
@@ -71,13 +89,13 @@ module.exports = {
const index = res.rows.indexOf(item);
res.rows[index].quoteNum = await vk.baseDao.count({
dbName: 'jjx-enquiry-quote',
- whereJson:{
+ whereJson: {
sheetId: item._id
}
})
}
res.rows = rows
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/fadada.js b/uniCloud-aliyun/cloudfunctions/router/service/client/fadada.js
index cb93d24..779b26a 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/fadada.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/fadada.js
@@ -74,6 +74,7 @@ var cloudObject = {
config,
pubFun
} = this.getUtil(); // 获取工具包
+ console.log('fadada res:', data)
const {
customerId
} = data;
@@ -90,7 +91,7 @@ var cloudObject = {
res = await pubFun.fadada('find_personCertInfo.api', {
verified_serialno: user.fadadaVerify.transactionNo
})
-
+ console.log('fadada check res:', res)
// 认证结果
const {person} = res.data
if(res.code !== 1 || person.status !== 2) {
@@ -100,7 +101,7 @@ var cloudObject = {
res = await pubFun.fadada('find_companyCertInfo.api', {
verified_serialno: user.fadadaVerify.transactionNo
})
-
+ console.log('fadada check res:', res)
// 认证结果
const {company, manager} = res.data
if(res.code !== 1 || company.status !== 4 || manager.status !== 2) {
@@ -179,7 +180,6 @@ var cloudObject = {
whereJson: {
_id: userContract.contractId,
status: 1,
-
},
dataJson: {
signCount: _.inc(1),
@@ -187,6 +187,17 @@ var cloudObject = {
}
})
+ // 用户交易额
+ await vk.baseDao.update({
+ dbName: "uni-id-users",
+ whereJson: {
+ _id: userContract.userId
+ },
+ dataJson: {
+ transactionAmount: _.inc(contract.amount)
+ }
+ })
+
if (contract.signCount == contract.partyCount) {
contract = await vk.daoCenter.contractDao.updateAndReturn({
db: transaction,
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/kh/add.js b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/kh/add.js
index 19bda5c..3951fa1 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/kh/add.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/kh/add.js
@@ -19,7 +19,8 @@ module.exports = {
...data,
...{
userId: data.uid,
- answerNumber: 0
+ answerNumber: 0,
+ status: 0,
}
}
});
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getInfo.js b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getInfo.js
index bdd06bb..199a715 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getInfo.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getInfo.js
@@ -23,15 +23,17 @@ module.exports = {
res.quoteList = await vk.baseDao.selects({
dbName: quoteDbName,
- sheetId: data.id,
+ whereJson: {
+ sheetId: data.id,
+ },
foreignDB: [
{
- dbName:"uni-id-users",
- localKey:"userId",
- foreignKey:"_id",
- as:"user",
- limit:1, // limit=1则以对象形式返回
- fieldJson:{
+ dbName: "uni-id-users",
+ localKey: "userId",
+ foreignKey: "_id",
+ as: "user",
+ limit: 1, // limit=1则以对象形式返回
+ fieldJson: {
_id: true,
company: {
companyName: true,
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js
index 113a28c..5851100 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js
@@ -10,7 +10,7 @@ module.exports = {
main: async (event) => {
let {data = {}, userInfo, util, filterResponse, originalParam} = event;
let {customUtil, uniID, config, pubFun, vk, db, _} = util;
- let {uid, userId, pageIndex, pageSize, keyword, categoryIds, provinceCodes} = data;
+ let {uid, userId, pageIndex, pageSize, keyword, categoryIds, provinceCodes, formData} = data;
let res = {code: 0, msg: ""};
// 业务逻辑开始-----------------------------------------------------------
const dbName = "jjx-process-sheet";
@@ -21,6 +21,16 @@ module.exports = {
}
if (vk.pubfn.isNotNull(userId)) {
whereJson.userId = userId
+ }else {
+ whereJson.status = 0
+ }
+
+ if (formData && formData.hasOwnProperty('companyList') && vk.pubfn.isNotNull(formData.companyList)) {
+ whereJson.userId = _.in(formData.companyList)
+ }
+
+ if (formData && formData.hasOwnProperty('categoryIds') && vk.pubfn.isNotNull(formData.categoryIds)) {
+ whereJson.categoryIds = _.in(formData.categoryIds)
}
if (vk.pubfn.isNotNull(categoryIds)) {
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/addUpdate.js b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/addUpdate.js
index 270f294..67ab1ca 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/addUpdate.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/addUpdate.js
@@ -1,46 +1,57 @@
'use strict';
module.exports = {
- /**
- * 新增或更新现货
- * @url client/product/goods/kh/addUpdate 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid } = data;
- let res = { code: 0, msg: "" };
- const dbName = 'jjx-spot-goods'
- let {_id,name,categoryIds,address,stock,files} = data
- // 业务逻辑开始-----------------------------------------------------------
- let info = await vk.baseDao.findByWhereJson({
- dbName,
- whereJson:{
- userId: uid,
- }
- });
-
- if(info == null) {
- await vk.baseDao.add({
- dbName,
- dataJson:{
- name,categoryIds,address,stock,files,userId: uid,sort: 0
- }
- });
- }else {
- await vk.baseDao.updateById({
- dbName,
- id: info._id,
- dataJson:{
- name,categoryIds,address,stock,files
- }
- });
- }
+ /**
+ * 新增或更新现货
+ * @url client/product/goods/kh/addUpdate 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid} = data;
+ let res = {code: 0, msg: ""};
+ const dbName = 'jjx-spot-goods'
+ let {_id, name, categoryIds, address, stock, files} = data
+ // 业务逻辑开始-----------------------------------------------------------
+ let info = await vk.baseDao.findByWhereJson({
+ dbName,
+ whereJson: {
+ userId: uid,
+ }
+ });
+
+ if (info == null) {
+ await vk.baseDao.add({
+ dbName,
+ dataJson: {
+ name,
+ categoryIds,
+ address,
+ stock,
+ files,
+ userId: uid,
+ sort: 0,
+ status: 0
+ }
+ });
+ } else {
+ await vk.baseDao.updateById({
+ dbName,
+ id: info._id,
+ dataJson: {
+ name,
+ categoryIds,
+ address,
+ stock,
+ files,
+ status: 0
+ }
+ });
+ }
-
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/pub/getDetail.js b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/pub/getDetail.js
index 44872c6..4c45da6 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/pub/getDetail.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/pub/getDetail.js
@@ -1,75 +1,93 @@
'use strict';
const dbName = 'jjx-spot-goods'
module.exports = {
- /**
- * XXXnameXXX
- * @url client/spot/goods/kh/getDetail 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let {
- data = {}, userInfo, util, filterResponse, originalParam
- } = event;
- let {
- customUtil,
- uniID,
- config,
- pubFun,
- vk,
- db,
- _
- } = util;
- let {
- uid
- } = data;
- let res = {
- code: 0,
- msg: ""
- };
- // 业务逻辑开始-----------------------------------------------------------
- const {
- _id
- } = data
- res.data = await vk.baseDao.selects({
- dbName,
- getOne: true,
- getMain: true,
- // 主表where条件
- whereJson: {
- _id: _id
- },
- foreignDB: [{
- dbName: "uni-id-users",
- localKey: "userId",
- foreignKey: "_id",
- as: "user",
- limit: 1, // limit=1则以对象形式返回
- fieldJson: {
- _id: true,
- company: {
- companyName: true
- },
- person: {
- personName: true
- },
- businessCard: true,
- accountType: true,
- },
- },
- {
- dbName: "jjx-goods-cooperate",
- localKey: "_id",
- foreignKey: "goodsId",
- as: "cooperateList",
- limit: 500, // limit=1则以对象形式返回
- }
- ]
- });
+ /**
+ * XXXnameXXX
+ * @url client/spot/goods/kh/getDetail 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {
+ data = {}, userInfo, util, filterResponse, originalParam
+ } = event;
+ let {
+ customUtil,
+ uniID,
+ config,
+ pubFun,
+ vk,
+ db,
+ _
+ } = util;
+ let {
+ uid
+ } = data;
+ let res = {
+ code: 0,
+ msg: ""
+ };
+ // 业务逻辑开始-----------------------------------------------------------
+ const {
+ _id
+ } = data
+ res.data = await vk.baseDao.selects({
+ dbName,
+ getOne: true,
+ getMain: true,
+ // 主表where条件
+ whereJson: {
+ _id: _id
+ },
+ foreignDB: [{
+ dbName: "uni-id-users",
+ localKey: "userId",
+ foreignKey: "_id",
+ as: "user",
+ limit: 1, // limit=1则以对象形式返回
+ fieldJson: {
+ _id: true,
+ company: {
+ companyName: true
+ },
+ person: {
+ personName: true
+ },
+ businessCard: true,
+ accountType: true,
+ },
+ },
+ {
+ dbName: "jjx-goods-cooperate",
+ localKey: "_id",
+ foreignKey: "goodsId",
+ as: "cooperateList",
+ limit: 500, // limit=1则以对象形式返回
+ foreignDB: [{
+ dbName: "uni-id-users",
+ localKey: "userId",
+ foreignKey: "_id",
+ as: "user",
+ limit: 1, // limit=1则以对象形式返回
+ fieldJson: {
+ _id: true,
+ company: {
+ companyName: true
+ },
+ person: {
+ personName: true
+ },
+ businessCard: true,
+ accountType: true,
+ },
+ },
+ ]
+ }
+ ]
+ });
-
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
\ No newline at end of file
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js b/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js
index 424a13c..c298412 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getCompany.js
@@ -1,30 +1,33 @@
'use strict';
const dbName = require("../../../../dao/config");
module.exports = {
- /**
- * 企业用户列表
- * @url client/user/pub/getCompany 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid } = data;
- let res = { code: 0, msg: "" };
- // 业务逻辑开始-----------------------------------------------------------
+ /**
+ * 企业用户列表
+ * @url client/user/pub/getCompany 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
res = await vk.baseDao.getTableData({
dbName: dbName.user,
- data,
- whereJson:{
- fadadaConfirm: true,
- accountType: 2
+ whereJson: {
+ // fadadaConfirm: true,
+ ...data,
+ ...{
+ accountType: 2,
+ businessCard: _.exists(true),
+ }
}
});
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getDetail.js b/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getDetail.js
index ab69623..48d26f1 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getDetail.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/client/user/pub/getDetail.js
@@ -1,53 +1,50 @@
'use strict';
module.exports = {
- /**
- * 获取企业详情
- * @url client/user/pub/getDetail 前端调用的url参数地址
- * data 请求参数
- * @param {String} params1 参数1
- */
- main: async (event) => {
- let { data = {}, userInfo, util, filterResponse, originalParam } = event;
- let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
- let { uid, _id } = data;
- let res = { code: 0, msg: "" };
- // 业务逻辑开始-----------------------------------------------------------
-
- const dbName = "uni-id-users"
- res.data = await vk.baseDao.selects({
- dbName,
- getOne: true,
- getMain: true,
- whereJson: {
- _id
- },
- foreignDB: [
- {
- dbName: 'jjx-spot-goods',
- localKey:"_id",
- foreignKey:"userId",
- as:"goodsList",
- },
- {
- dbName: 'jjx-enquiry-sheet',
- localKey:"_id",
- foreignKey:"userId",
- as:"goodsList",
- },
- // {
- // dbName: 'jjx-enquiry-sheet',
- // localKey:"_id",
- // foreignKey:"userId",
- // as:"goodsList",
- // }
- ]
- })
-
+ /**
+ * 获取企业详情
+ * @url client/user/pub/getDetail 前端调用的url参数地址
+ * data 请求参数
+ * @param {String} params1 参数1
+ */
+ main: async (event) => {
+ let {data = {}, userInfo, util, filterResponse, originalParam} = event;
+ let {customUtil, uniID, config, pubFun, vk, db, _} = util;
+ let {uid, _id} = data;
+ let res = {code: 0, msg: ""};
+ // 业务逻辑开始-----------------------------------------------------------
+
+ const dbName = "uni-id-users"
+ res.data = await vk.baseDao.selects({
+ dbName,
+ getOne: true,
+ getMain: true,
+ whereJson: {
+ _id
+ },
+ foreignDB: [
+ {
+ dbName: 'jjx-spot-goods',
+ localKey: "_id",
+ foreignKey: "userId",
+ as: "spotList",
+ },
+ {
+ dbName: 'jjx-enquiry-sheet',
+ localKey: "_id",
+ foreignKey: "userId",
+ as: "enquiryList",
+ },
+ {
+ dbName: 'jjx-process-sheet',
+ localKey: "_id",
+ foreignKey: "userId",
+ as: "processList",
+ }
+ ]
+ })
-
-
- // 业务逻辑结束-----------------------------------------------------------
- return res;
- }
+ // 业务逻辑结束-----------------------------------------------------------
+ return res;
+ }
}
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/user/pub/loginBySms.js b/uniCloud-aliyun/cloudfunctions/router/service/user/pub/loginBySms.js
index 80c0fad..5fe0c26 100644
--- a/uniCloud-aliyun/cloudfunctions/router/service/user/pub/loginBySms.js
+++ b/uniCloud-aliyun/cloudfunctions/router/service/user/pub/loginBySms.js
@@ -73,6 +73,7 @@ module.exports = {
company,
accountType: accountType,
nickname: accountType == 1?person.personName: company.companyName,
+ authStatus: -1
}
});
}else {