This commit is contained in:
2023-11-23 22:29:13 +08:00
parent 715859c63f
commit 882419768f
39 changed files with 2190 additions and 199 deletions
-1
View File
@@ -5,7 +5,6 @@ a{
}
img{
text-align: center;
margin:0px auto;
}
body, html {
width: 100%;
+24
View File
@@ -1,3 +1,5 @@
import { reject } from "lodash";
/**
* 自定义公共函数
*/
@@ -78,5 +80,27 @@ myfn.convertCurrency = function(money) {
}
return chineseStr;
}
/**
* 网络路径转base64
* @param {Object} url
*/
myfn.urlTobase64 = function(url) {
return new Promise((reso, reject) => {
uni.request({
url: url,
method: 'GET',
responseType: 'arraybuffer',
success: async res => {
let base64 = uni.arrayBufferToBase64(res.data); //把arraybuffer转成base64
reso(base64)
},
fail() {
reject()
}
});
})
}
export default myfn;
+5 -5
View File
@@ -67,17 +67,17 @@
<li class="nav ">
<a href="javascript:;">金久信自营</a>
</li>
<li class="nav ">
<a href="javascript:;" @click="navTo('/pages/spot/goods/goods')" class="navigator">
<li @click="navTo('/pages/spot/goods/goods')" class="nav ">
<a href="javascript:;" class="navigator">
现货市场
</a>
</li>
<li class="nav ">
<a href="javascript:;" @click="navTo('/pages/enquiry/list')" class="navigator">
<li @click="navTo('/pages/enquiry/list')" class="nav ">
<a href="javascript:;" class="navigator">
下询价单
</a>
</li>
<li class="nav ">
<li @click="navTo('/pages/process/list')" class="nav ">
<a href="javascript:;">找加工</a>
</li>
<li class="nav ">
+4 -4
View File
@@ -40,17 +40,17 @@
<div class="mod-tools">
<ul>
<li class="tool-item buyer-item">
<a rel="nofollow" href="/buyer/index.html" class="bar-title">买家中心<i></i></a>
<a rel="nofollow" href="javascript:;" class="bar-title">买家中心<i></i></a>
<div class="bar-content">
<dl>
<dd>
<a rel="nofollow" href="/buyer/index.html">询价管理</a>
<a rel="nofollow" href="javascript:;">询价管理</a>
</dd>
<dd>
<a rel="nofollow" href="/buyer/deal.html">订单管理</a>
<a rel="nofollow" href="javascript:;">订单管理</a>
</dd>
<dd>
<a rel="nofollow" href="/buyer/contract.html">合同管理</a>
<a rel="nofollow" href="javascript:;">合同管理</a>
</dd>
</dl>
</div>
+12 -1
View File
@@ -12,7 +12,8 @@
"element-ui": "2.15.13",
"lodash": "^4.17.21",
"umy-ui": "1.1.6",
"vk-unicloud-admin-ui": "^1.17.45"
"vk-unicloud-admin-ui": "^1.17.45",
"vue-cropper": "^0.6.4"
},
"engines": {
"HBuilderX": "^3.1.2"
@@ -255,6 +256,11 @@
"csstype": "^3.1.0"
}
},
"node_modules/vue-cropper": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/vue-cropper/-/vue-cropper-0.6.4.tgz",
"integrity": "sha512-U3bm17Li/Xwfw2t3pr8/hFE/tYhvwIWqepHK9IFC1TnX1KFd64VyfCD9nMBhPY91RyvMC6jSQgT/DyDNKuTpIQ=="
},
"node_modules/vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
@@ -447,6 +453,11 @@
"csstype": "^3.1.0"
}
},
"vue-cropper": {
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/vue-cropper/-/vue-cropper-0.6.4.tgz",
"integrity": "sha512-U3bm17Li/Xwfw2t3pr8/hFE/tYhvwIWqepHK9IFC1TnX1KFd64VyfCD9nMBhPY91RyvMC6jSQgT/DyDNKuTpIQ=="
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
+2 -1
View File
@@ -22,7 +22,8 @@
"element-ui": "2.15.13",
"lodash": "^4.17.21",
"umy-ui": "1.1.6",
"vk-unicloud-admin-ui": "^1.17.45"
"vk-unicloud-admin-ui": "^1.17.45",
"vue-cropper": "^0.6.4"
},
"engines": {
"HBuilderX": "^3.1.2"
+32
View File
@@ -120,6 +120,38 @@
"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
}
}
],
"globalStyle": {
+2 -2
View File
@@ -156,13 +156,13 @@
key: "buyerSignKeyword",
title: "买家签章关键字",
type: "text",
tip: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "sellerSignKeyword",
title: "卖家签章关键字",
type: "text",
tip: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "otherFile",
+34 -39
View File
@@ -3,7 +3,7 @@
<!-- <view class="product-title">{{title}}</view> -->
<vk-data-form v-if="attributesLoaded" ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px" :footer-show="false"
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px" :footer-show="false"
@success="onFormSuccess">
</vk-data-form>
</view>
@@ -41,6 +41,7 @@
data: {
extraAttributes: {},
attributes: {},
addressRegion: undefined
},
// 表单属性
props: {
@@ -69,8 +70,21 @@
} = res
console.log(option);
if(option.extraAttributes) {
this.form1.props.columns[2].columns = option.extraAttributes.map((item, index) => {
return {
let groupIndex = -1
option.extraAttributes.forEach((item, index) => {
if(index%4 == 0) {
this.form1.props.columns[2].columns.push({
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: []
})
groupIndex ++
}
this.form1.props.columns[2].columns[0].columns.push({
key: index,
title: item.label,
type: "select",
@@ -82,14 +96,14 @@
label: citem
}
})
}
})
})
}else {
this.form1.props.columns[2].columns = []
}
}
},
{
@@ -142,15 +156,6 @@
}
},
],
},
{
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: [
{
key: "singleLength",
title: "单件长度",
@@ -185,6 +190,7 @@
},
],
},
{
key: "",
title: "",
@@ -225,15 +231,6 @@
}
},
],
},
{
key: "",
title: "",
type: "group",
justify: "start",
showLabel: false,
columns: [
{
key: "deliveryService",
title: "交货服务",
@@ -251,11 +248,11 @@
},
{key: "deliveryTime", title: "交货时限", type: "date",},
]
],
},
{
key: "",title: "",type: 'group',showLabel: false, justify: "start",columns:
[
@@ -275,29 +272,27 @@
return [];
}
},
{key: "addressRegion", title: "交货地点", type: "address",},
{key: "addressDetail", title: "详细地址", type: "textarea",},
]
},
{
key: "address",
title: "交货地点",
type: "object",
// justify: "start",
showLabel: false,
columns: [
{key: "region", title: "交货地点", type: "address",},
{key: "detail", title: "详细交货地址", type: "textarea",},
],
},
],
// 表单验证规则
rules: {
name:[
{ required:true, message:'商品不能为空', trigger: ["change","blur"] }
],
addressRegion:[
{ required:true, message:'交货地点不能为空', trigger: ["change","blur"] }
],
procureNumber:[
{ required:true, message:'采购数量不能为空', trigger: ["change","blur"] },
{ min: 1,type: 'number', message:'采购数量不能小于1', trigger: ["change","blur"] }
],
procureUnit:[
{ required:true, message:'采购数量不能为空', trigger: ["change","blur"] },
],
},
// add 代表添加 update 代表修改
+3 -2
View File
@@ -135,9 +135,10 @@
<!-- 报价列表 -->
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "
:customRightBtns="table1.customRightBtns"></vk-data-table>
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda " :customRightBtns="table1.customRightBtns"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
+73 -2
View File
@@ -26,6 +26,40 @@
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词">
<el-input @keyup.enter.native="query(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-button @click="query(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="分类">
<el-tabs>
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
<el-checkbox-group v-model="checkCategoryList[index]">
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
</el-tabs>
</el-form-item>
<el-form-item label="城市">
<el-checkbox-group v-model="checkProvinceList">
<!-- <el-checkbox :label="{code:0,name: '全国'}">全国</el-checkbox> -->
<el-checkbox :checked="cindex == 0" v-for="(citem, cindex) in provinceData" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="已选">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
@@ -34,7 +68,7 @@
</view>
<common-footer></common-footer>
</view>
</template>
@@ -47,11 +81,35 @@
export default {
data() {
return {
categoryTreeData: [],
provinceData: provinces,
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
action: (obj = {}) => {
let { data,success, fail,complete} = obj;
vk.callFunction({
url: `client/enquiry/sheet/pub/getList`,
data: data,
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err=> {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
@@ -132,6 +190,19 @@
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {
},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
+34 -10
View File
@@ -34,7 +34,7 @@
</view>
<common-footer></common-footer>
</view>
</template>
@@ -60,14 +60,38 @@
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
}, ],
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
@@ -83,7 +107,7 @@
key: "productList",
title: "采购量",
type: "text",
width: 280,
width: 100,
formatter: (val, row, column, index) => {
return val.map(item=>item.procureNumber + item.procureUnit).join("/")
}
+52 -86
View File
@@ -15,76 +15,21 @@
</view>
<view class="page-main">
<!-- 产品列表 -->
<view class="quote" v-for="(item,index) in sheet.productList" :key="index">
<el-descriptions class="description" :title="'采购商品' + (index + 1)" :column="3"
size="medium" border >
<el-descriptions-item label="商品">
{{item.name}}
</el-descriptions-item>
<el-descriptions-item v-for="(attr, aindex) in item.extraAttributes" :label="attr.keyName"
:key="aindex">
{{attr.keyValue}}
</el-descriptions-item>
<el-descriptions-item label="品牌厂家">
{{item.brand}}
</el-descriptions-item>
<el-descriptions-item label="材质">
{{item.materialQuality}}
</el-descriptions-item>
<el-descriptions-item label="单件长度">
{{item.singleLength}}
</el-descriptions-item>
<el-descriptions-item label="产品标准">
{{item.productStandard}}
</el-descriptions-item>
<el-descriptions-item label="计价形式">
{{item.pricingForm}}
</el-descriptions-item>
<el-descriptions-item label="加工标准">
{{item.processStandard}}
</el-descriptions-item>
<el-descriptions-item label="交货服务">
{{item.deliveryService}}
</el-descriptions-item>
<el-descriptions-item label="交货时限">
{{item.deliveryTime}}
</el-descriptions-item>
<el-descriptions-item label="采购数量">
{{item.procureNumber}}{{item.procureUnit}}
</el-descriptions-item>
<el-descriptions-item label="交货地点">
{{item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name}}
</el-descriptions-item>
</el-descriptions>
<view class="quote-form">
<el-form label-width="80px">
<el-form-item label="报价单价">
<vk-data-input-money v-model="item.unitPrice" placeholder="请输入单价" rightText="元"></vk-data-input-money>
</el-form-item>
<el-form-item label="小计金额">
<vk-data-input-money :readonly="true" :value="item.unitPrice * item.procureNumber" placeholder="" rightText="元"></vk-data-input-money>
</el-form-item>
</el-form>
</view>
</view>
<el-form label-width="120px" :inline="true">
<el-form-item label="报价总价">
<vk-data-input-money :readonly="true" :value="totalPrice" placeholder="请输入单价" rightText="元"></vk-data-input-money>
</el-form-item>
<el-form-item label="人民币大写">
<el-input :readonly="true" :value="totalPriceStr" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<view class="form-footer">
<el-button type="primary" @click="submit">提交报价单</el-button>
</view>
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
@success="onFormSuccess"
></vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
@@ -92,21 +37,46 @@
export default {
data() {
return {
enquiryId: undefined,
// productList: [],
sheetTitle: '',
sheet: {
productList: []
},
// totalPriceStr: ''
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
radio: 1,
checkbox : [1,2]
},
// 表单属性
props: {
// 表单请求地址
action: "template/test/sys/test",
// 表单字段显示规则
columns: [
{ key: "totalPrice", title: "货款总价", type: "money" },
{ key: "totalPriceStr", title: "人民币大写", type: "text" },
{ key: "remark", title: "报价单详情", type: "editor" },
],
// 表单验证规则
rules: {
text: [
{ required: true, message: "text不能为空", trigger: "change" },
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
const {
enquiryId
sheetId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/enquiry/list');
vk.navigateTo('/pages/process/sheet/list');
return
}
@@ -115,14 +85,7 @@
this.getEnquiryDetail()
},
computed: {
totalPrice() {
let price = 0
this.sheet.productList.forEach(item => {
price += item.unitPrice * item.procureNumber
})
return price
},
totalPriceStr() {
if(this.totalPrice == 0) {
return "零元"
@@ -131,6 +94,9 @@
}
},
methods: {
onFormSuccess() {
},
// 提交报价单
async submit() {
+204 -14
View File
@@ -19,22 +19,49 @@
<view class="m-20">
<view class="title-main">请填写询价单</view>
<view class="title-sub">询价信息越完整,供应商报价越精准</view>
<view class="form-type-box">
<view @click="form1.data.fillType = 0" :class="{active: form1.data.fillType == 0}" class="form-type-item">手动填写</view>
<view @click="form1.data.fillType = 1" :class="{active: form1.data.fillType == 1}" class="form-type-item">批量上传</view>
</view>
</view>
<view v-for="(item, index) in productList" :key="index">
<enquiry-template :ref="'product' + index" v-model="productList[index]" :base-attributes="baseAttributes" :productIndex="index"></enquiry-template>
</view>
<view class="btn-add-outer">
<!-- 手动填写 -->
<template v-if="form1.data.fillType == 0">
<view v-for="(item, index) in productList" :key="index">
<enquiry-template :ref="'product' + index" v-model="productList[index]" :base-attributes="baseAttributes" :productIndex="index"></enquiry-template>
</view>
</template>
<!-- 批量上传 -->
<view v-if="form1.data.fillType == 0" class="btn-add-outer">
<el-button @click="addProduct" type="primary" size="small">添加商品</el-button>
<el-button @click="removeProduct" type="warning" size="small">删除商品</el-button>
<el-button v-show="productList.length > 1" @click="removeProduct" type="warning" size="small">删除商品</el-button>
</view>
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
:before-action="form1.props.beforeAction" label-width="140px" cancel-text="保存草稿" submit-text="提交询价单"
@success="onFormSuccess" :footer-show="false">
<template v-slot:productCategoryIds="{ form, keyName }">
<el-form-item label="主要商品分类">
<el-tabs>
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
<el-checkbox-group v-model="checkCategoryList[index]">
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
</el-tabs>
</el-form-item>
<el-form-item label="已选分类">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
</view>
</el-form-item>
</template>
</vk-data-form>
<view class="form-footer">
<el-button type="" >保存草稿</el-button>
<el-button type="" @click="draft">保存草稿</el-button>
<el-button type="primary" @click="submit">提交询价单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
@@ -42,13 +69,14 @@
<common-footer></common-footer>
</view>
</template>
<script>
import EnquiryTemplate from './components/template.vue'
import { reject } from 'lodash';
import EnquiryTemplate from './components/template.vue'
export default {
components: {EnquiryTemplate},
data() {
@@ -56,12 +84,23 @@
// 表单相关开始-----------------------------------------------------------
productList: [{}],
baseAttributes: [],
categoryTreeData: [],
checkCategoryList: [],
form1: {
// 表单请求数据,此处可以设置默认值
data: {
fillType: 0,
// extraAttributes: {},
// attributes: {},
invoice: false
invoice: false,
breachLiability: `1. 乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;
2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。`,
solveDispute: `1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工费和获取证据产生费用等其他相关费用。
2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。`,
forceMajeure: `甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。`,
contracOther: `本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。`,
buyerSupplement: '供货方逾期供货承担采购方一切损失',
signMethod: 0,
},
// 表单属性
props: {
@@ -69,7 +108,11 @@
action: "client/enquiry/sheet/kh/add",
// 表单字段显示规则
columns: [
{key: "", title: "采购单", type: "bar-title", showRule: 'fillType==1'},
{key: "productFiles", title: "附件文档", type: "file", showRule: 'fillType==1'},
{key: "productCategoryIds", title: "商品分类", type: "bar-title", showRule: 'fillType==1'},
{key: "", title: "采购商其他要求", type: "bar-title"},
{key: "remark", title: "其他要求", type: "textarea",},
{key: "", title: "发票要求", type: "bar-title"},
{key: "invoice", title: "发票要求", type: "radio",
@@ -86,7 +129,7 @@
{ value: '付款后次月', label: "付款后次月" },
{ value: '付款前', label: "付款前" },
],
showRule: 'invoice == true'
showRule: 'invoice==true'
},
{key: "nvoiceType",
title: "发票种类",
@@ -147,6 +190,21 @@
},
{key: "answerTime", title: "报价时限", type: "date",dateType: "datetime"},
{key: "earnestMoney", title: "保证金要求", type: "text"},
{key: "", title: "合同要求", type: "bar-title"},
{key: 'signMethod', title: '签约方式', type: 'radio', data: [
{ value: 0, label: "法大大" },
{ value: 1, label: "线下签约" },
]},
{key: 'contractType', title: '合同选择', type: 'radio',showRule: 'signMethod==0', data: [
{ value: 0, label: "标准合同模板" },
{ value: 1, label: "自定义合同" },
]},
{key: "breachLiability", title: "违约责任", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "solveDispute", title: "解决纠纷的方法", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "forceMajeure", title: "不可抗力", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "contracOther", title: "其他", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "buyerSupplement", title: "采购方补充条款", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "sellerSupplement", title: "供应方补充条款", type: "textarea", showRule: 'signMethod==0&&contractType==0'},
// {key: "", title: "采购商信息", type: "bar-title"},
{
key: "files",
@@ -162,9 +220,45 @@
],
// 表单验证规则
rules: {
// name:[
// { required:true, message:'商品不能为空', trigger: ["change","blur"] }
// ],
answerTime:[
{ required:true, message:'报价时限不能为空', trigger: ["change","blur"] }
],
productCategoryIds:[
{ required:true, message:'商品分类不能为空', trigger: ["change","blur"] }
],
productFiles:[
{ required:true, message:'采购单不能为空', trigger: ["change","blur"] }
],
tradeMethod:[
{ required:true, message:'交易模式不能为空', trigger: ["change","blur"] }
],
invoice:[
{ required:true, message:'发票要求不能为空', trigger: ["change","blur"] }
],
writeInvoiceTime:[
{ required:true, message:'开票时间不能为空', trigger: ["change","blur"] }
],
nvoiceType:[
{ required:true, message:'发票类型不能为空', trigger: ["change","blur"] }
],
payMethod:[
{ required:true, message:'预付百分比不能为空', trigger: ["change","blur"] }
],
advancePayRate:[
{ required:true, message:'预付百分比不能为空', trigger: ["change","blur"] }
],
otherPayMethod:[
{ required:true, message:'付款方式不能为空', trigger: ["change","blur"] }
],
reputationPayDay:[
{ required:true, message:'账期天数不能为空', trigger: ["change","blur"] }
],
signMethod:[
{ required:true, message:'签约方式不能为空', trigger: ["change","blur"] }
],
contractType:[
{ required:true, message:'合同模板不能为空', trigger: ["change","blur"] }
],
},
// add 代表添加 update 代表修改
@@ -178,6 +272,7 @@
// console.log('formData: ',JSON.parse(JSON.stringify(formData)));
// console.log('product: ',JSON.parse(JSON.stringify(this.productList)));
formData.productList = JSON.parse(JSON.stringify(this.productList))
formData.productCategoryList = this.checkCategoryArr
return formData
}
}
@@ -185,8 +280,32 @@
// 表单相关结束-----------------------------------------------------------
};
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
return arr
}
},
onLoad() {
this.getAttributes()
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {
},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
getAttributes() {
@@ -204,10 +323,45 @@
addProduct() {
this.productList.push({})
},
removeProduct() {
if(this.productList.length > 1) {
this.productList.splice(this.productList.length - 1, 1)
}
},
onFormSuccess() {
vk.navigateTo('/pages/enquiry/list');
},
// 提交并发布
submit() {
this.form1.data.isShow = 1
this.submitAll()
},
// 提交并保存草稿
draft() {
this.form1.data.isShow = 0
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)
}
this.$refs.form1.submitForm()
}
@@ -217,6 +371,32 @@
</script>
<style lang="scss">
.form-type-box{
position: absolute;
display: flex;
justify-content: space-between;
width: 270px;
left: 0;
top: 0;
bottom: 0;
margin: auto;
}
.form-type-item {
width: 120px;
height: 35px;
text-align: center;
line-height: 35px;
font-size: 14px;
background-color: rgba(206, 206, 206, 0.75);
color: rgba(0, 0, 0, 1);
cursor: pointer;
}
.form-type-item.active {
background-color: #A92924;
color: #FFFFFF;
}
.form-view {
width: 1200px;
margin: 0 auto;
@@ -226,6 +406,7 @@
.m-20 {
margin: 20px;
position: relative;
}
.title-main{
font-size: 18px;
@@ -250,4 +431,13 @@
text-align: center;
display: block;
}
.tags {
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
}
</style>
+2 -1
View File
@@ -74,7 +74,7 @@
<div class="kind"><span>{{item.answerNumber || 0}}</span>家已报价</div>
</div>
<div class="detail-infor">
<span>`</span><span>50支</span>
<!-- <span>{{item.}}</span><span>{{}}支</span> -->
</div>
<div class="detail-num">
<span v-if="item.user.accountType == 1" class="company">{{item.user.person.personName}}</span>
@@ -201,6 +201,7 @@
pageSize: 10,
},
success: (data) => {
this.enquirySheetData = data.rows
}
});
+22
View File
@@ -0,0 +1,22 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
+340
View File
@@ -0,0 +1,340 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="http://jyx.gxwebsoft.com/uploads/20210506/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词">
<el-input @keyup.enter.native="query(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-button @click="query(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="分类">
<el-tabs>
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
<el-checkbox-group v-model="checkCategoryList[index]">
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
</el-tabs>
</el-form-item>
<el-form-item label="城市">
<el-checkbox-group v-model="checkProvinceList">
<!-- <el-checkbox :label="{code:0,name: '全国'}">全国</el-checkbox> -->
<el-checkbox :checked="cindex == 0" v-for="(citem, cindex) in provinceData" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="已选">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
</view>
</el-form-item>
</el-form>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
categoryTreeData: [],
provinceData: provinces,
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let { data,success, fail,complete} = obj;
vk.callFunction({
url: `client/process/sheet/pub/getList`,
data: data,
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err=> {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
}, ],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.name).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
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: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if(val.accountType == 1) {
return val.person.personName
}else {
return val.company.companyName
}
}
},
// {
// key: "_add_time",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {
},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
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
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+306
View File
@@ -0,0 +1,306 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="http://jyx.gxwebsoft.com/uploads/20210506/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view> -->
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
categoryTreeData: [],
provinceData: provinces,
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let { data,success, fail,complete} = obj;
vk.callFunction({
url: `client/process/sheet/pub/getList`,
data: data,
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err=> {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
}, ],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.name).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
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: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if(val.accountType == 1) {
return val.person.personName
}else {
return val.company.companyName
}
}
},
// {
// key: "_add_time",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {
},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
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
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+36
View File
@@ -0,0 +1,36 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<view style="display: inline-block;" @click="vk.navigateTo('/pages/process/list');">加工单</view>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-footer">
<el-button type="primary" @click="submit">提交报价单</el-button>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
+272
View File
@@ -0,0 +1,272 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/enquiry/list">加工单</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>发布加工单</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-view">
<view class="m-20">
<view class="title-main">请填写加工单</view>
<view class="title-sub">加工单信息越完整,加工商报价越精准</view>
</view>
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
:before-action="form1.props.beforeAction" label-width="140px" cancel-text="保存草稿" submit-text="提交加工单"
@success="onFormSuccess" :footer-show="false">
</vk-data-form>
<view class="form-footer">
<el-button type="" @click="draft">保存草稿</el-button>
<el-button type="primary" @click="submit">提交加工单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
// 表单相关开始-----------------------------------------------------------
productList: [{}],
baseAttributes: [],
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// extraAttributes: {},
// attributes: {},
invoice: false
},
// 表单属性
props: {
// 表单请求地址
action: "client/process/sheet/kh/add",
// 表单字段显示规则
columns: [
{key: "", title: "加工信息", type: "bar-title"},
{key: "title", title: "标题", type: "text",},
{
key: "address",
title: "交货地点",
type: "object",
// justify: "start",
showLabel: false,
columns: [
{key: "region", title: "交货地点", type: "address",},
{key: "detail", title: "详细交货地址", type: "textarea",},
],
},
{key: "files", title: "附件", type: "file",tips: '上传自有加工单图片或文档,支持jpg/png/word/excel'},
{key: "", title: "采购商其他要求", type: "bar-title"},
{key: "remark", title: "其他要求", type: "textarea",},
{key: "", title: "发票要求", type: "bar-title"},
{key: "invoice", title: "发票要求", type: "radio",
data: [
{ value: true, label: "含税" },
{ value: false, label: "不含税" }
],
},
{key: "writeInvoiceTime",
title: "开票时间",
type: "radio",
data: [
{ value: '付款当月(限20号之前付款,20号之后付款次月开票)', label: "付款当月(限20号之前付款,20号之后付款次月开票)" },
{ value: '付款后次月', label: "付款后次月" },
{ value: '付款前', label: "付款前" },
],
showRule: 'invoice == true'
},
{key: "nvoiceType",
title: "发票种类",
type: "radio",
data: [
{ value: '增值税专用发票13%', label: "增值税专用发票13%" },
{ value: '增值税普通发票', label: "增值税普通发票" },
{ value: '普通发票', label: "普通发票" },
],
showRule: 'invoice == true'
},
{key: "", title: "运输要求", type: "bar-title"},
{key: "transportDocuments",
title: "随货资料",
type: "checkbox",
data: [
{ value: '合格证', label: "合格证" },
{ value: '检测报告', label: "检测报告" },
{ value: '销售清单', label: "销售清单" },
{ value: '磅重', label: "磅重" },
],
},
{key: "otherTransportDocuments", title: "其他资料", type: "text"},
{key: "transportLimit",
title: "运输限制",
type: "text",
},
{key: "", title: "交易说明", type: "bar-title", component: 'custom-form-section'},
{key: "tradeMethod",
title: "交易模式",
type: "radio",
data: [
{ value: 1, label: "自主交易" },
{ value: 0, label: "金久信公证" },
],
},
// {key: "", title: "交易说明", type: "bar-title"},
{
key: "payMethod",
title: "付款方式",
type: "radio",
data: [
{ value: 1, label: "预付x%货到付全款" },
{ value: 2, label: "货到验收后付款" },
{ value: 3, label: "提货付全款" },
{ value: 4, label: "信誉采购" },
{ value: 5, label: "其他付款方式" },
],
},
{
key: "",title: "",type: 'group',showLabel: false, justify: "start",columns:[
{key: "advancePayRate", title: "预付百分比", type: "percentage",showRule: "payMethod==1"},
{key: "otherPayMethod", title: "其他付款方式", type: "text",showRule: "payMethod==5"},
{key: "reputationPayDay", title: "货到签单后账期天数", type: "number",showRule: "payMethod==4",rightText: '天'},
]
},
{key: "answerTime", title: "报价时限", type: "date",dateType: "datetime"},
{key: "earnestMoney", title: "保证金要求", type: "text"},
{key: "", title: "合同要求", type: "bar-title"},
{key: 'signMethod', title: '签约方式', type: 'radio', data: [
{ value: 0, label: "法大大" },
{ value: 1, label: "线下签约" },
]},
{key: 'contractType', title: '合同选择', type: 'radio',showRule: 'signMethod==0', data: [
{ value: 0, label: "标准合同模板" },
{ value: 1, label: "自定义合同" },
]},
{key: "breachLiability", title: "违约责任", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "solveDispute", title: "解决纠纷的方法", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "forceMajeure", title: "不可抗力", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "contracOther", title: "其他", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "buyerSupplement", title: "采购方补充条款", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "sellerSupplement", title: "供应方补充条款", type: "textarea", showRule: 'signMethod==0&&contractType==0'},
// {key: "", title: "采购商信息", type: "bar-title"},
{
key: "files",
title: "附件文档",
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.png,.xlsx,.doc,.docx",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
],
// 表单验证规则
rules: {
title:[
{ required:true, message:'标题不能为空', trigger: ["change","blur"] }
],
invoice:[
{ required:true, message:'发票要求不能为空', trigger: ["change","blur"] }
],
writeInvoiceTime:[
{ required:true, message:'开票时间不能为空', trigger: ["change","blur"] }
],
nvoiceType:[
{ required:true, message:'发票类型不能为空', trigger: ["change","blur"] }
],
},
// add 代表添加 update 代表修改
formType: "add",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData)=> {
formData.productList = JSON.parse(JSON.stringify(this.productList))
return formData
}
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad() {
},
methods: {
onFormSuccess() {
vk.navigateTo('/pages/process/list');
},
// 提交并发布
submit() {
this.form1.data.isShow = 1
this.submitAll()
},
// 提交并保存草稿
draft() {
this.form1.data.isShow = 0
this.submitAll()
},
async submitAll() {
this.$refs.form1.submitForm()
}
}
}
</script>
<style lang="scss">
.form-view {
width: 1200px;
margin: 0 auto;
background-color: #FFFFFF;
padding: 20rpx;
}
.m-20 {
margin: 20px;
}
.title-main{
font-size: 18px;
font-weight: bold;
text-align: center;
}
.title-sub{
font-size: 14px;
text-align: center;
}
.btn-add-outer{
padding-left: 140px;
margin: 0 0 20px 0;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+3 -3
View File
@@ -32,7 +32,7 @@
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词">
<el-input @keyup.enter.native="search" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-button @click="search(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
@@ -54,7 +54,7 @@
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="已选">
<el-form-item label="已选分类">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
</view>
@@ -238,7 +238,7 @@
.tags {
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
+205
View File
@@ -0,0 +1,205 @@
<template>
<view class="">
<el-card>
<div slot="header" class="clearfix">
<span>印章管理</span>
</div>
<!-- 自定义按钮区域开始 -->
<view>
<el-row>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addBtn">添加</el-button>
</el-row>
</view>
<!-- 自定义按钮区域结束 -->
<vk-data-table
ref="table1"
:action="table1.action"
:columns="table1.columns"
:right-btns="['delete']"
@update="updateBtn"
@delete="deleteBtn"
></vk-data-table>
<!-- 添加或编辑的弹窗开始 -->
<el-dialog :visible.sync="form1.props.show">
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
:auto-close="true" label-width="140px" @success="form1.props.show = false;refresh();" @cancel="closeForm"
:before-action="form1.props.beforeAction"></vk-data-form>
</el-dialog>
<!-- 添加或编辑的弹窗结束 -->
</el-card>
</view>
</template>
<script>
let that;
const originalForms = {sort: 0, enable: true}
// import { VueCropper } from 'vue-cropper'
export default {
components: {
// VueCropper
},
data() {
return {
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/seal/kh/getList",
// 表格字段显示规则
columns: [
{
key: "imageUrl",
title: "印章",
type: "image",
width: 280,
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: ""
},
// 表格相关结束 -----------------------------------------------------------
// 表单相关开始 -----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
enable: true
},
// 表单属性
props: {
// 表单请求地址
action: "",
// 表单字段显示规则
columns: [
{
key:"imageUrl", title:"印章图片", type:"image",
limit: 1,
tips: '图片格式:PNG,需设置为透明底;图片尺寸:企业章 166x166 像素,个人章 134x60 像素,印章紧密贴紧四周,尽量避免留白;',
watch: (data) => {
const { value, formData, column, index, option, $set } = data
if(!value) {
this.form1.data.imageBase64 = ""
}else {
vk.showLoading('正在上传')
vk.myfn.urlTobase64(value).then(res => {
this.form1.data.imageBase64 = res
vk.hideLoading();
})
}
}
},
{
key:"remark", title:"备注", type:"text"
},
{ key: "enable", title: "启用", type: "switch", activeValue: true, inactiveValue: false, width: 100 },
],
// 表单验证规则
rules: {
imageUrl: [
{ required:true, message:'印章不能为空', trigger:'blur' },
{ required:true, message:'印章不能为空', trigger:'blur' },
],
label:[
{ required:true, message:'属性名称不能为空', trigger:'blur' },
],
values:[
{ required:true, message:'可选值不能为空', trigger:'blur' },
],
},
// add 代表添加 update 代表修改
formType: "",
// 是否显示表单的弹窗
show: false,
beforeAction:(formData)=>{
// 可在此处修改 formData 后返回 formData,若在此处return false,则表单不触发提交请求。
return formData;
},
}
},
// 其他弹窗表单
// 表单相关结束 -----------------------------------------------------------
}
},
created() {
that = this
},
methods: {
addBtn() {
that.resetForm();
that.form1.props.action = 'client/seal/kh/add';
that.form1.props.formType = 'add';
that.form1.props.title = '添加';
that.form1.props.show = true;
},
// 显示修改页面
updateBtn({
item
}) {
that.form1.props.action = 'client/seal/kh/update';
that.form1.props.formType = 'update';
that.form1.props.title = '编辑';
that.form1.props.show = true;
that.form1.data = item;
},
closeForm() {
this.form1.props.show = false
this.form1.data = {
sort: 0,
enable: true
}
},
// 删除按钮
deleteBtn({
item,
deleteFn
}) {
deleteFn({
action: "client/seal/kh/delete",
data: {
_id: item._id
},
});
},
// 表单重置
resetForm() {
vk.pubfn.resetForm(originalForms, that);
},
// 搜索
search() {
that.$refs.table1.search();
},
// 刷新
refresh() {
that.$refs.table1.refresh();
},
}
}
</script>
<style>
</style>
+7 -1
View File
@@ -16,11 +16,16 @@
<i class="el-icon-setting"></i>
<span slot="title">我的名片</span>
</el-menu-item>
<!-- <el-menu-item index="seal">
<i class="el-icon-s-check"></i>
<span slot="title">我的印章</span>
</el-menu-item> -->
</el-menu>
</el-col>
<el-col :span="18">
<personal v-if="currMenu == 'fadada'"></personal>
<business-card v-else-if="currMenu == 'business-card'"></business-card>
<seal v-else-if="currMenu == 'seal'"></seal>
</el-col>
</el-row>
@@ -31,8 +36,9 @@
<script>
import Personal from './components/personal'
import BusinessCard from './components/business-card'
import Seal from './components/seal'
export default {
components: {Personal, BusinessCard},
components: {Personal, BusinessCard, Seal},
data() {
return {
currMenu: 'fadada',
@@ -3,12 +3,15 @@
const dbName = {
spotCategory: "jjx-spot-category", //商品-分类表
spotGoods: "jjx-spot-goods", //商品-现货表
contract: "jjx-contract", //商品-现货表
userContract: "jjx-user-contract", //商品-现货表
enquirySheet: "jjx-enquiry-sheet", //商品-现货表
enquiryQuote: "jjx-enquiry-quotre", //商品-现货表
enquiryTemplate: "jjx-enquiry-template", //商品-现货表
enquiryAttributes: "jjx-enquiry-attributes", //商品-现货表
user: "uni-id-users", //商品-现货表
contract: "jjx-contract", // 合同
userContract: "jjx-user-contract", // 用户合同
enquirySheet: "jjx-enquiry-sheet", // 询价单
enquiryQuote: "jjx-enquiry-quotre", // 报价单
enquiryTemplate: "jjx-enquiry-template", // 询价模板
enquiryAttributes: "jjx-enquiry-attributes", // 询价模板属性
user: "uni-id-users", //用户
seal: "jjx-seal", //印章
processSheet: "jjx-process-sheet", //找加工
processQuote: "jjx-process-quote", //找加工报价单
};
module.exports = dbName;
@@ -12,18 +12,19 @@ module.exports = {
let { customUtil, uniID, config, pubFun, vk , db, _ } = util;
let { uid } = data;
let res = { code : 0, msg : 'ok' };
// 业务逻辑开始-----------------------------------------------------------
// 业务逻辑开始-----------------------------------------------------------
let { _id } = data;
if(vk.pubfn.isNull(_id)){
return { code : -1, msg : 'id不能为空' };
}
let dbName = "jjx-contract-template";
await vk.baseDao.deleteById({
dbName,
dbName: dbName,
id:_id
});
// 业务逻辑结束-----------------------------------------------------------
return res;
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -14,7 +14,14 @@ module.exports = {
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
// 获取用户ID
const {fadadaCustomerId} = userInfo
const {fadadaCustomerId, fadadaSealId} = userInfo
// if(!fadadaSealId) {
// return {
// code: -1,
// msg: '请在个人中心上传印章'
// }
// }
// 获取合同信息
const userContract = await vk.baseDao.selects({
@@ -0,0 +1,80 @@
'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);
// 上传合同模板并填充
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: contract.sellerSupplement,
}),
})
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
}
}
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -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, contractId,title,contractFile,otherFile,signEndDate,buyerSignKeyword, sellSignKeyword } = data;
let { uid, contractId,title,contractFile,otherFile,signEndDate,buyerSignKeyword, sellerSignKeyword } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
@@ -44,7 +44,7 @@ module.exports = {
otherFile,
contractBase: contractFile,
buyerSignKeyword,
sellSignKeyword
sellerSignKeyword
}
})
@@ -1,4 +1,6 @@
'use strict';
const dbName = require('../../../../../dao/config.js')
module.exports = {
/**
* 同意合作
@@ -40,25 +42,62 @@ module.exports = {
status: 1
}
})
// 获取商品信息
const productTitle = quote.productList.map(item => {
return item.name
}).join("/")
if (!quote) {
return {
code: -1,
msg: '请刷新页面'
}
}
// 获取乙方信息
const quoteUser = await vk.baseDao.select({
dbName: dbName.user,
getMain: true,
getOne: true,
whereJson: {
_id: quote.userId
}
})
// 获取商品信息
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: '',
// }),
// })
// }
// 新增合同记录
const contractId = await vk.baseDao.add({
dbName: 'jjx-contract',
dataJson: {
fadadaContractId: vk.pubfn.createOrderNo("E", 20),
fadadaContractId: fadadaContractId,
contractBase: '', // 原始合同
contractHistory: [], // 历史合同
contractFinal: '', // 归档合同
@@ -71,10 +110,15 @@ module.exports = {
productTitle,
tradeMethod: quote.tradeMethod,
partyCount: 2,
signCount: 0
signCount: 0,
contractType: sheet.contractType,
signMethod: sheet.signMethod,
sellerSupplement: sheet.sellerSupplement,
}
})
// 上传合同模板
//新增 用户与合同的关联记录
await vk.daoCenter.userContractDao.adds([
{
@@ -0,0 +1,28 @@
'use strict';
const dbName = require('../../../../../dao/config.js')
module.exports = {
/**
* XXXnameXXX
* @url client/enquiry/sheet/kh/delete 前端调用的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: "" };
// 业务逻辑开始-----------------------------------------------------------
let { _id } = data;
if(vk.pubfn.isNull(_id)){
return { code : -1, msg : 'id不能为空' };
}
await vk.baseDao.deleteById({
dbName: dbName.enquirySheet,
id:_id
});
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -9,14 +9,30 @@ module.exports = {
main: async (event) => {
let { data = {}, userInfo, util, filterResponse, originalParam } = event;
let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
let { uid, userId } = data;
let { uid, userId,pageIndex,pageSize,keyword,categoryIds,provinceCodes } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
let dbName = "jjx-enquiry-sheet";
res = await vk.baseDao.getTableData({
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,
data,
pageIndex,
pageSize,
whereJson,
foreignDB: [
{
dbName:"uni-id-users",
@@ -0,0 +1,75 @@
'use strict';
module.exports = {
/**
* 新增加工单
* @url client/process/kh/add 前端调用的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,
title,
address,
files,
remark,
invoice,
writeInvoiceTime,
nvoiceType,
transportDocuments,
transportLimit,
tradeMethod,
payMethod,
advancePayRate,
otherPayMethod,
reputationPayDay,
answerTime,
earnestMoney,
status
} = data;
let res = {
code: 0,
msg: "添加成功"
};
// 业务逻辑开始-----------------------------------------------------------
res.id = await vk.baseDao.add({
dbName,
dataJson:{
title,
address,
files,
remark,
invoice,
writeInvoiceTime,
nvoiceType,
transportDocuments,
otherTransportDocuments,
transportLimit,
tradeMethod,
payMethod,
advancePayRate,
otherPayMethod,
reputationPayDay,
answerTime,
earnestMoney,
status,
answerNumber: 0,
userId: uid
}
});
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,22 @@
'use strict';
module.exports = {
/**
* 获取加工单
* @url client/process/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 } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,23 @@
'use strict';
const dbName = require('../../../../../dao/config.js')
module.exports = {
/**
* 新增加工单
* @url client/process/kh/add 前端调用的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: "" };
// 业务逻辑开始-----------------------------------------------------------
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,23 @@
'use strict';
const dbName = require('../../../../../dao/config.js')
module.exports = {
/**
* 获取加工单
* @url client/process/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 } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,73 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
/**
* 添加印章
* @url client/seal/kh/add 前端调用的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, imageBase64, imageUrl, remark, type, enable, } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
const {fadadaCustomerId} = userInfo
// 上传印章
const fadadaRes = await pubFun.fadada('add_signature.api', {
customer_id: fadadaCustomerId,
signature_img_base64: imageBase64
})
if(fadadaRes.code != 1 ) {
return {
code: -1,
msg: fadadaRes.msg
}
}
await vk.baseDao.update({
dbName: dbName.seal,
whereJson: {
_id : _.exists(true),
},
dataJson: {
isDefault: false
}
})
const sealId = await vk.baseDao.add({
dbName: dbName.seal,
dataJson: {
imageUrl: imageUrl,
remark,
type,
enable,
isDefault: true,
fadadaSealId: fadadaRes.data.signature_id,
userId: uid
}
})
vk.baseDao.update({
dbName: dbName.user,
whereJson: {
_id: uid
},
dataJson: {
fadadaSealId: fadadaRes.data.signature_id
}
})
res.data = fadadaRes
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,28 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
/**
* 删除印章
* @url client/seal/kh/delete 前端调用的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: "" };
// 业务逻辑开始-----------------------------------------------------------
await vk.baseDao.delete({
dbName: dbName.seal,
whereJson: {
_id
}
})
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,27 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
/**
* 获取印章列表
* @url client/seal/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 } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
res = await vk.baseDao.selects({
dbName: dbName.seal,
pageIndex,
pageSize,
whereJson: {
userId: uid
}
})
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}
@@ -0,0 +1,39 @@
'use strict';
const dbName = require('../../../../dao/config.js')
module.exports = {
/**
* 更新印章
* @url client/seal/kh/update 前端调用的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, imageUrl, remark, type, enable, isDefault } = data;
let res = { code: 0, msg: "" };
// 业务逻辑开始-----------------------------------------------------------
if(isDefault) {
await vk.baseDao.update({
dbName: dbName.seal,
dataJson: {
isDefault: false
}
})
}
await vk.baseDao.update({
dbName: dbName.seal,
whereJson: {
_id
},
dataJson: {
image,
remark,
type,
isDefault
}
})
// 业务逻辑结束-----------------------------------------------------------
return res;
}
}