Commit 3f76ebf7 authored by 张宗旭's avatar 张宗旭

提交

parent d0fcebdc
......@@ -34,53 +34,18 @@ export const addProduct = {
}
// 获取 一条 产品
export const getOneProduct = {
url:'/api/product/get/one/openId/'
url: '/api/product/get/one/openId/'
}
// 编辑 产品
export const editProduct = {
url:'/api/product/update'
url: '/api/product/update'
}
// 供应商
// 新增供应商
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 getAllOrder = {
url: '/api/purchase/order/find/page'
}
// 常量
// 客户 性质
export const getCustomerNature = {
......@@ -94,3 +59,15 @@ export const getCustomerType = {
export const getProductType = {
url: '/constant/get/product/type'
}
// 通过 产品类型 获取 产品型号
export const getAllModel = {
url: '/api/product/get/all/model/'
}
// 付费 模式
export const getPaymentModel = {
url: '/constant/get/purchaseOrder/paymentModel'
}
// 生产 状态
export const getproductionState = {
url: '/constant/get/purchaseOrder/productionState'
}
\ No newline at end of file
......@@ -90,6 +90,17 @@ const frameIn = [
},
component: _import('purchaseOrder/list/index')
},
// 添加 采购单
{
path: 'addPurchaseOrder',
name: 'addPurchaseOrder',
meta: {
title: '添加采购单',
auth: true
},
component: _import('purchaseOrder/add/index')
},
// 商家 列表
{
path: 'businessList',
......
......@@ -150,9 +150,6 @@ export default {
this.$refs[detail].validate(async (valid) => {
if (valid) {
try {
// 提交前 处理 数据
// 拼接 营业时间 转换 时间
// var data = await this.arrangeData();
// 判断 参数 确定是修改还是 添加
if (this.editId) {
console.log(this.form, "编辑提交的参数");
......
<template>
<d2-container v-loading="isLoading">
<div class="addHouser-container">
<el-form :model="form"
label-width="120px"
ref="form"
:rules="rules">
<el-form-item label="客户名称:"
prop="name">
<el-input v-model="form.name"
placeholder="请填写"
autocomplete="off"
maxlength="50"
:show-word-limit="true"
class="filter-item-same-width" />
</el-form-item>
<div>
<el-form-item label="产品类型:"
prop="type">
<el-select v-model="form.type"
placeholder="请选择"
class="filter-item-same-width">
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
添加采购单
</div>
<el-form-item label="产品型号:"
prop="model">
<el-input v-model="form.model"
placeholder="请填写"
autocomplete="off"
maxlength="30"
:show-word-limit="true"
class="filter-item-same-width" />
</el-form-item>
<el-form-item label="搜索前缀:"
prop="">
<el-input v-model="form.searchPrefix"
placeholder="请填写"
autocomplete="off"
maxlength="30"
:show-word-limit="true"
class="filter-item-same-width" />
</el-form-item>
<el-form-item label="备注:"
prop="">
<el-input v-model="form.remark"
placeholder="请填写"
autocomplete="off"
maxlength="30"
:show-word-limit="true"
class="filter-item-same-width" />
</el-form-item>
</el-form>
</div>
<span slot="footer"
class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary"
style="margin-left: 150px"
:loading="ifSubmit"
@click="submit('form')">保存</el-button>
</span>
</d2-container>
</template>
<script>
import { mapState, mapActions } from "vuex";
import {
addProduct,
getProductType,
getOneProduct,
editProduct
} from "@/libs/common/constant";
import { selectList, generateTiemList, weekList } from "@/utils/json";
import dayjs from "dayjs";
export default {
data() {
return {
isLoading: false,
form: {
name: "",
type: "",
model: "",
searchPrefix: "",
remark: "",
},
ifSubmit: false,
typeList: [],
// 编辑
editId: this.$route.params.id,
rules: {
name: [{ required: true, message: "请填写", trigger: "blur" }],
model: [{ required: true, message: "请填写", trigger: "blur" }],
type: [{ required: true, message: "请选择", trigger: "change" }],
},
};
},
async created() {
// 获取 字典 数据
await this.getConstant();
if (this.editId) {
// 传过来 openid 获取 详情
this.isLoading = true;
await this.getOneProduct(this.editId);
}
},
computed: {
// 获取 此页面 路径
...mapState("d2admin/page", ["current"]),
},
methods: {
...mapActions("d2admin/page", ["close", "add"]),
// 获取 字典数据
async getConstant() {
await this.getProductType();
},
selectList(myJson, a) {
return selectList(myJson, a);
},
weekLista() {
return weekList;
},
generateTiemList() {
return generateTiemList();
},
// 获取 产品 类型
async getProductType() {
const res = await this.$api.GET(`${getProductType.url}`);
this.typeList = this.selectList(res);
},
async cancel() {
var tagName = this.current;
await this.close({ tagName });
this.$router.push("/productList");
},
submit(detail) {
}
if (this.ifSubmit) {
return;
}
this.ifSubmit = true;
this.$refs[detail].validate(async (valid) => {
if (valid) {
try {
// 提交前 处理 数据
// 拼接 营业时间 转换 时间
// var data = await this.arrangeData();
// 判断 参数 确定是修改还是 添加
if (this.editId) {
console.log(this.form, "编辑提交的参数");
// 提交接口
this.form.openId = this.editId;
const res = await this.$api.POST(`${editProduct.url}`, this.form);
} else {
console.log(this.form, "添加提交的参数");
// 提交 接口
await this.addProduct(this.form);
}
await this.cancel();
this.$message({
type: "success",
message: "操作成功!",
});
} catch (error) {}
} else {
console.log("error submit!!");
this.ifSubmit = false;
return false;
}
});
},
// 添加 产品
async addProduct(data) {
const res = await this.$api.POST(`${addProduct.url}`, data);
console.log(res, "添加产品接口成功的返回");
},
// 编辑
// 获取 详情
async getOneProduct(openId) {
const res = await this.$api.GET(`${getOneProduct.url}${openId}`);
console.log(res);
this.form = res
this.isLoading = false;
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<style lang="scss" scoped>
</style>
<template>
<div>采购单列表</div>
<d2-container>
<div class="providerOrderList-container">
<div class="filter-box">
<div class="filter-item">
<div class="spana">客户名称:</div>
<el-input v-model="conditionCollection.customerName"
placeholder="请输入"></el-input>
</div>
<div class="filter-item">
<div class="spana">采购单号:</div>
<el-input v-model="conditionCollection.orderNum"
placeholder="请输入"></el-input>
</div>
<div class="filter-item">
<div class="spana">产品类型:</div>
<el-select v-model="conditionCollection.productType"
@change="getAllModel"
placeholder="全部">
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter-item">
<div class="spana">产品型号:</div>
<el-select v-model="conditionCollection.productModel"
placeholder="全部">
<el-option v-for="item in allModelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter-item">
<div class="spana">付费模式:</div>
<el-select v-model="conditionCollection.paymentModel"
placeholder="全部">
<el-option v-for="item in paymentModelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter-item">
<div class="spana">生产状态:</div>
<el-select v-model="conditionCollection.productionStatus"
placeholder="全部">
<el-option v-for="item in productionStateList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter-btn">
<el-button type="primary"
size=""
@click="queryData()">查询</el-button>
<el-button type=""
size=""
@click="reset()">重置</el-button>
<el-button type="success"
icon="el-icon-circle-plus-outline"
@click="addPurchaseOrder()">新建采购单</el-button>
</div>
</div>
<div>
<el-table :data="dataList"
size="medium"
style="width: 100%; text-align: center;"
:key="tablekey"
v-loading="loadings">
<!-- <el-table-column prop="userCode" label="序号"> </el-table-column> -->
<el-table-column prop="id"
label="序号"> </el-table-column>
<el-table-column prop="orderNum"
label="采购单号"></el-table-column>
<el-table-column prop="customerOpenId"
label="客户名称"> </el-table-column>
<el-table-column prop="productName"
label="产品名称"> </el-table-column>
<el-table-column prop="productTypeValue"
label="产品类型"></el-table-column>
<el-table-column prop="productModel"
label="产品型号"> </el-table-column>
<el-table-column prop="plannedPurchase"
label="计划采购量"> </el-table-column>
<el-table-column prop="paymentModelValue"
label="付费模式"> </el-table-column>
<el-table-column prop="bindNum"
label="入库数量"> </el-table-column>
<el-table-column prop="productionStateValue"
label="生产状态"> </el-table-column>
<el-table-column prop="deviceStateValue"
label="设备状态"> </el-table-column>
<el-table-column prop="updateTime"
label="下单时间"> </el-table-column>
<el-table-column fixed="right"
label="操作"
width="120">
<template slot-scope="scope">
<!-- 编辑 -->
<el-button type="text"
style="font-size: 14px; margin-left: 0px"
@click="detils(scope.row.openId)">查看详情</el-button>
<el-button type="text"
style="font-size: 14px; margin-left: 10px"
@click="enable(scope.row.openId)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<pagination v-show="total >= 0"
:total="total"
:page.sync="searchCriteria.pageNow"
:limit.sync="searchCriteria.pageSize"
@pagination="pagingEvent" />
</div>
</div>
</d2-container>
</template>
<script>
export default {};
import {
getProduct,
getProductType,
getAllModel,
getAllOrder,
getPaymentModel,
getproductionState,
} from "@/libs/common/constant";
import { selectListALL } from "@/utils/json";
export default {
data() {
return {
conditionCollection: {
customerName: "",
orderNum: "",
productType: "",
productModel: "",
paymentModel: "",
productionStatus: "",
},
dataList: [],
searchCriteria: {
pageNow: 1,
pageSize: 10,
},
total: 0,
tablekey: "",
loadings: true,
isLoadProvinceId: true,
// 产品 类型
typeList: [],
// 产品 型号
allModelList: [],
// 付费 模式
paymentModelList: [],
// 生产 状态
productionStateList: [],
determineQueryData: {},
};
},
async created() {
// 获取 字典 数据
await this.getConstant();
// 获取 初始 数据
await this.queryData();
},
methods: {
async getAllModel() {
const res = await this.$api.GET(
`${getAllModel.url}${this.conditionCollection.productType}`
);
this.allModelList = this.selectListALL(res);
},
// 查询
async queryData() {
this.determineQueryData = this.conditionCollection;
var data = this.conditionCollection;
data.currentPage = this.searchCriteria.pageNow;
data.pageSize = this.searchCriteria.pageSize;
await this.getListData(data);
},
// 重置
reset() {
var obj = this.conditionCollection;
for (const key in obj) {
obj[key] = "";
}
},
// 获取 列表 参数
async getListData(data) {
console.log(data,'搜索条件')
this.loadings = true;
const dataList = await this.getAllOrder(data);
console.log(dataList);
this.total = dataList.total;
this.dataList = dataList.list;
this.loadings = false;
},
async getAllOrder(data) {
const res = await this.$api.GET(`${getAllOrder.url}`, data);
return res;
},
async pagingEvent() {
// await this.queryData();
var data = this.determineQueryData;
data.currentPage = this.searchCriteria.pageNow;
data.pageSize = this.searchCriteria.pageSize;
await this.getListData(data);
},
selectListALL(myJson) {
return selectListALL(myJson);
},
// 获取 常量
async getConstant() {
await this.getProductType();
await this.getPaymentModel();
await this.getproductionState();
},
// 获取 产品类型
async getProductType() {
const res = await this.$api.GET(`${getProductType.url}`);
this.typeList = this.selectListALL(res);
},
// 获取 付费模式
async getPaymentModel() {
const res = await this.$api.GET(`${getPaymentModel.url}`);
this.paymentModelList = this.selectListALL(res);
},
// 获取 生产 状态
async getproductionState() {
const res = await this.$api.GET(`${getproductionState.url}`);
this.productionStateList = this.selectListALL(res);
console.log(this.productionStateList);
},
// 添加 产品
addPurchaseOrder() {
this.$router.push({
path: "/addPurchaseOrder",
});
},
// 编辑产品
async enable(openId) {
this.$router.push({
path: `/editProduct/${openId}`,
});
},
// 查看详情
detils(openId) {
this.$router.push({
path: `/detailsBusiness/${openId}`,
});
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<style lang="scss" scoped>
</style>
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