mirror of
https://github.com/shawncai/ERP.git
synced 2024-09-20 23:16:09 +08:00
销售出库单增加销售合同源单类型
销售出库单增加销售合同源单类型
This commit is contained in:
parent
73b62fae24
commit
4b024de309
|
@ -24,16 +24,16 @@ export function searchSaleCategory(query) {
|
|||
// 新增分类属性
|
||||
export function addSaleCategory(query) {
|
||||
var params = new URLSearchParams()
|
||||
if (query.categoryname !== '' && query.categoryname !== null) {
|
||||
if (query.categoryname !== '' && query.categoryname !== null && query.categoryname !== undefined) {
|
||||
params.append('categoryname', query.categoryname) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.category !== '' && query.category !== null) {
|
||||
if (query.category !== '' && query.category !== null && query.categoryname !== undefined) {
|
||||
params.append('category', query.category) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.iseffective !== '' && query.iseffective !== null) {
|
||||
if (query.iseffective !== '' && query.iseffective !== null && query.categoryname !== undefined) {
|
||||
params.append('iseffective', query.iseffective) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
if (query.type !== '' && query.type !== null) {
|
||||
if (query.type !== '' && query.type !== null && query.categoryname !== undefined) {
|
||||
params.append('type', query.type) // 你要传给后台的参数值 key/value
|
||||
}
|
||||
return request({
|
||||
|
|
|
@ -1477,6 +1477,7 @@ export default {
|
|||
isSale: '当前状态'
|
||||
},
|
||||
SaleContract: {
|
||||
customerType: '客户类型',
|
||||
title: '合同主题',
|
||||
sourceType: '源单类型',
|
||||
sourceNumber: '源单编号',
|
||||
|
|
|
@ -27,10 +27,19 @@
|
|||
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
|
||||
<my-installmentapply :installappleycontrol.sync = "installappleycontrol" @installappleyDetail="installappleyDetail" @installappley="installappley"/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleOut.customerType')" prop="customerType" style="width: 100%;">
|
||||
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
|
||||
<el-option value="1" label="经销商"/>
|
||||
<el-option value="2" label="零售"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleContract.customerName')" style="width: 100%;">
|
||||
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
|
||||
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
|
||||
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
@ -49,7 +58,11 @@
|
|||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleContract.closeType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.closeType" clearable style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="结算1"/>
|
||||
<el-option
|
||||
v-for="(item, index) in colseTypes"
|
||||
:value="item.id"
|
||||
:key="index"
|
||||
:label="item.categoryName"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -121,7 +134,12 @@
|
|||
<el-col :span="6">
|
||||
<el-form-item :label="$t('SaleContract.invoiceType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.invoiceType" clearable style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="增值税"/>
|
||||
<el-option
|
||||
v-for="(item, index) in invoiceTypes"
|
||||
:value="item.id"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -300,6 +318,7 @@
|
|||
import { createsaleContract } from '@/api/SaleContract'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import { searchSaleCategory } from '@/api/SaleCategory'
|
||||
import { searchCategory } from '@/api/Supplier'
|
||||
import MyEmp from './components/MyEmp'
|
||||
import MyDetail from './components/MyDetail'
|
||||
|
@ -310,9 +329,10 @@ import MyDelivery from './components/MyDelivery'
|
|||
import MyOpportunity from './components/MyOpportunity'
|
||||
import MyInstallmentapply from './components/MyInstallmentapply'
|
||||
import MyCustomer from '../SaleOpportunity/components/MyCustomer'
|
||||
import MyAgent from '../SaleOpportunity/components/MyAgent'
|
||||
export default {
|
||||
name: 'AddSaleContract',
|
||||
components: { MyCustomer, MyInstallmentapply, MyOpportunity, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
components: { MyAgent, MyCustomer, MyInstallmentapply, MyOpportunity, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(this.supplierId)
|
||||
|
@ -358,6 +378,24 @@ export default {
|
|||
return time.getTime() < new Date().getTime() - 8.64e7
|
||||
}
|
||||
},
|
||||
// 控制经销商
|
||||
agentcontrol: false,
|
||||
// 开票类别数据
|
||||
invoiceTypes: [],
|
||||
// 开票类别获取参数
|
||||
invoicetypeparms: {
|
||||
type: 4,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 结算方式数据
|
||||
colseTypes: [],
|
||||
// 结算方式获取参数
|
||||
colseTypeparms: {
|
||||
type: 3,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 是否可以编辑分期数据
|
||||
isinstallappley: false,
|
||||
// 回显客户
|
||||
|
@ -428,6 +466,9 @@ export default {
|
|||
},
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
customerType: [
|
||||
{ required: true, message: '请选择客户类别', trigger: 'change' }
|
||||
],
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
|
@ -462,15 +503,33 @@ export default {
|
|||
this.getways()
|
||||
},
|
||||
methods: {
|
||||
// 选择客户类型时清理客户名称
|
||||
clearCustomer() {
|
||||
this.personalForm.customerId = ''
|
||||
this.customerId = ''
|
||||
},
|
||||
// 选择客户focus
|
||||
chooseCustomer() {
|
||||
this.customercontrol = true
|
||||
this.$forceUpdate()
|
||||
if (this.personalForm.customerType === '1') {
|
||||
this.agentcontrol = true
|
||||
this.$forceUpdate()
|
||||
} else if (this.personalForm.customerType === '2') {
|
||||
this.customercontrol = true
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
customerdata(val) {
|
||||
this.personalForm.customerId = val.id
|
||||
this.customerId = val.customerName
|
||||
this.personalForm.customerPhone = val.phoneNumber
|
||||
},
|
||||
agentdata(val) {
|
||||
console.log(val)
|
||||
this.personalForm.customerId = val.id
|
||||
this.customerId = val.agentName
|
||||
this.personalForm.customerPhone = val.phone
|
||||
},
|
||||
clearfinal() {
|
||||
this.personalForm.installmentEndtime = null
|
||||
},
|
||||
|
@ -684,6 +743,18 @@ export default {
|
|||
this.depts = res.data.data.content
|
||||
}
|
||||
})
|
||||
// 开票类型数据
|
||||
searchSaleCategory(this.invoicetypeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.invoiceTypes = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
// 结算方式数据
|
||||
searchSaleCategory(this.colseTypeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.colseTypes = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
},
|
||||
// 供应商输入框focus事件触发
|
||||
handlechoose() {
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
<span>{{ personalForm.sourceNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleContract.customerType')" style="width: 100%;">
|
||||
<span>{{ personalForm.customerType | customerTypeFilter }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleContract.customerName')" style="width: 100%;">
|
||||
<span>{{ personalForm.customerName }}</span>
|
||||
|
@ -257,9 +262,10 @@
|
|||
<script>
|
||||
export default {
|
||||
filters: {
|
||||
invoiceTypeFilter(status) {
|
||||
customerTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '增值税'
|
||||
1: '经销商',
|
||||
2: '客户'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
|
|
|
@ -26,10 +26,19 @@
|
|||
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
|
||||
<my-installmentapply :installappleycontrol.sync = "installappleycontrol" @installappleyDetail="installappleyDetail" @installappley="installappley"/>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleOut.customerType')" prop="customerType" style="width: 100%;">
|
||||
<el-select v-model="personalForm.customerType" style="margin-left: 18px;width: 200px" @change="clearCustomer">
|
||||
<el-option value="1" label="经销商"/>
|
||||
<el-option value="2" label="零售"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleContract.customerName')" style="width: 100%;">
|
||||
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" clearable/>
|
||||
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
|
||||
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -48,7 +57,11 @@
|
|||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleContract.closeType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.closeType" clearable style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="结算1"/>
|
||||
<el-option
|
||||
v-for="(item, index) in colseTypes"
|
||||
:value="item.id"
|
||||
:key="index"
|
||||
:label="item.categoryName"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -120,7 +133,12 @@
|
|||
<el-col :span="12">
|
||||
<el-form-item :label="$t('SaleContract.invoiceType')" style="width: 100%;">
|
||||
<el-select v-model="personalForm.invoiceType" clearable style="margin-left: 18px;width: 200px">
|
||||
<el-option value="1" label="增值税"/>
|
||||
<el-option
|
||||
v-for="(item, index) in invoiceTypes"
|
||||
:value="item.id"
|
||||
:key="index"
|
||||
:label="item.categoryName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -294,6 +312,7 @@
|
|||
import { updatesaleContract } from '@/api/SaleContract'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import { searchSaleCategory } from '@/api/SaleCategory'
|
||||
import { searchCategory } from '@/api/Supplier'
|
||||
import MyEmp from './MyEmp'
|
||||
import MyDetail from './MyDetail'
|
||||
|
@ -303,9 +322,10 @@ import MyPlan from './MyPlan'
|
|||
import MyDelivery from './MyDelivery'
|
||||
import MyOpportunity from './MyOpportunity'
|
||||
import MyInstallmentapply from './MyInstallmentapply'
|
||||
import MyAgent from './MyAgent'
|
||||
import MyCustomer from '../../SaleOpportunity/components/MyCustomer'
|
||||
export default {
|
||||
components: { MyCustomer, MyInstallmentapply, MyOpportunity, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp },
|
||||
components: { MyCustomer, MyInstallmentapply, MyOpportunity, MyDelivery, MyPlan, MyApply, MySupplier, MyDetail, MyEmp, MyAgent },
|
||||
props: {
|
||||
editcontrol: {
|
||||
type: Boolean,
|
||||
|
@ -379,6 +399,24 @@ export default {
|
|||
editVisible: this.editcontrol,
|
||||
// 修改信息数据
|
||||
personalForm: this.editdata,
|
||||
// 控制经销商
|
||||
agentcontrol: false,
|
||||
// 开票类别数据
|
||||
invoiceTypes: [],
|
||||
// 开票类别获取参数
|
||||
invoicetypeparms: {
|
||||
type: 4,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 结算方式数据
|
||||
colseTypes: [],
|
||||
// 结算方式获取参数
|
||||
colseTypeparms: {
|
||||
type: 3,
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 合计数据
|
||||
allNumber: '',
|
||||
allMoney: '',
|
||||
|
@ -421,6 +459,9 @@ export default {
|
|||
control: false,
|
||||
// 采购申请单规则数据
|
||||
personalrules: {
|
||||
customerType: [
|
||||
{ required: true, message: '请选择客户类别', trigger: 'change' }
|
||||
],
|
||||
supplierId: [
|
||||
{ required: true, validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
|
@ -467,15 +508,33 @@ export default {
|
|||
this.getways()
|
||||
},
|
||||
methods: {
|
||||
// 选择客户类型时清理客户名称
|
||||
clearCustomer() {
|
||||
this.personalForm.customerId = ''
|
||||
this.customerId = ''
|
||||
},
|
||||
// 选择客户focus
|
||||
chooseCustomer() {
|
||||
this.customercontrol = true
|
||||
this.$forceUpdate()
|
||||
if (this.personalForm.customerType === '1') {
|
||||
this.agentcontrol = true
|
||||
this.$forceUpdate()
|
||||
} else if (this.personalForm.customerType === '2') {
|
||||
this.customercontrol = true
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
customerdata(val) {
|
||||
this.personalForm.customerId = val.id
|
||||
this.customerId = val.customerName
|
||||
this.personalForm.customerPhone = val.phoneNumber
|
||||
},
|
||||
agentdata(val) {
|
||||
console.log(val)
|
||||
this.personalForm.customerId = val.id
|
||||
this.customerId = val.agentName
|
||||
this.personalForm.customerPhone = val.phone
|
||||
},
|
||||
clearfinal() {
|
||||
this.personalForm.installmentEndtime = null
|
||||
},
|
||||
|
@ -689,6 +748,18 @@ export default {
|
|||
this.depts = res.data.data.content
|
||||
}
|
||||
})
|
||||
// 开票类型数据
|
||||
searchSaleCategory(this.invoicetypeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.invoiceTypes = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
// 结算方式数据
|
||||
searchSaleCategory(this.colseTypeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.colseTypes = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
},
|
||||
// 供应商输入框focus事件触发
|
||||
handlechoose() {
|
||||
|
|
|
@ -190,10 +190,11 @@
|
|||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail"/>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 100px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 130px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrder="saleOrder"/>
|
||||
<my-presale :presalecontrol.sync="presalecontrol" @advanceOrderDetail="advanceOrderDetail" @advanceData="advanceData"/>
|
||||
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
|
||||
<my-contract :contractcontrol.sync="contractcontrol" @salecontractDetail="salecontractDetail" @salecontract="salecontract"/>
|
||||
<el-button type="danger" @click="$refs.editable.removeSelecteds()">删除</el-button>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
@ -441,9 +442,10 @@ import MyAdvance from './components/MyAdvance'
|
|||
import MyPresale from './components/MyPresale'
|
||||
import MyOpportunity from './components/MyOpportunity'
|
||||
import MyDetail2 from './components/MyDetail2'
|
||||
import MyContract from './components/MyContract'
|
||||
export default {
|
||||
name: 'AddSaleOut',
|
||||
components: { MyDetail2, MyOpportunity, MyPresale, MyAdvance, MyOrder, MyRepository, MyAccept, MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
components: { MyContract, MyDetail2, MyOpportunity, MyPresale, MyAdvance, MyOrder, MyRepository, MyAccept, MyAgent, MyCustomer, MyRequire, MySupplier, MyApply, MyDetail, MyDelivery, MyEmp },
|
||||
data() {
|
||||
const validatePass = (rule, value, callback) => {
|
||||
console.log(this.supplierId)
|
||||
|
@ -473,6 +475,8 @@ export default {
|
|||
heji11: '',
|
||||
// 货位数据
|
||||
locationlist: [],
|
||||
// 控制销售合同
|
||||
contractcontrol: false,
|
||||
// 控制赠品
|
||||
giftcontrol: false,
|
||||
// 控制销售机会单
|
||||
|
@ -825,7 +829,7 @@ export default {
|
|||
if (this.personalForm.sourceType === '1') {
|
||||
this.ordercontrol = true
|
||||
} else if (this.personalForm.sourceType === '2') {
|
||||
console.log('未做')
|
||||
this.contractcontrol = true
|
||||
} else if (this.personalForm.sourceType === '3') {
|
||||
this.presalecontrol = true
|
||||
} else if (this.personalForm.sourceType === '4') {
|
||||
|
@ -930,6 +934,44 @@ export default {
|
|||
this.personalForm.handleRepositoryId = val.handleRepositoryId
|
||||
this.handleRepositoryId = val.handleRepositoryName
|
||||
},
|
||||
// 源单类型为销售合同
|
||||
salecontractDetail(val) {
|
||||
console.log(val)
|
||||
const nowlistdata = this.$refs.editable.getRecords()
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
for (let j = 0; j < nowlistdata.length; j++) {
|
||||
if (val[i].sourceNumber === nowlistdata[j].sourceNumber) {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '物品已添加',
|
||||
offset: 100
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.$refs.editable.insert(val[i])
|
||||
}
|
||||
},
|
||||
salecontract(val) {
|
||||
if (val.customerType !== null && val.customerType !== undefined && val.customerType !== '') {
|
||||
this.personalForm.customerType = '2'
|
||||
}
|
||||
this.personalForm.customerId = val.customerId
|
||||
this.customerId = val.customerName
|
||||
this.personalForm.customerPhone = val.customerPhone
|
||||
this.personalForm.salePersonId = val.salePersonId
|
||||
this.salePersonId = val.salePersonName
|
||||
this.personalForm.handleRepositoryId = val.saleRepositoryId
|
||||
this.handleRepositoryId = val.saleRepositoryName
|
||||
if (val.saleType !== null && val.saleType !== undefined && val.saleType !== '') {
|
||||
this.personalForm.saleType = String(val.saleType)
|
||||
}
|
||||
this.personalForm.closeType = val.closeType
|
||||
this.personalForm.invoiceType = val.invoiceType
|
||||
if (val.payType !== null && val.payType !== undefined && val.payType !== '') {
|
||||
this.personalForm.payType = String(val.payType)
|
||||
}
|
||||
},
|
||||
// 无来源添加商品
|
||||
handleAddproduct() {
|
||||
this.control = true
|
||||
|
|
421
src/views/SaleOut/components/MyContract.vue
Normal file
421
src/views/SaleOut/components/MyContract.vue
Normal file
|
@ -0,0 +1,421 @@
|
|||
<template>
|
||||
<el-dialog :visible.sync="employeeVisible" :contractcontrol="contractcontrol" :close-on-press-escape="false" top="10px" title="选择销售合同" append-to-body width="1100px" @close="$emit('update:contractcontrol', false)">
|
||||
<el-card class="box-card" style="margin-top: 15px;height: 60px;padding-left:0 " shadow="never">
|
||||
<el-row>
|
||||
<el-form ref="getemplist" :model="getemplist" style="margin-top: -9px">
|
||||
<el-col :span="4">
|
||||
<el-form-item>
|
||||
<el-input v-model="getemplist.title" :placeholder="$t('SaleContract.title')" clearable @keyup.enter.native="handleFilter"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3" style="margin-left: 5px">
|
||||
<el-form-item>
|
||||
<el-input v-model="getemplist.number" placeholder="合同单号" clearable @keyup.enter.native="handleFilter"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3" style="margin-left: 20px">
|
||||
<el-form-item>
|
||||
<el-select v-model="getemplist.saleType" :value="getemplist.saleType" :placeholder="$t('SaleContract.saleType')" clearable @keyup.enter.native="handleFilter">
|
||||
<el-option value="1" label="零售"/>
|
||||
<el-option value="2" label="批发"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--更多搜索条件-->
|
||||
<el-col :span="3" style="margin-left: 30px">
|
||||
<el-popover
|
||||
v-model="visible2"
|
||||
placement="bottom"
|
||||
width="500"
|
||||
trigger="manual">
|
||||
<el-select v-model="getemplist.customerType" :placeholder="$t('SaleContract.customerType')" clearable style="width: 40%;float: left;margin-left: 20px">
|
||||
<el-option value="1" label="经销商"/>
|
||||
<el-option value="2" label="零售"/>
|
||||
</el-select>
|
||||
<el-input v-model="customerName" :placeholder="$t('SaleContract.customerName')" style="width: 40%;float: right;margin-right: 20px;" clearable @focus="chooseCustomer"/>
|
||||
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
|
||||
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/>
|
||||
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" placeholder="单据状态" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
|
||||
<el-option value="1" label="制单"/>
|
||||
<el-option value="2" label="执行"/>
|
||||
<el-option value="3" label="结单"/>
|
||||
</el-select>
|
||||
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" placeholder="审批状态" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
|
||||
<el-option value="0" label="未审核"/>
|
||||
<el-option value="1" label="审核中"/>
|
||||
<el-option value="2" label="审核通过"/>
|
||||
<el-option value="3" label="审核不通过"/>
|
||||
</el-select>
|
||||
<!--<el-date-picker-->
|
||||
<!--v-model="date"-->
|
||||
<!--type="daterange"-->
|
||||
<!--range-separator="-"-->
|
||||
<!--unlink-panels-->
|
||||
<!--start-placeholder="销售日期"-->
|
||||
<!--end-placeholder="销售日期"-->
|
||||
<!--value-format="yyyy-MM-dd"-->
|
||||
<!--style="margin-top: 20px;margin-left: 20px"/>-->
|
||||
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
|
||||
<el-button v-waves class="filter-item" type="primary" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</div>
|
||||
<el-button v-waves slot="reference" type="primary" class="filter-item" style="width: 130px" @click="visible2 = !visible2">{{ $t('public.filter') }}<svg-icon icon-class="shaixuan" style="margin-left: 4px"/></el-button>
|
||||
</el-popover>
|
||||
</el-col>
|
||||
<el-col :span="3" style="margin-left: 20px">
|
||||
<!-- 搜索按钮 -->
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 15px" shadow="never">
|
||||
<!-- 列表开始 -->
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:key="tableKey"
|
||||
:data="list"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column :label="$t('public.id')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.number }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.title')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.title }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.sourceNumber')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.sourceNumber }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.salePersonId')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.salePersonName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.customerName')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.customerName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.customerPhone')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.customerPhone }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('SaleContract.allMoney')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.allMoney }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.judgeStat')" :resizable="false" prop="judgeStat" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.judgeStat | judgeStatFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('public.receiptStat')" :resizable="false" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.receiptStat | receiptStatFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 列表结束 -->
|
||||
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
|
||||
<!--修改开始=================================================-->
|
||||
<el-button v-waves class="filter-item" type="success" style="width: 100px;float: left;margin-bottom: 10px" @click="handleConfirm">确认添加</el-button>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchsaleContract } from '@/api/SaleContract'
|
||||
import { getdeptlist } from '@/api/BasicSettings'
|
||||
import { searchStockCategory } from '@/api/StockCategory'
|
||||
import waves from '@/directive/waves' // Waves directive
|
||||
import Pagination from '@/components/Pagination'
|
||||
import MyEmp from './MyEmp'
|
||||
import MyCustomer from './MyCustomer'
|
||||
import MyAgent from './MyAgent'
|
||||
export default {
|
||||
directives: { waves },
|
||||
components: { MyEmp, MyCustomer, MyAgent, Pagination },
|
||||
filters: {
|
||||
judgeStatFilter(status) {
|
||||
const statusMap = {
|
||||
0: '未审核',
|
||||
1: '审核中',
|
||||
2: '审核通过',
|
||||
3: '审核不通过'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
receiptStatFilter(status) {
|
||||
const statusMap = {
|
||||
1: '制单',
|
||||
2: '执行',
|
||||
3: '结单'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
stockTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '采购1'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
sendTypeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '已发货',
|
||||
2: '未发货'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
props: {
|
||||
contractcontrol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 选择框控制
|
||||
employeeVisible: this.contractcontrol,
|
||||
// 回显客户
|
||||
customerName: '',
|
||||
// 控制客户
|
||||
customercontrol: false,
|
||||
agentcontrol: false,
|
||||
// 类别获取参数
|
||||
typeparms: {
|
||||
pagenum: 1,
|
||||
pagesize: 99999
|
||||
},
|
||||
// 采购类别数据
|
||||
types: [],
|
||||
// 申请部门数据
|
||||
depts: [],
|
||||
// 审核传参
|
||||
reviewParms: {
|
||||
id: '',
|
||||
judgePersonId: '',
|
||||
judgeStat: ''
|
||||
},
|
||||
// 详情组件数据
|
||||
detailvisible: false,
|
||||
// 更多搜索条件问题
|
||||
visible2: false,
|
||||
// 供应商回显
|
||||
supplierId: '',
|
||||
// 供应商控制框
|
||||
empcontrol: false,
|
||||
// 采购人回显
|
||||
stockPersonId: '',
|
||||
// 采购人控制框
|
||||
stockControl: false,
|
||||
// 批量操作
|
||||
moreaction: '',
|
||||
// 加载操作控制
|
||||
downloadLoading: false,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 表格数据条数
|
||||
total: 0,
|
||||
// 表格识别
|
||||
tableKey: 0,
|
||||
// 加载表格
|
||||
listLoading: true,
|
||||
// 采购申请查询加展示参数
|
||||
getemplist: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
judgeStat: 2,
|
||||
receiptStat: 2,
|
||||
repositoryId: this.$store.getters.repositoryId,
|
||||
regionIds: this.$store.getters.regionId,
|
||||
isActive: 1
|
||||
},
|
||||
// 传给组件的数据
|
||||
personalForm: {},
|
||||
// 修改控制组件数据
|
||||
editVisible: false,
|
||||
// 开始时间到结束时间
|
||||
date: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
contractcontrol() {
|
||||
this.employeeVisible = this.contractcontrol
|
||||
this.getlist()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 选择客户类型时清理客户名称
|
||||
clearCustomer() {
|
||||
this.getemplist.customerId = ''
|
||||
this.customerName = ''
|
||||
},
|
||||
// 选择客户focus
|
||||
chooseCustomer() {
|
||||
if (this.getemplist.customerType === '1') {
|
||||
this.agentcontrol = true
|
||||
} else if (this.getemplist.customerType === '2') {
|
||||
this.customercontrol = true
|
||||
}
|
||||
},
|
||||
customerdata(val) {
|
||||
this.getemplist.customerId = val.id
|
||||
this.customerName = val.customerName
|
||||
},
|
||||
agentdata(val) {
|
||||
this.getemplist.customerId = val.id
|
||||
this.customerName = val.agentName
|
||||
},
|
||||
// 更新采购类型
|
||||
updatecountry() {
|
||||
this.getlist()
|
||||
},
|
||||
getlist() {
|
||||
// 物料需求计划列表数据
|
||||
this.listLoading = true
|
||||
searchsaleContract(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.listLoading = false
|
||||
}, 0.5 * 100)
|
||||
})
|
||||
// 部门列表数据
|
||||
getdeptlist().then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.depts = res.data.data.content
|
||||
}
|
||||
})
|
||||
// 采购类别数据
|
||||
searchStockCategory(this.typeparms).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.types = res.data.data.content.list
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清空搜索条件
|
||||
restFilter() {
|
||||
this.customerName = ''
|
||||
this.getemplist.customerId = ''
|
||||
this.stockPersonId = ''
|
||||
this.getemplist.stockPersonId = ''
|
||||
},
|
||||
// 搜索
|
||||
handleFilter() {
|
||||
this.getemplist.pageNum = 1
|
||||
searchsaleContract(this.getemplist).then(res => {
|
||||
if (res.data.ret === 200) {
|
||||
this.list = res.data.data.content.list
|
||||
this.total = res.data.data.content.totalCount
|
||||
this.restFilter()
|
||||
} else {
|
||||
this.restFilter()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 采购人focus事件
|
||||
handlechooseStock() {
|
||||
this.stockControl = true
|
||||
},
|
||||
// 采购人回显
|
||||
stockName(val) {
|
||||
this.stockPersonId = val.personName
|
||||
this.getemplist.stockPersonId = val.id
|
||||
},
|
||||
// 供应商输入框focus事件触发
|
||||
handlechoose() {
|
||||
this.empcontrol = true
|
||||
},
|
||||
// 供应商列表返回数据
|
||||
supplierName(val) {
|
||||
console.log(val)
|
||||
this.supplierId = val.supplierName
|
||||
this.getemplist.supplierId = val.id
|
||||
},
|
||||
// 新增数据
|
||||
handleAdd() {
|
||||
this.$router.push('/SaleContract/AddSaleContract')
|
||||
},
|
||||
// 选择主生产计划数据时的操作
|
||||
handleCurrentChange(val) {
|
||||
this.choosedata = val
|
||||
},
|
||||
// 确认添加数据
|
||||
handleConfirm() {
|
||||
this.employeeVisible = false
|
||||
console.log(this.choosedata)
|
||||
const salecontractdata = this.choosedata.saleContractDetailVos
|
||||
const contractNumber = this.choosedata.number
|
||||
const salecontractDetail = salecontractdata.map(function(item) {
|
||||
return {
|
||||
productCode: item.productCode,
|
||||
productName: item.productName,
|
||||
categoryName: item.productCategoryName,
|
||||
category: item.productCategory,
|
||||
unit: item.unit,
|
||||
typeName: item.productTypeName,
|
||||
type: item.productType,
|
||||
color: item.color,
|
||||
kpiGrade: '0.00',
|
||||
point: '0.00',
|
||||
quantity: item.quantity,
|
||||
salePrice: (item.salePrice).toFixed(2),
|
||||
costPrice: (item.costPrice).toFixed(2),
|
||||
taxprice: (item.salePrice).toFixed(2),
|
||||
costMoney: (item.costMoney).toFixed(2),
|
||||
includeTaxMoney: (item.includeTaxMoney).toFixed(2),
|
||||
taxRate: item.taxRate,
|
||||
taxMoney: item.taxMoney,
|
||||
money: (item.money).toFixed(2),
|
||||
includeTaxCostMoney: (item.includeTaxCostMoney).toFixed(2),
|
||||
discount: item.discount,
|
||||
discountMoney: item.discountMoney,
|
||||
carCode: 0,
|
||||
motorCode: 0,
|
||||
batteryCode: 0,
|
||||
sourceNumber: contractNumber,
|
||||
sourceSerialNumber: item.id
|
||||
}
|
||||
})
|
||||
this.$emit('salecontractDetail', salecontractDetail)
|
||||
this.$emit('salecontract', this.choosedata)
|
||||
}
|
||||
// 仓库管理员选择结束
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ERP-container {
|
||||
margin: 50px 30px;
|
||||
}
|
||||
.filter-item{
|
||||
width: 140px;
|
||||
}
|
||||
.form-name{
|
||||
font-size: 18px;
|
||||
color: #373e4f;
|
||||
margin-bottom: -20px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.container{
|
||||
margin-top: 2%;
|
||||
border: 1px solid #eceff6;
|
||||
}
|
||||
</style>
|
|
@ -189,7 +189,7 @@
|
|||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail"/>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 100px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 130px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrder="saleOrder"/>
|
||||
<my-presale :presalecontrol.sync="presalecontrol" @advanceOrderDetail="advanceOrderDetail" @advanceData="advanceData"/>
|
||||
<my-opportunity :opportunitycontrol.sync="opportunitycontrol" @opportunityDetail="opportunityDetail" @opportunity="opportunity"/>
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 100px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 130px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrderDetail2="saleOrderDetail2" @saleOrder="saleOrder"/>
|
||||
<el-button type="danger" @click="deleteEdit">删除</el-button>
|
||||
</div>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
|
||||
<el-button :disabled="Isproduct" @click="handleAddproduct">添加商品</el-button>
|
||||
<my-detail :control.sync="control" @product="productdetail" @product2="productdetail2"/>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 100px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<el-button :disabled="IsSourceNumber" style="width: 130px" @click="handleAddSource">从源单中选择</el-button>
|
||||
<my-order :ordercontrol.sync="ordercontrol" @saleOrderDetail="saleOrderDetail" @saleOrderDetail2="saleOrderDetail2" @saleOrder="saleOrder"/>
|
||||
<el-button type="danger" @click="deleteEdit">删除</el-button>
|
||||
</div>
|
||||
|
|
|
@ -463,9 +463,10 @@ export default {
|
|||
return sums
|
||||
},
|
||||
getdatatime() { // 默认显示今天
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime())
|
||||
this.personalForm.inquiryDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
||||
// const date = new Date()
|
||||
// date.setTime(date.getTime())
|
||||
// this.personalForm.inquiryDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
||||
this.personalForm.inquiryDate = new Date()
|
||||
},
|
||||
// 通过税率计算含税价
|
||||
gettaxRate(row) {
|
||||
|
@ -669,7 +670,11 @@ export default {
|
|||
countryId: this.$store.getters.countryId,
|
||||
repositoryId: this.$store.getters.repositoryId,
|
||||
regionId: this.$store.getters.regionId,
|
||||
isVat: 1
|
||||
isVat: 1,
|
||||
inquiryTimes: 1,
|
||||
currency: '1',
|
||||
inquiryDate: null,
|
||||
sourceType: '3'
|
||||
}
|
||||
this.supplierId = null
|
||||
this.inquiryPersonId = null
|
||||
|
|
Loading…
Reference in a new issue