销售出库单增加销售合同源单类型

销售出库单增加销售合同源单类型
This commit is contained in:
shawnzhang 2019-06-01 11:10:15 +08:00
parent 73b62fae24
commit 4b024de309
11 changed files with 641 additions and 24 deletions

View file

@ -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({

View file

@ -1477,6 +1477,7 @@ export default {
isSale: '当前状态'
},
SaleContract: {
customerType: '客户类型',
title: '合同主题',
sourceType: '源单类型',
sourceNumber: '源单编号',

View file

@ -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.$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() {

View file

@ -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]
},

View file

@ -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.$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() {

View file

@ -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

View 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>

View file

@ -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"/>

View file

@ -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>

View file

@ -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>

View file

@ -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