Commit 67470005 authored by 张宗旭's avatar 张宗旭

提交

parent 3f76ebf7
...@@ -14,15 +14,31 @@ export const uploadImg = { ...@@ -14,15 +14,31 @@ export const uploadImg = {
url: '/api/upload/one/path' url: '/api/upload/one/path'
} }
// 客户 // 客户
// 客户列表 搜索
// 客户列表
export const getCustomerList = { export const getCustomerList = {
url: '' url: '/api/customer/find/all/page'
} }
// 新增客户 // 新增客户
export const addCustomer = { export const addCustomer = {
url: '/api/customer/insert' url: '/api/customer/insert'
} }
// 获取 一条 客户
export const getOneCustomer = {
url: '/api/customer/get/one/openId/'
}
// 停用 客户
export const disablesCustomer = {
url: '/api/customer/disables/'
}
// 启用 客户
export const enableCustomer = {
url: '/api/customer/enable/'
}
// 获取 所有 客户 名称
export const getCustomerName = {
url: '/api/customer/get/all/name'
}
// 产品 // 产品
// 产品 列表 // 产品 列表
export const getProduct = { export const getProduct = {
...@@ -42,10 +58,70 @@ export const editProduct = { ...@@ -42,10 +58,70 @@ export const editProduct = {
} }
// 采购单 // 采购单
// 搜索 采购单 // 搜索 采购单
export const getAllOrder = { export const purchaseOrderFind = {
url: '/api/purchase/order/find/page' url: '/api/purchase/order/find/page'
} }
// 新增 采购单
export const addPurchaseOrder = {
url: '/api/purchase/order/insert'
}
// 采购单 详情
export const getOneOrderNum = {
url: '/api/purchase/order/get/one/orderNum/'
}
// 禁用 采购单下所有车辆
export const purchaseOrderDisableCar = {
url: '/api/purchase/order/disable/car/'
}
// 启用 采购单下所有车辆
export const purchaseOrderEnableCar = {
url: '/api/purchase/order/enable/car/'
}
// 作废 采购单
export const purchaseOrderDelete = {
url: '/api/purchase/order/delete/'
}
// 供应商
// 新增供应商
export const addBusiness = {
url: '/api/company/insert/supplier'
}
// 修改 供应商
export const modiyBusiness = {
url: '/api/company/update/supplier'
}
// 获取 供应商 列表
export const getBusinessList = {
url: '/api/company/get/supplier/all/page'
}
// 获取 供应商 详情
export const getBusiness = {
url: '/api/company/get/supplier/openId/'
}
// 获取 供应商 商家介绍
export const getBusinessInit = {
url: '/api/company/get/supplier/introduce/'
}
// 获取 供应商 宣传图片
export const getBusinessImg = {
url: '/api/company/get/supplier/brochure/image/'
}
// 获取 供应商 套餐订餐截止时间
export const getBusinessSupplierDeadline = {
url: '/api/company/get/supplier/deadline/'
}
// 修改 供应商 密码
export const modifyPws = {
url: '/api/company/update/supplier/password'
}
// 禁用 供应商
export const disableBusiness = {
url: '/api/company/disable/supplier'
}
// 启用 供应商
export const enableBusiness = {
url: '/api/company/enable/supplier'
}
// 常量 // 常量
// 客户 性质 // 客户 性质
export const getCustomerNature = { export const getCustomerNature = {
...@@ -59,15 +135,19 @@ export const getCustomerType = { ...@@ -59,15 +135,19 @@ export const getCustomerType = {
export const getProductType = { export const getProductType = {
url: '/constant/get/product/type' url: '/constant/get/product/type'
} }
// 通过 产品类型 获取 产品型号 // 客户 账户 状态
export const getAllModel = { export const getCustomerState = {
url: '/api/product/get/all/model/' url: '/constant/get/customer/state'
} }
// 付费 模式 // 付费 模式
export const getPaymentModel = { export const getPurchaseOrderPaymentModel = {
url: '/constant/get/purchaseOrder/paymentModel' url: '/constant/get/purchaseOrder/paymentModel'
} }
// 生产 状态 // 生产 状态
export const getproductionState = { export const getPurchaseOrderProductionState = {
url: '/constant/get/purchaseOrder/productionState' url: '/constant/get/purchaseOrder/productionState'
} }
// 根据产品类型 获取 产品型号
export const getAllModel = {
url: '/api/product/get/all/model/'
}
...@@ -44,6 +44,17 @@ const frameIn = [ ...@@ -44,6 +44,17 @@ const frameIn = [
}, },
component: _import('customer/add/index') component: _import('customer/add/index')
}, },
// 客户 详情
{
path: 'customerDetails/:id',
name: 'customerDetails/:id',
meta: {
title: '客户详情',
auth: true
},
component: _import('customer/details/index')
},
// 产品 // 产品
// 添加 产品 // 添加 产品
{ {
...@@ -88,12 +99,12 @@ const frameIn = [ ...@@ -88,12 +99,12 @@ const frameIn = [
auth: true auth: true
}, },
component: _import('purchaseOrder/list/index') component: _import('purchaseOrder/purchaseOrderList/index')
}, },
// 添加 采购单 // 添加采购单
{ {
path: 'addPurchaseOrder', path: 'addpurchaseOrder',
name: 'addPurchaseOrder', name: 'addpurchaseOrder',
meta: { meta: {
title: '添加采购单', title: '添加采购单',
auth: true auth: true
...@@ -101,6 +112,19 @@ const frameIn = [ ...@@ -101,6 +112,19 @@ const frameIn = [
}, },
component: _import('purchaseOrder/add/index') component: _import('purchaseOrder/add/index')
}, },
// 采购单 详情
{
path: 'purchaseOrderDetails/:id',
name: 'purchaseOrderDetails/:id',
meta: {
title: '采购单详情',
auth: true
},
component: _import('purchaseOrder/details/index')
},
// 商家 列表 // 商家 列表
{ {
path: 'businessList', path: 'businessList',
...@@ -132,6 +156,7 @@ const frameIn = [ ...@@ -132,6 +156,7 @@ const frameIn = [
}, },
component: _import('business/add/index') component: _import('business/add/index')
}, },
//
// 详情 // 详情
{ {
path: 'detailsBusiness/:id', path: 'detailsBusiness/:id',
......
<template>
<d2-container v-loading="isLoading">
<div>
<div class="providerOrderList-container">
<div class="d-f-j"
style="background: #f2f3f5">
<div>
<div class="name">基本信息</div>
</div>
<!-- <div class="name modify"
@click="basicModiy()">修改</div> -->
</div>
</div>
<div class="df"
style="margin-top: 20px">
<div class="df left">
<div>客户名称:</div>
<div>{{ datas.name }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>机构编码:</div>
<div>{{ datas.coding }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>商家类型:</div>
<div>{{ datas.typeValue }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>商家性质:</div>
<div>{{ datas.natureValue }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>联系人:</div>
<div>{{ datas.contact }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>联系电话:</div>
<div>{{ datas.contactPhone }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>所在城市:</div>
<div>{{ datas.provinceName }}{{ datas.cityName }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>联系邮箱:</div>
<div>{{ datas.email }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>状态:</div>
<div>{{ datas.stateValue }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>创建时间:</div>
<div>{{ datas.createTime }}</div>
</div>
</div>
</div>
</d2-container>
</template>
<script>
import { getOneCustomer, modifyPws } from "@/libs/common/constant";
export default {
data() {
return {
isLoading: false,
datas: {},
isShow: true,
lunchTime: "",
dinnerTime: "",
imge: "",
openId: this.$route.params.id,
isShowImage: false,
img: "",
isModifyPassword: false,
};
},
async created() {
await this.getData();
},
methods: {
async getData() {
this.isLoading = true;
await this.getOneCustomer(this.openId);
},
async getOneCustomer(openId) {
const res = await this.$api.GET(`${getOneCustomer.url}${openId}`);
this.datas = res
this.isLoading = false;
console.log(res, "11");
},
lookImage(type) {
console.log(type);
if (type == "logo") {
this.img = this.datas.logImage;
// 这是logo
} else if (type == "license") {
// 这是营业执照
this.img = this.datas.businessImage;
}
this.isShowImage = true;
},
noShowImg() {
this.isShowImage = false;
},
async modifyPsw(data) {
const pages = {
loginName: this.datas.loginName,
supplierOpenId: this.openId,
loginPwd: data.password,
};
const res = await this.$api.POST(`${modifyPws.url}`, pages);
console.log(res, "修改结果");
this.isModifyPassword = false;
},
async noModify() {
this.isModifyPassword = false;
},
// 设置基本信息
basicModiy() {
this.$router.push({
path: `/basicModiy/${this.openId}`,
});
},
// 联系信息设置
contactModiy() {
this.$router.push({
path: `/contactModiy/${this.openId}`,
});
},
// 收款信息 设置
chargeModiy() {
this.$router.push({
path: `/chargeModiy/${this.openId}`,
});
},
// 商家介绍
lookIntroduce() {
this.$router.push({
path: `/businessIntroduce/${this.openId}`,
});
},
// 重置密码
resetting() {
this.isModifyPassword = true;
},
},
};
</script>
<style lang="scss" scoped>
.d-f-j {
display: flex;
justify-content: space-between;
}
.df {
display: flex;
}
.name {
height: 50px;
line-height: 50px;
margin-left: 10px;
}
.modify {
margin-right: 20px;
color: blue;
cursor: pointer;
}
.button {
margin-top: 20px;
margin-right: 10px;
}
.left {
width: 400px;
line-height: 40px;
margin-left: 30px;
}
.right {
line-height: 40px;
margin-right: 30px;
}
</style>
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<div class="filter-box"> <div class="filter-box">
<div class="filter-item"> <div class="filter-item">
<div class="spana">客户名称:</div> <div class="spana">客户名称:</div>
<el-input v-model="conditionCollection.companyNameLike" <el-input v-model="conditionCollection.name"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">客户性质:</div> <div class="spana">客户性质:</div>
<el-select v-model="conditionCollection.nature" <el-select v-model="conditionCollection.nature"
placeholder="全部"> placeholder="全部">
<el-option v-for="item in natureList" <el-option v-for="item in customerNatureList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">客户类型:</div> <div class="spana">客户类型:</div>
<el-select v-model="conditionCollection.businessType" <el-select v-model="conditionCollection.type"
placeholder="全部"> placeholder="全部">
<el-option v-for="item in businessTypeList" <el-option v-for="item in customerTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">账户状态:</div> <div class="spana">账户状态:</div>
<el-select v-model="conditionCollection.status" <el-select v-model="conditionCollection.state"
placeholder="全部"> placeholder="全部">
<el-option v-for="item in statusList" <el-option v-for="item in statusList"
:key="item.value" :key="item.value"
...@@ -77,12 +77,12 @@ ...@@ -77,12 +77,12 @@
</el-form> </el-form>
<div class="filter-item"> <div class="filter-item">
<div class="spana">负责人:</div> <div class="spana">负责人:</div>
<el-input v-model="conditionCollection.contactNameLike" <el-input v-model="conditionCollection.contact"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">联系电话:</div> <div class="spana">联系电话:</div>
<el-input v-model="conditionCollection.contactPhoneLike" <el-input v-model="conditionCollection.contactPhone"
placeholder="请输入"></el-input> placeholder="请输入"></el-input>
</div> </div>
<div class="filter-btn"> <div class="filter-btn">
...@@ -106,21 +106,21 @@ ...@@ -106,21 +106,21 @@
<!-- <el-table-column prop="userCode" label="序号"> </el-table-column> --> <!-- <el-table-column prop="userCode" label="序号"> </el-table-column> -->
<el-table-column prop="id" <el-table-column prop="id"
label="客户编号"> </el-table-column> label="客户编号"> </el-table-column>
<el-table-column prop="companyName" <el-table-column prop="name"
label="客户名称"></el-table-column> label="客户名称"></el-table-column>
<el-table-column prop="natureValue" <el-table-column prop="natureValue"
label="客户性质"> </el-table-column> label="客户性质"> </el-table-column>
<el-table-column prop="businessTypeValue" <el-table-column prop="typeValue"
label="客户类型"> </el-table-column> label="客户类型"> </el-table-column>
<el-table-column prop="contactName" <el-table-column prop="contact"
label="联系人"></el-table-column> label="联系人"></el-table-column>
<el-table-column prop="contactPhone" <el-table-column prop="contactPhone"
label="联系电话"> </el-table-column> label="联系电话"> </el-table-column>
<el-table-column prop="companyAddrTwo" <el-table-column prop="cityOfResidence"
label="所在城市"> </el-table-column> label="所在城市"> </el-table-column>
<el-table-column prop="loginName" <el-table-column prop="createTime"
label="创建时间"> </el-table-column> label="创建时间"> </el-table-column>
<el-table-column prop="statusValue" <el-table-column prop="stateValue"
label="状态"> </el-table-column> label="状态"> </el-table-column>
<el-table-column fixed="right" <el-table-column fixed="right"
label="操作" label="操作"
...@@ -135,11 +135,11 @@ ...@@ -135,11 +135,11 @@
style="font-size: 14px; width: 90px; margin-left: 0" style="font-size: 14px; width: 90px; margin-left: 0"
@click="edit(scope.row.openId)">收款设置</el-button> --> @click="edit(scope.row.openId)">收款设置</el-button> -->
<el-button type="text" <el-button type="text"
v-if="scope.row.status == 1" v-if="scope.row.state == 1"
style="font-size: 14px; margin-left: 10px" style="font-size: 14px; margin-left: 10px"
@click="enable(scope.row.openId)">启用</el-button> @click="enable(scope.row.openId)">启用</el-button>
<el-button type="text" <el-button type="text"
v-if="scope.row.status == 0" v-if="scope.row.state == 0"
style="font-size: 14px; margin-left: 10px;color:red" style="font-size: 14px; margin-left: 10px;color:red"
@click="disable(scope.row.openId)">停用</el-button> @click="disable(scope.row.openId)">停用</el-button>
...@@ -161,25 +161,26 @@ ...@@ -161,25 +161,26 @@
<script> <script>
import { import {
jdAddressCascader, jdAddressCascader,
getNature, enableCustomer,
getBusinessType, disablesCustomer,
getBusinessList, getCustomerList,
enableBusiness, getCustomerNature,
disableBusiness, getCustomerType,
getCustomerState,
} from "@/libs/common/constant"; } from "@/libs/common/constant";
import { selectListALL } from "@/utils/json"; import { selectListALL, selectList } from "@/utils/json";
export default { export default {
data() { data() {
return { return {
conditionCollection: { conditionCollection: {
companyNameLike: "", name: "",
nature: "", nature: "",
businessType: "", type: "",
status: "", state: "",
provinceId: "", provinceId: "",
cityId: "", cityId: "",
contactNameLike: "", contact: "",
contactPhoneLike: "", contactPhone: "",
}, },
dataList: [], dataList: [],
searchCriteria: { searchCriteria: {
...@@ -190,25 +191,12 @@ export default { ...@@ -190,25 +191,12 @@ export default {
tablekey: "", tablekey: "",
loadings: true, loadings: true,
isLoadProvinceId: true, isLoadProvinceId: true,
// 商家 性质 // 客户 性质
natureList: [], customerNatureList: [],
// 商家类型 // 客户 类型
businessTypeList: [], customerTypeList: [],
// 账户 状态 // 账户 状态
statusList: [ statusList: [],
{
label: "全部",
value: "",
},
{
label: "启用",
value: 0,
},
{
label: "停用",
value: 1,
},
],
// 一级地址 // 一级地址
provinceIdList: [], provinceIdList: [],
// 二级地址 // 二级地址
...@@ -241,26 +229,21 @@ export default { ...@@ -241,26 +229,21 @@ export default {
// 获取 列表 参数 // 获取 列表 参数
async getListData(data) { async getListData(data) {
this.loadings = true; this.loadings = true;
const dataList = await this.getBusinessList(data); const dataList = await this.getCustomerList(data);
console.log(dataList); console.log(dataList);
// cityOfResidence
this.total = dataList.total; this.total = dataList.total;
for (var i = 0; i < dataList.list.length; i++) {
dataList.list[i].natureValue =
dataList.list[i].supplierInfoBo.natureValue;
dataList.list[i].businessTypeValue =
dataList.list[i].supplierInfoBo.businessTypeValue;
dataList.list[i].loginName = dataList.list[i].userList[0].loginName;
dataList.list[i].companyAddrTwo =
dataList.list[i].companyAddr.split(" ")[0] +
" " +
dataList.list[i].companyAddr.split(" ")[1];
}
this.dataList = dataList.list; this.dataList = dataList.list;
for (var i = 0; i < this.dataList.length; i++) {
this.dataList[i].cityOfResidence =
this.dataList[i].provinceName + " " + this.dataList[i].cityName;
}
this.loadings = false; this.loadings = false;
}, },
async getBusinessList(data) { async getCustomerList(data) {
const res = await this.$api.GET(`${getBusinessList.url}`, data); const res = await this.$api.GET(`${getCustomerList.url}`, data);
return res; return res;
}, },
async pagingEvent() { async pagingEvent() {
...@@ -286,17 +269,21 @@ export default { ...@@ -286,17 +269,21 @@ export default {
// 查看详情 // 查看详情
detils(openId) { detils(openId) {
this.$router.push({ this.$router.push({
path: `/detailsBusiness/${openId}`, path: `/customerDetails/${openId}`,
}); });
}, },
selectListALL(myJson) { selectListALL(myJson) {
return selectListALL(myJson); return selectListALL(myJson);
}, },
selectList(myJson, a) {
return selectList(myJson, a);
},
// 获取 常量 // 获取 常量
async getConstant() { async getConstant() {
await this.getProvinceIdList(); await this.getProvinceIdList();
await this.getNatureList(); await this.getNatureList();
await this.getBusinessTypeList(); await this.getCustomerTypeList();
await this.getCustomerState();
}, },
// 获取 一级地址 // 获取 一级地址
async getProvinceIdList() { async getProvinceIdList() {
...@@ -304,15 +291,20 @@ export default { ...@@ -304,15 +291,20 @@ export default {
this.provinceIdList = res; this.provinceIdList = res;
this.isLoadProvinceId = false; this.isLoadProvinceId = false;
}, },
// 获取 商家性质 // 获取 客户 性质
async getNatureList() { async getNatureList() {
const res = await this.$api.GET(`${getNature.url}`); const res = await this.$api.GET(`${getCustomerNature.url}`);
this.natureList = this.selectListALL(res); this.customerNatureList = this.selectList(res, true);
},
// 获取 客户类型
async getCustomerTypeList() {
const res = await this.$api.GET(`${getCustomerType.url}`);
this.customerTypeList = this.selectList(res);
}, },
// 获取 商家类型 // 获取 客户 账户 状态
async getBusinessTypeList() { async getCustomerState() {
const res = await this.$api.GET(`${getBusinessType.url}`); const res = await this.$api.GET(`${getCustomerState.url}`);
this.businessTypeList = this.selectListALL(res); this.statusList = this.selectList(res);
}, },
// 获取 二级地址 // 获取 二级地址
async provinceIdChange() { async provinceIdChange() {
...@@ -321,14 +313,14 @@ export default { ...@@ -321,14 +313,14 @@ export default {
); );
}, },
async enable(openId) { async enable(openId) {
this.$confirm("确定启用此供应商吗?", "提示", { this.$confirm("确认启用此客户吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
// type: 'warning', // type: 'warning',
customClass: "custom-confirm", customClass: "custom-confirm",
}) })
.then(() => { .then(() => {
this.enableBusiness(openId); this.enableCustomer(openId);
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
...@@ -337,10 +329,8 @@ export default { ...@@ -337,10 +329,8 @@ export default {
}); });
}); });
}, },
async enableBusiness(openId) { async enableCustomer(openId) {
const res = await this.$api.POST(`${enableBusiness.url}`, { const res = await this.$api.POST(`${enableCustomer.url}${openId}`);
companyOpenId: openId,
});
console.log(res); console.log(res);
await this.queryData(); await this.queryData();
this.$message({ this.$message({
...@@ -349,14 +339,14 @@ export default { ...@@ -349,14 +339,14 @@ export default {
}); });
}, },
disable(openId) { disable(openId) {
this.$confirm("确定停用此供应商吗?", "提示", { this.$confirm("确认停用此客户吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
// type: 'warning', // type: 'warning',
customClass: "custom-confirm", customClass: "custom-confirm",
}) })
.then(() => { .then(() => {
this.disableBusiness(openId); this.disablesCustomer(openId);
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
...@@ -365,10 +355,8 @@ export default { ...@@ -365,10 +355,8 @@ export default {
}); });
}); });
}, },
async disableBusiness(openId) { async disablesCustomer(openId) {
const res = await this.$api.POST(`${disableBusiness.url}`, { const res = await this.$api.POST(`${disablesCustomer.url}${openId}`);
companyOpenId: openId,
});
console.log(res); console.log(res);
await this.queryData(); await this.queryData();
this.$message({ this.$message({
......
...@@ -150,6 +150,9 @@ export default { ...@@ -150,6 +150,9 @@ export default {
this.$refs[detail].validate(async (valid) => { this.$refs[detail].validate(async (valid) => {
if (valid) { if (valid) {
try { try {
// 提交前 处理 数据
// 拼接 营业时间 转换 时间
// var data = await this.arrangeData();
// 判断 参数 确定是修改还是 添加 // 判断 参数 确定是修改还是 添加
if (this.editId) { if (this.editId) {
console.log(this.form, "编辑提交的参数"); console.log(this.form, "编辑提交的参数");
......
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
width="120"> width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 编辑 --> <!-- 编辑 -->
<el-button type="text" <!-- <el-button type="text"
style="font-size: 14px; margin-left: 0px" style="font-size: 14px; margin-left: 0px"
@click="detils(scope.row.openId)">查看详情</el-button> @click="detils(scope.row.openId)">查看详情</el-button> -->
<el-button type="text" <el-button type="text"
style="font-size: 14px; margin-left: 10px" style="font-size: 14px; margin-left: 10px"
......
...@@ -6,19 +6,23 @@ ...@@ -6,19 +6,23 @@
ref="form" ref="form"
:rules="rules"> :rules="rules">
<el-form-item label="客户名称:" <el-form-item label="客户名称:"
prop="name"> prop="customerName">
<el-input v-model="form.name" <el-select v-model="form.customerName"
placeholder="请填写" placeholder="请选择"
autocomplete="off" class="filter-item-same-width">
maxlength="50" <el-option v-for="item in customerNameList"
:show-word-limit="true" :key="item.value"
class="filter-item-same-width" /> :label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="产品类型:" <el-form-item label="产品类型:"
prop="type"> prop="productType">
<el-select v-model="form.type" <el-select v-model="form.productType"
placeholder="请选择" placeholder="请选择"
@change="getAllModel"
class="filter-item-same-width"> class="filter-item-same-width">
<el-option v-for="item in typeList" <el-option v-for="item in typeList"
:key="item.value" :key="item.value"
...@@ -29,24 +33,50 @@ ...@@ -29,24 +33,50 @@
</el-form-item> </el-form-item>
<el-form-item label="产品型号:" <el-form-item label="产品型号:"
prop="model"> prop="productModel">
<el-input v-model="form.model" <el-select v-model="form.productModel"
placeholder="请填写" placeholder="请选择"
autocomplete="off" class="filter-item-same-width">
maxlength="30" <el-option v-for="item in allModelList"
:show-word-limit="true" :key="item.value"
class="filter-item-same-width" /> :label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="搜索前缀:" <el-form-item label="付费模式:"
prop=""> prop="paymentModel">
<el-input v-model="form.searchPrefix" <el-select v-model="form.paymentModel"
placeholder="请选择"
class="filter-item-same-width">
<el-option v-for="item in paymentModelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="计划采购数量:"
prop="projectedNumber">
<el-input v-model="form.projectedNumber"
placeholder="请填写" placeholder="请填写"
autocomplete="off" autocomplete="off"
maxlength="30" maxlength="50"
:show-word-limit="true" :show-word-limit="true"
class="filter-item-same-width" /> class="filter-item-same-width" />
</el-form-item> </el-form-item>
<el-form-item label="预计交货时间:"
prop="estimatedDeliveryTime">
<el-date-picker v-model="form.estimatedDeliveryTime"
type="date"
value-format="yyyy-MM-dd hh:mm:ss"
:picker-options="pickerOptions"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注:" <el-form-item label="备注:"
prop=""> prop="">
<el-input v-model="form.remark" <el-input v-model="form.remark"
...@@ -73,11 +103,13 @@ ...@@ -73,11 +103,13 @@
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { import {
addPurchaseOrder,
addProduct,
getProductType, getProductType,
getOneProduct, getOneProduct,
editProduct editProduct,
getCustomerName,
getAllModel,
getPurchaseOrderPaymentModel,
} from "@/libs/common/constant"; } from "@/libs/common/constant";
import { selectList, generateTiemList, weekList } from "@/utils/json"; import { selectList, generateTiemList, weekList } from "@/utils/json";
import dayjs from "dayjs"; import dayjs from "dayjs";
...@@ -86,20 +118,43 @@ export default { ...@@ -86,20 +118,43 @@ export default {
return { return {
isLoading: false, isLoading: false,
form: { form: {
name: "", customerName: "",
type: "", productType: "",
model: "", productModel: "",
searchPrefix: "", paymentModel: "",
remark: "", projectedNumber: "",
estimatedDeliveryTime: "",
}, },
ifSubmit: false, ifSubmit: false,
typeList: [], typeList: [],
customerNameList: [],
allModelList: [],
paymentModelList: [],
// 禁用今天之前的日期
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
// 编辑 // 编辑
editId: this.$route.params.id, editId: this.$route.params.id,
rules: { rules: {
name: [{ required: true, message: "请填写", trigger: "blur" }], customerName: [{ required: true, message: "请填写", trigger: "blur" }],
model: [{ required: true, message: "请填写", trigger: "blur" }], projectedNumber: [
type: [{ required: true, message: "请选择", trigger: "change" }], { required: true, message: "请填写", trigger: "blur" },
],
estimatedDeliveryTime: [
{ required: true, message: "请填写", trigger: "blur" },
],
productType: [{ required: true, message: "请选择", trigger: "change" }],
productModel: [
{ required: true, message: "请选择", trigger: "change" },
],
paymentModel: [
{ required: true, message: "请选择", trigger: "change" },
],
productType: [{ required: true, message: "请选择", trigger: "change" }],
productType: [{ required: true, message: "请选择", trigger: "change" }],
}, },
}; };
}, },
...@@ -121,6 +176,8 @@ export default { ...@@ -121,6 +176,8 @@ export default {
// 获取 字典数据 // 获取 字典数据
async getConstant() { async getConstant() {
await this.getProductType(); await this.getProductType();
await this.getCustomerName();
await this.getPurchaseOrderPaymentModel();
}, },
selectList(myJson, a) { selectList(myJson, a) {
return selectList(myJson, a); return selectList(myJson, a);
...@@ -136,13 +193,30 @@ export default { ...@@ -136,13 +193,30 @@ export default {
const res = await this.$api.GET(`${getProductType.url}`); const res = await this.$api.GET(`${getProductType.url}`);
this.typeList = this.selectList(res); this.typeList = this.selectList(res);
}, },
// 获取 客户 名称
async getCustomerName() {
const res = await this.$api.GET(`${getCustomerName.url}`);
this.customerNameList = this.selectList(res);
console.log(this.customerNameList);
},
// 获取 产品 型号
async getAllModel() {
const res = await this.$api.GET(
`${getAllModel.url}${this.form.productType}`
);
this.allModelList = this.selectList(res);
},
// 获取 付费模式
async getPurchaseOrderPaymentModel() {
const res = await this.$api.GET(`${getPurchaseOrderPaymentModel.url}`);
this.paymentModelList = this.selectList(res);
},
async cancel() { async cancel() {
var tagName = this.current; var tagName = this.current;
await this.close({ tagName }); await this.close({ tagName });
this.$router.push("/productList"); this.$router.push("/purchaseOrderList");
}, },
submit(detail) { submit(detail) {
if (this.ifSubmit) { if (this.ifSubmit) {
return; return;
} }
...@@ -162,7 +236,7 @@ export default { ...@@ -162,7 +236,7 @@ export default {
} else { } else {
console.log(this.form, "添加提交的参数"); console.log(this.form, "添加提交的参数");
// 提交 接口 // 提交 接口
await this.addProduct(this.form); await this.addPurchaseOrder(this.form);
} }
await this.cancel(); await this.cancel();
this.$message({ this.$message({
...@@ -178,8 +252,8 @@ export default { ...@@ -178,8 +252,8 @@ export default {
}); });
}, },
// 添加 产品 // 添加 产品
async addProduct(data) { async addPurchaseOrder(data) {
const res = await this.$api.POST(`${addProduct.url}`, data); const res = await this.$api.POST(`${addPurchaseOrder.url}`, data);
console.log(res, "添加产品接口成功的返回"); console.log(res, "添加产品接口成功的返回");
}, },
// 编辑 // 编辑
...@@ -187,7 +261,7 @@ export default { ...@@ -187,7 +261,7 @@ export default {
async getOneProduct(openId) { async getOneProduct(openId) {
const res = await this.$api.GET(`${getOneProduct.url}${openId}`); const res = await this.$api.GET(`${getOneProduct.url}${openId}`);
console.log(res); console.log(res);
this.form = res this.form = res;
this.isLoading = false; this.isLoading = false;
}, },
}, },
......
<template>
<d2-container v-loading="isLoading">
<div>
<div class="providerOrderList-container">
<div class="d-f-j"
style="background: #f2f3f5">
<div>
<div class="name">订单信息</div>
</div>
<!-- <div class="name modify"
@click="basicModiy()">修改</div> -->
</div>
</div>
<div class="df"
style="margin-top: 20px">
<div class="df left">
<div>采购单号:</div>
<div>{{ datas.orderNum }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>客户名称:</div>
<div>{{ datas.customerId }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>计划采购:</div>
<div>{{ datas.plannedPurchase }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>入库数量:</div>
<div>{{ datas.bindNum }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>付费模式:</div>
<div>{{ datas.paymentModelValue }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>生产状态:</div>
<div>{{ datas.productionStateValue}}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>预计交货:</div>
<div>{{ datas.estimatedDeliveryTime }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>下单时间:</div>
<div>{{ datas.createTime }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>订单备注:</div>
<div>{{ datas.remark }}</div>
</div>
</div>
<div class="providerOrderList-container">
<div class="d-f-j"
style="background: #f2f3f5">
<div>
<div class="name">基本信息</div>
</div>
<!-- <div class="name modify"
@click="basicModiy()">修改</div> -->
</div>
</div>
<div class="df"
style="margin-top: 20px">
<div class="df left">
<div>产品名称:</div>
<div>{{ datas.productName }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>设备状态:</div>
<div>{{ datas.deviceStateValue }}</div>
</div>
</div>
<div class="df">
<div class="df left">
<div>产品类型:</div>
<div>{{ datas.productTypeValue }}</div>
</div>
<div class="df right"
style="margin-left: 170px">
<div>产品型号:</div>
<div>{{ datas.productModel }}</div>
</div>
</div>
</div>
</d2-container>
</template>
<script>
import { getOneOrderNum, modifyPws } from "@/libs/common/constant";
export default {
data() {
return {
isLoading: false,
datas: {},
isShow: true,
lunchTime: "",
dinnerTime: "",
imge: "",
openId: this.$route.params.id,
isShowImage: false,
img: "",
isModifyPassword: false,
};
},
async created() {
await this.getData();
},
methods: {
async getData() {
this.isLoading = true;
await this.getOneOrderNum(this.openId);
},
async getOneOrderNum(openId) {
const res = await this.$api.GET(`${getOneOrderNum.url}${openId}`);
this.datas = res;
this.isLoading = false;
console.log(res, "11");
},
lookImage(type) {
console.log(type);
if (type == "logo") {
this.img = this.datas.logImage;
// 这是logo
} else if (type == "license") {
// 这是营业执照
this.img = this.datas.businessImage;
}
this.isShowImage = true;
},
noShowImg() {
this.isShowImage = false;
},
async modifyPsw(data) {
const pages = {
loginName: this.datas.loginName,
supplierOpenId: this.openId,
loginPwd: data.password,
};
const res = await this.$api.POST(`${modifyPws.url}`, pages);
console.log(res, "修改结果");
this.isModifyPassword = false;
},
async noModify() {
this.isModifyPassword = false;
},
// 设置基本信息
basicModiy() {
this.$router.push({
path: `/basicModiy/${this.openId}`,
});
},
// 联系信息设置
contactModiy() {
this.$router.push({
path: `/contactModiy/${this.openId}`,
});
},
// 收款信息 设置
chargeModiy() {
this.$router.push({
path: `/chargeModiy/${this.openId}`,
});
},
// 商家介绍
lookIntroduce() {
this.$router.push({
path: `/businessIntroduce/${this.openId}`,
});
},
// 重置密码
resetting() {
this.isModifyPassword = true;
},
},
};
</script>
<style lang="scss" scoped>
.d-f-j {
display: flex;
justify-content: space-between;
}
.df {
display: flex;
}
.name {
height: 50px;
line-height: 50px;
margin-left: 10px;
}
.modify {
margin-right: 20px;
color: blue;
cursor: pointer;
}
.button {
margin-top: 20px;
margin-right: 10px;
}
.left {
width: 400px;
line-height: 40px;
margin-left: 30px;
}
.right {
line-height: 40px;
margin-right: 30px;
}
</style>
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<div class="filter-item"> <div class="filter-item">
<div class="spana">产品类型:</div> <div class="spana">产品类型:</div>
<el-select v-model="conditionCollection.productType" <el-select v-model="conditionCollection.productType"
@change="getAllModel"
placeholder="全部"> placeholder="全部">
<el-option v-for="item in typeList" <el-option v-for="item in typeList"
:key="item.value" :key="item.value"
...@@ -26,14 +25,8 @@ ...@@ -26,14 +25,8 @@
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">产品型号:</div> <div class="spana">产品型号:</div>
<el-select v-model="conditionCollection.productModel" <el-input v-model="conditionCollection.productModel"
placeholder="全部"> placeholder="请输入"></el-input>
<el-option v-for="item in allModelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">付费模式:</div> <div class="spana">付费模式:</div>
...@@ -48,7 +41,7 @@ ...@@ -48,7 +41,7 @@
</div> </div>
<div class="filter-item"> <div class="filter-item">
<div class="spana">生产状态:</div> <div class="spana">生产状态:</div>
<el-select v-model="conditionCollection.productionStatus" <el-select v-model="conditionCollection.productionState"
placeholder="全部"> placeholder="全部">
<el-option v-for="item in productionStateList" <el-option v-for="item in productionStateList"
:key="item.value" :key="item.value"
...@@ -67,7 +60,7 @@ ...@@ -67,7 +60,7 @@
@click="reset()">重置</el-button> @click="reset()">重置</el-button>
<el-button type="success" <el-button type="success"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="addPurchaseOrder()">新建采购单</el-button> @click="addBusiness()">新建采购单</el-button>
</div> </div>
</div> </div>
<div> <div>
...@@ -81,7 +74,7 @@ ...@@ -81,7 +74,7 @@
label="序号"> </el-table-column> label="序号"> </el-table-column>
<el-table-column prop="orderNum" <el-table-column prop="orderNum"
label="采购单号"></el-table-column> label="采购单号"></el-table-column>
<el-table-column prop="customerOpenId" <el-table-column prop="customer"
label="客户名称"> </el-table-column> label="客户名称"> </el-table-column>
<el-table-column prop="productName" <el-table-column prop="productName"
label="产品名称"> </el-table-column> label="产品名称"> </el-table-column>
...@@ -99,20 +92,33 @@ ...@@ -99,20 +92,33 @@
label="生产状态"> </el-table-column> label="生产状态"> </el-table-column>
<el-table-column prop="deviceStateValue" <el-table-column prop="deviceStateValue"
label="设备状态"> </el-table-column> label="设备状态"> </el-table-column>
<el-table-column prop="updateTime" <el-table-column prop="createTime"
label="下单时间"> </el-table-column> label="下单时间"> </el-table-column>
<el-table-column fixed="right" <el-table-column fixed="right"
label="操作" label="操作"
width="120"> width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 编辑 --> <!-- 编辑 -->
<el-button type="text" <el-button type="text"
style="font-size: 14px; margin-left: 0px" style="font-size: 14px; margin-left: 0px"
@click="detils(scope.row.openId)">查看详情</el-button> @click="detils(scope.row.orderNum)">查看详情</el-button>
<el-button type="text"
v-if="scope.row.deviceState == 1"
style="font-size: 14px; margin-left: 10px"
@click="enable(scope.row.orderNum)">启用</el-button>
<el-button type="text" <el-button type="text"
v-if="scope.row.deviceState == 0"
style="font-size: 14px; margin-left: 10px;color:red"
@click="disable(scope.row.orderNum)">停用</el-button>
<el-button type="text"
v-if="scope.row.bindNum == 0"
style="font-size: 14px; margin-left: 10px;color:red"
@click="deleteOrder(scope.row.orderNum)">作废</el-button>
<!-- <el-button type="text"
style="font-size: 14px; margin-left: 10px" style="font-size: 14px; margin-left: 10px"
@click="enable(scope.row.openId)">编辑</el-button> @click="enable(scope.row.openId)">编辑</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
...@@ -133,10 +139,12 @@ ...@@ -133,10 +139,12 @@
import { import {
getProduct, getProduct,
getProductType, getProductType,
getAllModel, purchaseOrderFind,
getAllOrder, getPurchaseOrderPaymentModel,
getPaymentModel, getPurchaseOrderProductionState,
getproductionState, purchaseOrderEnableCar,
purchaseOrderDisableCar,
purchaseOrderDelete,
} from "@/libs/common/constant"; } from "@/libs/common/constant";
import { selectListALL } from "@/utils/json"; import { selectListALL } from "@/utils/json";
export default { export default {
...@@ -148,9 +156,8 @@ export default { ...@@ -148,9 +156,8 @@ export default {
productType: "", productType: "",
productModel: "", productModel: "",
paymentModel: "", paymentModel: "",
productionStatus: "", productionState: "",
}, },
dataList: [], dataList: [],
searchCriteria: { searchCriteria: {
pageNow: 1, pageNow: 1,
...@@ -162,11 +169,7 @@ export default { ...@@ -162,11 +169,7 @@ export default {
isLoadProvinceId: true, isLoadProvinceId: true,
// 产品 类型 // 产品 类型
typeList: [], typeList: [],
// 产品 型号
allModelList: [],
// 付费 模式
paymentModelList: [], paymentModelList: [],
// 生产 状态
productionStateList: [], productionStateList: [],
determineQueryData: {}, determineQueryData: {},
}; };
...@@ -178,12 +181,6 @@ export default { ...@@ -178,12 +181,6 @@ export default {
await this.queryData(); await this.queryData();
}, },
methods: { methods: {
async getAllModel() {
const res = await this.$api.GET(
`${getAllModel.url}${this.conditionCollection.productType}`
);
this.allModelList = this.selectListALL(res);
},
// 查询 // 查询
async queryData() { async queryData() {
this.determineQueryData = this.conditionCollection; this.determineQueryData = this.conditionCollection;
...@@ -201,19 +198,19 @@ export default { ...@@ -201,19 +198,19 @@ export default {
}, },
// 获取 列表 参数 // 获取 列表 参数
async getListData(data) { async getListData(data) {
console.log(data,'搜索条件')
this.loadings = true; this.loadings = true;
const dataList = await this.getAllOrder(data); const dataList = await this.purchaseOrderFind(data);
console.log(dataList); console.log(dataList);
this.total = dataList.total; this.total = dataList.total;
this.dataList = dataList.list; this.dataList = dataList.list;
this.loadings = false; this.loadings = false;
}, },
async getAllOrder(data) { async purchaseOrderFind(data) {
const res = await this.$api.GET(`${getAllOrder.url}`, data); const res = await this.$api.GET(`${purchaseOrderFind.url}`, data);
return res; return res;
}, },
async pagingEvent() { async pagingEvent() {
// await this.queryData(); // await this.queryData();
var data = this.determineQueryData; var data = this.determineQueryData;
...@@ -222,15 +219,27 @@ export default { ...@@ -222,15 +219,27 @@ export default {
await this.getListData(data); await this.getListData(data);
}, },
// 添加 产品
addBusiness() {
this.$router.push({
path: "/addpurchaseOrder",
});
},
// 查看详情
detils(openId) {
this.$router.push({
path: `/purchaseOrderDetails/${openId}`,
});
},
selectListALL(myJson) { selectListALL(myJson) {
return selectListALL(myJson); return selectListALL(myJson);
}, },
// 获取 常量 // 获取 常量
async getConstant() { async getConstant() {
await this.getProductType(); await this.getProductType();
await this.getPaymentModel(); await this.getPurchaseOrderPaymentModel();
await this.getproductionState(); await this.getPurchaseOrderProductionState();
}, },
// 获取 产品类型 // 获取 产品类型
...@@ -238,35 +247,105 @@ export default { ...@@ -238,35 +247,105 @@ export default {
const res = await this.$api.GET(`${getProductType.url}`); const res = await this.$api.GET(`${getProductType.url}`);
this.typeList = this.selectListALL(res); this.typeList = this.selectListALL(res);
}, },
// 获取 付费模式 async getPurchaseOrderPaymentModel() {
async getPaymentModel() { const res = await this.$api.GET(`${getPurchaseOrderPaymentModel.url}`);
const res = await this.$api.GET(`${getPaymentModel.url}`);
this.paymentModelList = this.selectListALL(res); this.paymentModelList = this.selectListALL(res);
}, },
// 获取 生产 状态 async getPurchaseOrderProductionState() {
async getproductionState() { const res = await this.$api.GET(`${getPurchaseOrderProductionState.url}`);
const res = await this.$api.GET(`${getproductionState.url}`);
this.productionStateList = this.selectListALL(res); this.productionStateList = this.selectListALL(res);
console.log(this.productionStateList);
}, },
// 添加 产品 async disable(orderNum) {
addPurchaseOrder() { this.$confirm("确认禁用此采购单所有设备吗?", "提示", {
this.$router.push({ confirmButtonText: "确定",
path: "/addPurchaseOrder", cancelButtonText: "取消",
// type: 'warning',
customClass: "custom-confirm",
})
.then(() => {
this.purchaseOrderDisableCar(orderNum);
})
.catch(() => {
this.$message({
type: "info",
message: "已取消禁用!",
});
}); });
}, },
// 编辑产品 // 禁用 采购单下所有车辆
async enable(openId) { async purchaseOrderDisableCar(orderNum) {
this.$router.push({ const res = await this.$api.POST(
path: `/editProduct/${openId}`, `${purchaseOrderDisableCar.url}${orderNum}`
);
console.log(res);
await this.queryData();
this.$message({
type: "success",
message: "禁用成功!",
}); });
}, },
// 查看详情 enable(orderNum) {
detils(openId) { this.$confirm("确认启用此采购单所有设备吗?", "提示", {
this.$router.push({ confirmButtonText: "确定",
path: `/detailsBusiness/${openId}`, cancelButtonText: "取消",
// type: 'warning',
customClass: "custom-confirm",
})
.then(() => {
this.purchaseOrderEnableCar(orderNum);
})
.catch(() => {
this.$message({
type: "info",
message: "已停止启用!",
});
});
},
// 启用 采购单下所有车辆
async purchaseOrderEnableCar(orderNum) {
const res = await this.$api.POST(
`${purchaseOrderEnableCar.url}${orderNum}`
);
console.log(res);
await this.queryData();
this.$message({
type: "success",
message: "启用成功!",
});
},
deleteOrder(orderNum) {
this.$confirm("确认作废此采购单吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
// type: 'warning',
customClass: "custom-confirm",
})
.then(() => {
this.purchaseOrderDelete(orderNum);
})
.catch(() => {
this.$message({
type: "info",
message: "已停止作废!",
});
});
},
// 作废 采购单 purchaseOrderDelete
async purchaseOrderDelete(orderNum) {
const res = await this.$api.POST(`${purchaseOrderDelete.url}${orderNum}`);
console.log(res);
await this.queryData();
this.$message({
type: "success",
message: "作废成功!",
}); });
}, },
// 编辑产品
// async enable(openId) {
// this.$router.push({
// path: `/editProduct/${openId}`,
// });
// },
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment