|
@@ -51,12 +51,12 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="工程项目名称" prop="enginName">
|
|
|
- <el-input v-model="mainForm.enginName" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.enginName" placeholder="请输入工程项目名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="工程登录类型" prop="loginType">
|
|
|
- <el-input v-model="mainForm.loginType" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.loginType" placeholder="请输入工程登录类型"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
@@ -66,34 +66,34 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="使用单位" prop="company">
|
|
|
- <el-input v-model="mainForm.company" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.company" placeholder="请输入使用单位"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="销售类型" prop="saleType">
|
|
|
- <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
|
|
|
+ <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
|
|
|
<el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="联系人" prop="contactMan">
|
|
|
- <el-input v-model="mainForm.contactMan" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.contactMan" placeholder="请输入联系人"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="固定电话" prop="tel">
|
|
|
- <el-input v-model="mainForm.tel" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.tel" placeholder="请输入固定电话"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
|
<el-form-item label="移动电话" prop="phone">
|
|
|
- <el-input v-model="mainForm.phone" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.phone" placeholder="请输入移动电话"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="24" :lg="24">
|
|
|
<el-form-item label="安装地址" prop="address">
|
|
|
- <el-input v-model="mainForm.address" placeholder="请选择工程登录" readonly></el-input>
|
|
|
+ <el-input v-model="mainForm.address" placeholder="请输入安装地址"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="24" :lg="24">
|
|
@@ -149,27 +149,77 @@
|
|
|
<div class="table" style="margin-top: 20px">
|
|
|
<el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
|
<el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
|
- <el-table-column align="center" label="引用记录" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="销售类型" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="产品编码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="物料代码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="产品名称" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="规格型号" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="单位" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="单价" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="工程登录数量" prop="qty" min-width="120" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="订单金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="返利类型" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="使用返利金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="格力折扣" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="现金钱包" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="是否直调" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="直调数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="已发货数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="备注" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="税率" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.qty" size="small"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.price * scope.row.qty}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="返利钱包" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利钱包" size="small" clearable @change="changeFlWallet(scope.$index)">
|
|
|
+ <el-option
|
|
|
+ v-for="item in flWalletList"
|
|
|
+ :key="item.customerWalletId"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.customerWalletId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.qty * scope.row.discAmount}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
|
|
|
+ <el-option
|
|
|
+ v-for="item in xjWalletList"
|
|
|
+ :key="item.customerWalletId"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.customerWalletId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.directTransferQty" size="small"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<div>{{ scope.row.status1 | status1Filter }}</div>
|
|
@@ -190,8 +240,8 @@
|
|
|
|
|
|
<div class="page-footer">
|
|
|
<div class="footer" :class="classObj">
|
|
|
- <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
|
|
|
- <el-button type="primary" @click="clickSubmitForm">提交审核</el-button>
|
|
|
+ <el-button type="primary" @click="clickSubmitForm(1)">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>
|
|
|
<el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
|
|
|
<el-button slot="reference">关 闭</el-button>
|
|
|
</el-popconfirm>
|
|
@@ -267,7 +317,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, checkStock } from "@/api/supply/engin";
|
|
|
+import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, submitHome, checkStock, getWalletList } from "@/api/supply/engin";
|
|
|
import { getDictList, getTypeList } from '@/api/common'
|
|
|
|
|
|
export default {
|
|
@@ -285,7 +335,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- detailData: {},
|
|
|
+ editId: '',
|
|
|
mainForm: {
|
|
|
orderNum: '',
|
|
|
orderDate: '',
|
|
@@ -317,9 +367,10 @@ export default {
|
|
|
enginName: [{ required: true, message: '请输入工程项目名称', trigger: 'blur' }],
|
|
|
loginType: [{ required: true, message: '请输入工程登录类型', trigger: 'blur' }],
|
|
|
company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
|
|
|
- contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
- tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
|
|
|
- phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
|
|
|
+ saleType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
|
|
|
+ // contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
+ // tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
|
|
|
+ // phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
|
|
|
address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
|
|
|
},
|
|
|
salesTypeList: [],
|
|
@@ -340,6 +391,9 @@ export default {
|
|
|
|
|
|
warehouseList: [],
|
|
|
warehouseValue: '',
|
|
|
+
|
|
|
+ xjWalletList: [],
|
|
|
+ flWalletList: [],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -357,10 +411,12 @@ export default {
|
|
|
|
|
|
created() {
|
|
|
this.getDictList();
|
|
|
+ this.getWalletList();
|
|
|
this.getSalesTypeList();
|
|
|
this.getWarehouseList();
|
|
|
|
|
|
if(this.listItem) {
|
|
|
+ this.editId = this.listItem.parentId;
|
|
|
this.getDetail();
|
|
|
}else {
|
|
|
this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
|
|
@@ -392,6 +448,22 @@ export default {
|
|
|
return currentdate;
|
|
|
},
|
|
|
|
|
|
+ // 获取钱包列表
|
|
|
+ getWalletList() {
|
|
|
+ getWalletList({
|
|
|
+ customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
+ type: 'COMMONLY'
|
|
|
+ }).then(res => {
|
|
|
+ this.xjWalletList = res.data;
|
|
|
+ })
|
|
|
+ getWalletList({
|
|
|
+ customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
+ type: 'REBATE'
|
|
|
+ }).then(res => {
|
|
|
+ this.flWalletList = res.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 获取产品大类列表
|
|
|
getDictList() {
|
|
|
getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
|
|
@@ -421,8 +493,35 @@ export default {
|
|
|
|
|
|
// 获取详情
|
|
|
getDetail() {
|
|
|
- getOrderDetail({id: this.listItem.id}).then(res => {
|
|
|
- this.detailData = res.data;
|
|
|
+ getOrderDetail({id: this.editId}).then(res => {
|
|
|
+ let data = res.data;
|
|
|
+ this.mainForm.orderNum = data.enginOrderId;
|
|
|
+ this.mainForm.orderDate = data.orderDate;
|
|
|
+ this.mainForm.type = data.refProductCategory;
|
|
|
+ this.mainForm.jxsNum = data.customerId;
|
|
|
+ this.mainForm.jxsName = data.customerName;
|
|
|
+ this.mainForm.loginNum = data.refEnginRecordNo;
|
|
|
+ this.mainForm.enginName = data.refProjectName;
|
|
|
+ this.mainForm.loginType = data.refPromiseStatus;
|
|
|
+ this.mainForm.factoryNum = data.refFactoryNo;
|
|
|
+ this.mainForm.company = data.refUseUnit;
|
|
|
+ this.mainForm.saleType = data.saleTypeId;
|
|
|
+ this.mainForm.contactMan = data.aaa;
|
|
|
+ this.mainForm.tel = data.aaa;
|
|
|
+ this.mainForm.phone = data.aaa;
|
|
|
+ this.mainForm.address = data.refInstallAddress;
|
|
|
+ this.mainForm.greeRemark = data.note2;
|
|
|
+ this.mainForm.greeReply = data.note1;
|
|
|
+ this.mainForm.remark = data.remark;
|
|
|
+ this.mainForm.createMan = data.createName;
|
|
|
+ this.mainForm.createDate = data.createTime;
|
|
|
+ this.mainForm.fileNum = data.fileNo;
|
|
|
+
|
|
|
+ data.items.forEach(item => {
|
|
|
+ item.status1 = '';
|
|
|
+ item.status2 = '';
|
|
|
+ })
|
|
|
+ this.goodsList = data.items;
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -471,6 +570,18 @@ export default {
|
|
|
chooseItem(id) {
|
|
|
addHome({refEnginRecordNo: id}).then(res => {
|
|
|
this.isShowDialog = false;
|
|
|
+ this.editId = res.data;
|
|
|
+ this.getDetail();
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 选择销售类型
|
|
|
+ changeSaleType() {
|
|
|
+ let obj = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
|
|
|
+ this.goodsList.forEach(item => {
|
|
|
+ item.saleTypeId = obj.id;
|
|
|
+ item.saleTypeCode= obj.saleCode;
|
|
|
+ item.saleTypeName = obj.saleName;
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -479,6 +590,28 @@ export default {
|
|
|
this.goodsList.splice(index, 1);
|
|
|
},
|
|
|
|
|
|
+ // 修改返利钱包
|
|
|
+ changeFlWallet(index) {
|
|
|
+ if(this.goodsList[index].customerWalletId2) {
|
|
|
+ let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
|
|
|
+ this.goodsList[index].rebateRate = obj.rebateRate;
|
|
|
+ this.goodsList[index].customerWalletName2 = obj.name;
|
|
|
+ }else {
|
|
|
+ this.goodsList[index].rebateRate = '';
|
|
|
+ this.goodsList[index].customerWalletName2 = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 修改现金钱包
|
|
|
+ changeXjWallet(index) {
|
|
|
+ if(this.goodsList[index].customerWalletId) {
|
|
|
+ let obj = this.xjWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
|
|
|
+ this.goodsList[index].customerWalletName = obj.name;
|
|
|
+ }else {
|
|
|
+ this.goodsList[index].customerWalletName = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 检查库存
|
|
|
checkStock() {
|
|
|
if(!this.warehouseValue) {
|
|
@@ -510,9 +643,50 @@ export default {
|
|
|
else return '短缺';
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- clickSubmitForm() {
|
|
|
-
|
|
|
+ // 保存 / 提交审核
|
|
|
+ clickSubmitForm(type) {
|
|
|
+ this.$refs.mainForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
|
|
|
+ let params = {
|
|
|
+ enginOrderId: this.mainForm.orderNum,
|
|
|
+ orderDate: this.mainForm.orderDate,
|
|
|
+ refProductCategory: this.mainForm.type || '',
|
|
|
+ // customerId: this.mainForm.jxsNum,
|
|
|
+ // customerName: this.mainForm.jxsName,
|
|
|
+ refEnginRecordNo: this.mainForm.loginNum || '',
|
|
|
+ refProjectName: this.mainForm.enginName || '',
|
|
|
+ refPromiseStatus: this.mainForm.loginType || '',
|
|
|
+ refFactoryNo: this.mainForm.factoryNum || '',
|
|
|
+ refUseUnit: this.mainForm.company || '',
|
|
|
+ saleTypeId: this.mainForm.saleType,
|
|
|
+ saleTypeCode: saleTypeItem.saleCode,
|
|
|
+ saleTypeName: saleTypeItem.saleName,
|
|
|
+ // aaa: this.mainForm.contactMan,
|
|
|
+ // aaa: this.mainForm.tel,
|
|
|
+ // aaa: this.mainForm.phone,
|
|
|
+ refInstallAddress: this.mainForm.address || '',
|
|
|
+ note2: this.mainForm.greeRemark || '',
|
|
|
+ note1: this.mainForm.greeReply || '',
|
|
|
+ remark: this.mainForm.remark || '',
|
|
|
+ fileNo: this.mainForm.fileNum || '',
|
|
|
+ items: this.goodsList,
|
|
|
+ }
|
|
|
+ if(type === 1) {
|
|
|
+ editHome(params).then(res => {
|
|
|
+ this.$successMsg('编辑成功');
|
|
|
+ this.goBack();
|
|
|
+ this.$parent.getList();
|
|
|
+ })
|
|
|
+ }else if(type === 2) {
|
|
|
+ submitHome(params).then(res => {
|
|
|
+ this.$successMsg('提交审核成功');
|
|
|
+ this.goBack();
|
|
|
+ this.$parent.getList();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|