This commit is contained in:
shilixia 2022-02-25 10:12:06 +08:00
parent bd2643b1c5
commit 5bfa72f716
5 changed files with 313 additions and 206 deletions

View File

@ -203,3 +203,11 @@ export function notPackremark(id, data) {
data data
}) })
} }
//物流图片上传
export function ship(id, data) {
return request({
url: `/sam/sale/${id}/up_ship/`,
method: 'POST',
data
})
}

View File

@ -36,7 +36,7 @@
}}</template> }}</template>
</el-table-column> </el-table-column>
<el-table-column label="入库数量"> <el-table-column label="入库数量">
<template slot-scope="scope">{{ scope.row.count }}</template> <template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否需要复验" v-if="this.$route.params.pu_order!=null"> <el-table-column label="是否需要复验" v-if="this.$route.params.pu_order!=null">

View File

@ -69,6 +69,13 @@
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="销售状态">
<template slot-scope="scope">{{state_[scope.row.state]}}</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="220px"> <!-- <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
@ -181,6 +188,12 @@
mtestform: { mtestform: {
is_mtestok: false, is_mtestok: false,
}, },
state_: {
10: "可出售",
20: "销售锁定",
30: "已售出",
},
form1: {}, form1: {},
dialogFormVisibleorder: false, dialogFormVisibleorder: false,
orderList: [], orderList: [],

View File

@ -159,6 +159,8 @@
v-model="sale.customer" v-model="sale.customer"
@change="selectcustomer" @change="selectcustomer"
placeholder="请选择" placeholder="请选择"
:disabled="show"
> >
<el-option <el-option
v-for="item in customeroptions" v-for="item in customeroptions"
@ -170,15 +172,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关联合同" prop="contract"> <el-form-item label="关联合同" prop="contract">
<el-input v-model="sale.contract" placeholder="关联合同" /> <el-input v-model="sale.contract" placeholder="关联合同" :disabled="edit"/>
</el-form-item> </el-form-item>
<el-form-item label="所需产品" prop="product"> <el-form-item label="所需产品" prop="product">
<el-select <el-select
:disabled="show"
style="width: 100%" style="width: 100%"
v-model="sale.product" v-model="sale.product"
@change="selectproduct" @change="selectproduct"
placeholder="请选择" placeholder="请选择"
ref="btn"
> >
<el-option <el-option
v-for="item in materialoptions" v-for="item in materialoptions"
@ -328,6 +332,8 @@ export default {
materialoptions: [], materialoptions: [],
iproductoptions: [], iproductoptions: [],
dialogVisible: false, dialogVisible: false,
show:false,
edit:true,
dialogType: "new", dialogType: "new",
options: [ options: [
{ {
@ -375,9 +381,12 @@ export default {
//选择订单变化 //选择订单变化
selectorder(selval) { selectorder(selval) {
getOrder(selval).then((response) => { getOrder(selval).then((response) => {
if (response.data) { if (response.data) {
this.show=true;
this.sale.customer = response.data.customer; this.sale.customer = response.data.customer;
this.sale.product = response.data.product; this.sale.product = response.data.product;
this.sale.contract = response.data.contract_.name; this.sale.contract = response.data.contract_.name;
this.sale.receiver = response.data.customer_.contact; this.sale.receiver = response.data.customer_.contact;
@ -540,13 +549,25 @@ export default {
//审核 //审核
handleAudit(scope) { handleAudit(scope) {
saleAudit(scope.row.id).then((res) => {
if (res.code >= 200) { this.$confirm("确认审核?", "提示", {
this.$message.success("审核成功成功"); confirmButtonText: "确认",
cancelButtonText: "取消",
type: "success",
})
.then(async () => {
await saleAudit(scope.row.id);
this.getList(); this.getList();
} this.$message.success("审核成功!");
})
.catch((err) => {
console.error(err);
}); });
}, },
}, },
}; };
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-descriptions title="基本信息" direction="vertical" :column="8" border> <el-descriptions title="基本信息" direction="vertical" :column="6" border>
<el-descriptions-item label="客户名称" v-if="salesdetail.customer"> <el-descriptions-item label="客户名称" v-if="salesdetail.customer">
{{ salesdetail.customer_.name }}</el-descriptions-item {{ salesdetail.customer_.name }}</el-descriptions-item
> >
@ -15,13 +15,21 @@
> >
{{ salesdetail.product_.specification }}</el-descriptions-item {{ salesdetail.product_.specification }}</el-descriptions-item
> >
<el-descriptions-item label="订单编号" v-if="salesdetail.order">
{{ salesdetail.order_.number }}
</el-descriptions-item>
<el-descriptions-item label="合同名称" v-if="salesdetail.order"> <el-descriptions-item label="合同名称" v-if="salesdetail.order">
{{ salesdetail.order_.contract_.name }}</el-descriptions-item {{ salesdetail.order_.contract_.name }}</el-descriptions-item
> >
<el-descriptions-item label="合同编号" v-if="salesdetail.order">
{{ salesdetail.order_.contract_.number }}</el-descriptions-item
>
<el-descriptions-item label="订单编号" v-if="salesdetail.order">
{{ salesdetail.order_.number }}
</el-descriptions-item>
<el-descriptions-item label="物流详情" v-if="ship_pic!=''">
<el-link :href="salesdetail.ship_pic">物流单</el-link></el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-button type="primary" style="margin-top:10px" @click="upload">上传物流信息</el-button>
</el-card>
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>关联产品信息</span> <span>关联产品信息</span>
@ -95,7 +103,39 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisibless"
title="上传物流文件"
>
<el-form
ref="Forms"
:model="ship"
label-width="100px"
label-position="right"
:rules="rule1"
>
<el-form-item label="文件" prop="template" >
<el-upload
ref="upload"
:action="upUrl"
:on-preview="handlePreview"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept="webp,bmp,jpg,png,tif,gif,apng"
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisibless = false">取消</el-button>
<el-button type="primary" @click="uploadship">确认</el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -122,7 +162,6 @@
ref="multipleTable" ref="multipleTable"
height="300" height="300"
> >
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" label="序号" /> <el-table-column type="index" width="50" label="序号" />
<el-table-column label="名称"> <el-table-column label="名称">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
@ -130,7 +169,7 @@
<el-table-column label="单位"> <el-table-column label="单位">
<template slot-scope="scope">{{ scope.row.unit }}</template> <template slot-scope="scope">{{ scope.row.unit }}</template>
</el-table-column> </el-table-column>
<el-table-column label="数量"> <el-table-column label="数量" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form :model="scope.row"> <el-form :model="scope.row">
<el-form-item size="mini"> <el-form-item size="mini">
@ -178,8 +217,6 @@
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="notpackData.remark" placeholder="未装箱备注" /> <el-input v-model="notpackData.remark" placeholder="未装箱备注" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisibles = false" <el-button type="danger" @click="dialogVisibles = false"
@ -189,7 +226,6 @@
</div> </div>
</el-dialog> </el-dialog>
</el-card> </el-card>
</el-card>
</div> </div>
</template> </template>
<script> <script>
@ -200,14 +236,15 @@ import {
gePack, gePack,
subPack, subPack,
notPackremark, notPackremark,
ship
} from "@/api/sam"; } from "@/api/sam";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { upUrl, upHeaders } from "@/api/file";
import { genTree } from "@/utils"; import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultepackData = { const defaultepackData = {
packnum: "" packnum: "",
} };
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
@ -215,11 +252,16 @@ export default {
salesdetail: "", salesdetail: "",
saleproduct: "", saleproduct: "",
packlist: [], packlist: [],
upHeaders: upHeaders(),
upUrl: upUrl(),
dialogVisible: false, dialogVisible: false,
dialogVisibles: false, dialogVisibles: false,
dialogVisibless: false,
ship:{},
packData: defaultepackData, packData: defaultepackData,
notpackData: { remark: "" }, notpackData: { remark: "" },
detail: [], detail: [],
fileList:[],
saleproductId: null, saleproductId: null,
saleProductid: null, saleProductid: null,
dialogType: "new", dialogType: "new",
@ -243,6 +285,39 @@ export default {
} }
}); });
}, },
//上传物流文件
handlePreview(file) {
if ("url" in file) {
window.open(file.url);
} else {
window.open(file.response.data.path);
}
},
handleUpSuccess(res, file, filelist) {
this.ship.path = res.data.path;
console.log(this.ship.path)
},
handleRemove(file, filelist){
this.ship.path = null;
},
upload() {
this.dialogVisibless=true;
},
uploadship()
{
console.log(this.ship);
ship(this.id, this.ship).then((res) => {
if (res.code >= 200) {
this.dialogVisibless = false;
this.$message.success("物流文件上传成功!");
}
});
},
getSaleproductLists() { getSaleproductLists() {
getSaleproductList({ sale: this.id, page: 0 }).then((response) => { getSaleproductList({ sale: this.id, page: 0 }).then((response) => {
@ -273,7 +348,6 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
gePack(scope.row.id).then((response) => { gePack(scope.row.id).then((response) => {
if (response.data) { if (response.data) {
@ -285,14 +359,8 @@ export default {
}, },
submitPack() { submitPack() {
this.$refs.multipleTable.selection.forEach((item) => { this.packData.detail = this.packlist;
this.detail.push({ console.log(this.packData);
id: item.id,
count: item.count,
});
});
console.log( this.detail);
this.packData.detail = this.detail;
subPack(this.saleproductId, this.packData).then((res) => { subPack(this.saleproductId, this.packData).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getSaleproductLists(); this.getSaleproductLists();
@ -302,14 +370,11 @@ export default {
}); });
}, },
//未装箱备注 //未装箱备注
handleNotPack(scope) handleNotPack(scope) {
{
this.dialogVisibles = true; this.dialogVisibles = true;
this.saleProductid = scope.row.id; this.saleProductid = scope.row.id;
} },
, submitnotPack() {
submitnotPack()
{
notPackremark(this.saleProductid, this.notpackData).then((res) => { notPackremark(this.saleProductid, this.notpackData).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getSaleproductLists(); this.getSaleproductLists();
@ -317,7 +382,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
} }
}); });
} },
}, },
}; };
</script> </script>