客户组模块完成

客户组模块完成
This commit is contained in:
shawnzhang 2021-01-20 10:02:34 +08:00
parent ee0a512f9c
commit 931f1e2201
46 changed files with 5222 additions and 361 deletions

View file

@ -607,3 +607,84 @@ export function customerlistapply(query) {
data: params
})
}
// 新建客户组
export function addCustomerProduct(query, query2) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('customerProductGroupJson', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('customerProductGroupDetailJson', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/customerProduct/addCustomerProduct',
method: 'post',
data: params
})
}
// 客户组列表
export function customerProductList(query) {
var params = new URLSearchParams()
if (query.groupId !== '' && query.groupId !== null && query.groupId !== undefined) {
params.append('groupId', query.groupId) // 你要传给后台的参数值 key/value
}
if (query.productCode !== '' && query.productCode !== null && query.productCode !== undefined) {
params.append('productCode', query.productCode) // 你要传给后台的参数值 key/value
}
if (query.productName !== '' && query.productName !== null && query.productName !== undefined) {
params.append('productName', query.productName) // 你要传给后台的参数值 key/value
}
if (query.customerId !== '' && query.customerId !== null && query.customerId !== undefined) {
params.append('customerId', query.customerId) // 你要传给后台的参数值 key/value
}
if (query.beginTime !== '' && query.beginTime !== null && query.beginTime !== undefined) {
params.append('beginTime', query.beginTime) // 你要传给后台的参数值 key/value
}
if (query.endTime !== '' && query.endTime !== null && query.endTime !== undefined) {
params.append('endTime', query.endTime) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({
url: '/customerProduct/customerProductList',
method: 'post',
data: params
})
}
// 删除客户组
export function deleteCustomerProduct(query, query2) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('groupId', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('operateId', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/customerProduct/deleteCustomerProduct',
method: 'post',
data: params
})
}
// 修改客户组
export function updateCustomerProduct(query, query2, query3) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('customerProductGroupJson', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('customerProductGroupDetailJson', query2) // 你要传给后台的参数值 key/value
}
if (query3 !== '' && query3 !== null && query3 !== undefined) {
params.append('operateId', query3) // 你要传给后台的参数值 key/value
}
return request({
url: '/customerProduct/updateCustomerProduct',
method: 'post',
data: params
})
}

View file

@ -203,3 +203,103 @@ export function deleteprepReturn(query, query2) {
data: params
})
}
// 新建销售退款单
export function addSaleRefund(query, query2) {
var params = new URLSearchParams()
params.append('saleRefundJson', query) // 你要传给后台的参数值 key/value
if (query2.repositoryId !== '' && query2.repositoryId !== null && query2.repositoryId !== undefined) {
params.append('repositoryId', query2.repositoryId) // 你要传给后台的参数值 key/value
}
if (query2.regionId !== '' && query2.regionId !== null && query2.regionId !== undefined) {
params.append('regionId', query2.regionId) // 你要传给后台的参数值 key/value
}
return request({
url: '/saleRefund/addSaleRefund',
method: 'post',
data: params
})
}
// 销售退款单列表
export function saleRefundList(query) {
var params = new URLSearchParams()
if (query.title !== '' && query.title !== null && query.title !== undefined) {
params.append('title', query.title) // 你要传给后台的参数值 key/value
}
if (query.refundNumber !== '' && query.refundNumber !== null && query.refundNumber !== undefined) {
params.append('refundNumber', query.refundNumber) // 你要传给后台的参数值 key/value
}
if (query.customerName !== '' && query.customerName !== null && query.customerName !== undefined) {
params.append('customerName', query.customerName) // 你要传给后台的参数值 key/value
}
if (query.judgeStat !== '' && query.judgeStat !== null && query.judgeStat !== undefined) {
params.append('judgeStat', query.judgeStat) // 你要传给后台的参数值 key/value
}
if (query.receiptStat !== '' && query.receiptStat !== null && query.receiptStat !== undefined) {
params.append('receiptStat', query.receiptStat) // 你要传给后台的参数值 key/value
}
if (query.beginTime !== '' && query.beginTime !== null && query.beginTime !== undefined) {
params.append('beginTime', query.beginTime) // 你要传给后台的参数值 key/value
}
if (query.endTime !== '' && query.endTime !== null && query.endTime !== undefined) {
params.append('endTime', query.endTime) // 你要传给后台的参数值 key/value
}
if (query.repositoryId !== '' && query.repositoryId !== null && query.repositoryId !== undefined) {
params.append('repositoryId', query.repositoryId) // 你要传给后台的参数值 key/value
}
if (query.refundRepositoryId !== '' && query.refundRepositoryId !== null && query.refundRepositoryId !== undefined) {
params.append('refundRepositoryId', query.refundRepositoryId) // 你要传给后台的参数值 key/value
}
if (query.regionIds !== '' && query.regionIds !== null && query.regionIds !== undefined) {
params.append('regionIds', query.regionIds) // 你要传给后台的参数值 key/value
}
if (query.customerPhone !== '' && query.customerPhone !== null && query.customerPhone !== undefined) {
params.append('customerPhone', query.customerPhone) // 你要传给后台的参数值 key/value
}
params.append('pageNum', query.pageNum) // 你要传给后台的参数值 key/value
params.append('pageSize', query.pageSize) // 你要传给后台的参数值 key/value
return request({
url: '/saleRefund/saleRefundList',
method: 'post',
data: params
})
}
// 审核销售退款单
export function judgeSaleRefund(query) {
var params = new URLSearchParams()
params.append('saleRefundJson', query) // 你要传给后台的参数值 key/value
return request({
url: '/saleRefund/judgeSaleRefund',
method: 'post',
data: params
})
}
// 删除销售退款单
export function deleteSaleRefund(query, query2) {
var params = new URLSearchParams()
if (query !== '' && query !== null && query !== undefined) {
params.append('modelids', query) // 你要传给后台的参数值 key/value
}
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('orderIds', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/saleRefund/deleteSaleRefund',
method: 'post',
data: params
})
}
// 修改销售订单
export function updateSaleRefund(query) {
var params = new URLSearchParams()
params.append('saleRefundJson', query) // 你要传给后台的参数值 key/value
return request({
url: '/saleRefund/updateSaleRefund',
method: 'post',
data: params
})
}

View file

@ -149,9 +149,12 @@ export function updateStoragemove2(query) {
})
}
// 确认调拨出库
export function confirmStoragemove(query) {
export function confirmStoragemove(query, query2) {
var params = new URLSearchParams()
params.append('detailId', query) // 你要传给后台的参数值 key/value
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('confirmPersonId', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/storagemove/confirmOut',
method: 'post',
@ -169,9 +172,12 @@ export function editStoragemove(query) {
})
}
// 确认调拨入库
export function confirmStoragein(query) {
export function confirmStoragein(query, query2) {
var params = new URLSearchParams()
params.append('detailId', query) // 你要传给后台的参数值 key/value
if (query2 !== '' && query2 !== null && query2 !== undefined) {
params.append('confirmPersonId', query2) // 你要传给后台的参数值 key/value
}
return request({
url: '/storagemove/confirmIn',
method: 'post',

View file

@ -450,7 +450,9 @@ export default {
Discountsetting: 'Discountsetting',
DiffPrice: 'DiffPrice',
NewBatteryOut: 'Battery Swap',
AccountingCalculation: 'Accounting Calculation'
AccountingCalculation: 'Accounting Calculation',
NewSaleRefund: 'NewSaleRefund',
SaleRefundList: 'SaleRefundList'
},
installmentAnalyze: {
repositoryName: 'warehouse name',

View file

@ -450,7 +450,13 @@ export default {
Discountsetting: '折扣设置列表',
DiffPrice: '电池差异价格设置',
NewBatteryOut: '新建电池置换',
AccountingCalculation: '会计核算'
AccountingCalculation: '会计核算',
saleRefund: '销售退款',
NewSaleRefund: '新建销售退款单',
SaleRefundList: '销售退款单列表',
CustomerGroup: '客户组管理',
NewCustomerGroup: '新建客户组',
CustomerGroupList: '客户组列表'
},
installmentAnalyze: {
repositoryName: '仓库名称',
@ -4585,6 +4591,11 @@ export default {
gongxurengongfeiyognbili: '工序人工费用比例',
gongxu: '工序',
enterPrice: '入库价格',
enterMoney: '入库金额'
enterMoney: '入库金额',
refundTitle: '退款主题',
tuikuanjine: '退款金额',
groupName: '客户组主题',
stat: '状态',
customerPrice: '销售单价'
}
}

View file

@ -517,6 +517,18 @@ export const asyncRouterMap = [
name: 'CustomerList',
meta: { title: 'CustomerList', noCache: false, roles: ['1-14-16-1', '1-14-16-2', '1-14-16-3', '1-14-16-4', '1-14-16-5', '1-14-16-6', '1-14-16-7', '1-14-16-11'] }
},
{
path: 'NewCustomerGroup',
component: () => import('@/views/CustomerGroup/NewCustomerGroup'),
name: 'NewCustomerGroup',
meta: { title: 'NewCustomerGroup', noCache: false, roles: ['1-14-15-1'] }
},
{
path: 'CustomerGroupList',
component: () => import('@/views/CustomerGroup/CustomerGroupList'),
name: 'CustomerGroupList',
meta: { title: 'CustomerGroupList', noCache: false, roles: ['1-14-16-1', '1-14-16-2', '1-14-16-3', '1-14-16-4', '1-14-16-5', '1-14-16-6', '1-14-16-7', '1-14-16-11'] }
},
// {
// path: 'ManyCustomer',
// component: () => import('@/views/Customer/ManyCustomer'),
@ -3745,6 +3757,33 @@ export const asyncRouterMap = [
}
]
},
{
path: '/saleRefund',
component: Layout,
redirect: 'noredirect',
name: 'saleRefund',
alwaysShow: true,
meta: {
title: 'saleRefund',
icon: 'shuxing',
type: 3,
roles: ['54-414-4', '54-413-1']
},
children: [
{
path: 'NewSaleRefund',
component: () => import('@/views/saleRefund/NewSaleRefund'),
name: 'NewSaleRefund',
meta: { title: 'NewSaleRefund', noCache: false }
},
{
path: 'SaleRefundList',
component: () => import('@/views/saleRefund/SaleRefundList'),
name: 'SaleRefundList',
meta: { title: 'SaleRefundList', noCache: false }
}
]
},
// {
// path: '/GroupBuyRules',
// component: Layout,

View file

@ -70,7 +70,7 @@
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.scrwdmx') }}</h2>
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.lldmx') }}</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button :disabled="addpro" @click="handleAddproduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail2 :control.sync="control" @product="productdetail"/>
@ -89,13 +89,13 @@
style="width: 100%">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-editable-column :edit-render="{type: 'default'}" :label="$t('Hmodule.hw')" prop="locationCode" align="center" width="200px">
<el-editable-column :edit-render="{name: 'ElSelect', type: 'default'}" :label="$t('Hmodule.hw')" prop="locationId" align="center" width="200px">
<template slot-scope="scope">
<el-select v-model="scope.row.locationCode" :value="scope.row.locationCode" :placeholder="$t('Hmodule.xzhw')" filterable clearable style="width: 100%;" @visible-change="updatebatch($event,scope)">
<el-select v-model="scope.row.locationId" :value="scope.row.locationId" :placeholder="$t('Hmodule.xzhw')" filterable style="width: 100%;" @visible-change="updatebatch($event,scope)">
<el-option
v-for="(item, index) in locationlist"
:key="index"
:value="item.locationCode"
:value="item.id"
:label="item.locationCode"/>
</el-select>
</template>
@ -157,7 +157,7 @@
<script>
import { getDetailByTaskNumber, updateaccess } from '@/api/AccessMaterials'
import { materialslist, searchprocessFile, searchworkCenter, batchlist, getlocation, countlist } from '@/api/public'
import { materialslist, searchprocessFile, searchworkCenter, batchlist, getlocation, countlist, locationlist } from '@/api/public'
import { searchEmpCategory2 } from '@/api/Product'
import { getdeptlist } from '@/api/BasicSettings'
import MyDetail from './MyDetail'
@ -267,6 +267,7 @@ export default {
this.list2 = this.personalForm.accessMaterialsDetailVos
this.addsouce = false
this.choosedept()
this.getlocation()
}
},
created() {
@ -277,6 +278,14 @@ export default {
_that = this
},
methods: {
getlocation() {
// id
locationlist(this.personalForm.accessRepositoryId).then(res => {
if (res.data.ret === 200) {
this.locationlist = res.data.data.content.list
}
})
},
queryStock(row) {
if (row.locationCode === null || row.locationCode === '' || row.locationCode === undefined) {
this.$notify.error({
@ -363,18 +372,20 @@ export default {
} else {
return scope.row.productCode
}
console.log('this.personalForm.accessRepositoryId', this.personalForm.accessRepositoryId)
if (scope.row.flag) {
if (scope.row.batch === null || scope.row.batch === '' || scope.row.batch === undefined) {
const parms3 = scope.row.productCode
batchlist(this.personalForm.accessRepositoryId, parms3).then(res => {
if (res.data.data.content.length > 0) {
console.log('res', res)
if (res.data.ret === 200 && res.data.data.content.length > 0) {
scope.row.batch = res.data.data.content[0]
}
})
} else {
const parms3 = scope.row.productCode
batchlist(this.personalForm.accessRepositoryId, parms3).then(res => {
if (res.data.data.content.length === 0) {
if (res.data.data.content.length === 0 && res.data.ret === 200) {
if (scope.row.batch !== '不使用') {
scope.row.batch = null
}
@ -742,6 +753,7 @@ export default {
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
height: 100vh;
}
.el-col-12{
width: 49%;

View file

@ -182,7 +182,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('CheckReport.checkResult')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-select v-model="personalForm.checkResult" style="width: 200px">
<el-select v-model="personalForm.checkResult" style="margin-left: 18px;width: 200px">
<el-option value="1" label="合格"/>
<el-option value="2" label="不合格"/>
</el-select>

View file

@ -5,7 +5,7 @@
ref="table"
:key="tableKey"
:data.sync="list"
:height="tableHeight"
height="800"
border
fit
highlight-current-row
@ -90,7 +90,7 @@ export default {
},
data() {
return {
tableHeight: 200,
tableHeight: 600,
//
choosedata: [],
//
@ -121,11 +121,11 @@ export default {
reportcontrol() {
this.editVisible = this.reportcontrol
this.getdata()
if (this.reportcontrol) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
}, 100)
}
// if (this.reportcontrol) {
// setTimeout(() => {
// this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
// }, 100)
// }
},
reportdata() {
console.log(this.reportdata)

View file

@ -5,7 +5,7 @@
ref="table"
:key="tableKey"
:data.sync="list"
:height="tableHeight"
height="800"
border
fit
highlight-current-row
@ -110,7 +110,9 @@ export default {
watch: {
reportcontrol2() {
this.editVisible = this.reportcontrol2
this.getData()
// this.getData()
console.log('13')
if (this.reportcontrol2) {
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
@ -122,6 +124,7 @@ export default {
},
number() {
this.getemplist.number = this.number
console.log('12')
this.getData()
}
},

View file

@ -5,7 +5,7 @@
ref="table"
:key="tableKey"
:data.sync="list"
:height="tableHeight"
height="800"
border
fit
highlight-current-row

View file

@ -5,7 +5,7 @@
ref="table"
:key="tableKey"
:data.sync="list"
:height="tableHeight"
height="800"
border
fit
highlight-current-row

View file

@ -191,7 +191,7 @@ export default {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()

View file

@ -297,7 +297,7 @@ export default {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()

View file

@ -0,0 +1,622 @@
<template>
<div class="ERP-container">
<el-card :body-style=" { padding: '5px' }" class="box-card" style="margin-top: 5px" shadow="never">
<el-input v-model="getemplist.productCode" :placeholder="$t('Hmodule.wpbh')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.productName" :placeholder="$t('Hmodule.wpmc')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="customerId" :placeholder="$t('update4.khm')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechooseRep" @clear="clearCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<el-popover
v-model="visible2"
placement="bottom"
width="500"
size="small"
trigger="click">
<!-- <el-input v-model="getemplist.customerName" :placeholder="$t('SaleOrder.customerName')" size="small" style="width: 40%;float: right;margin-right: 20px;" clearable/> -->
<!-- <my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/> -->
<!-- <el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" :placeholder="$t('updates.djzt')" size="small" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option :label="$t('updates.zd')" value="1"/>
<el-option :label="$t('updates.zx')" value="2"/>
<el-option :label="$t('updates.jd')" value="3"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" :placeholder="$t('updates.spzt')" size="small" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option :label="$t('updates.wsh')" value="0"/>
<el-option :label="$t('updates.shz')" value="1"/>
<el-option :label="$t('updates.shtg')" value="2"/>
<el-option :label="$t('updates.shptg')" value="3"/>
</el-select> -->
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
size="small"
unlink-panels
start-placeholder="销售日期"
end-placeholder="销售日期"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<!-- <el-input v-model="getemplist.customerName" :placeholder="$t('updates2.customerName')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable @keyup.enter.native="handleFilter"/> -->
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" size="small" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" size="small" 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-button v-waves class="filter-item" type="primary" size="small" icon="el-icon-search" style="width: 86px;margin-top: 10px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-card>
<el-card :body-style=" { padding: '6px'}" class="box-card" shadow="never">
<!-- 批量操作 -->
<el-dropdown @command="handleCommand">
<el-button v-waves size="small" class="filter-item2" style="margin-left: 0" type="primary">
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
</el-button>
<el-dropdown-menu slot="dropdown" style="width: 140px">
<el-dropdown-item v-permission="['54-57-2']" style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- 表格导出操作 -->
<el-button v-permission="['54-57-6']" v-waves :loading="downloadLoading" size="small" class="filter-item2" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
<!-- 打印操作 -->
<!-- <el-button v-permission="['54-57-7']" v-waves size="small" class="filter-item2" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button> -->
<!-- 新建操作 -->
<el-button v-permission="['54-57-1']" v-waves size="small" class="filter-item2" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-card>
<el-card :body-style=" { padding: '10px' }" class="box-card" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
ref="table"
:height="tableHeight"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@row-click="clickRow"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="selectInit"
type="selection"
width="55"
fixed="left"
align="center"
/>
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" >
<template slot-scope="scope">
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.id }}</span>
</template>
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
</el-table-column>
<el-table-column :label="$t('update4.groupName')" :resizable="false" fixed="left" align="center" >
<template slot-scope="scope">
<span>{{ scope.row.groupName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOrder.customerName')" :resizable="false" align="center" >
<template slot-scope="scope">
<span>{{ scope.row.customerName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('update4.stat')" :resizable="false" prop="stat" align="center">
<template slot-scope="scope">
<span>{{ scope.row.stat | statFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('update4.summary')" :resizable="false" align="center" >
<template slot-scope="scope">
<span>{{ scope.row.summary }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.actions')" :resizable="false" align="center">
<template slot-scope="scope">
<el-button v-permission="['1-14-16-3']" :title="$t('updates.xg')" type="primary" size="mini" icon="el-icon-edit" circle @click="handleEdit(scope.row)"/>
<el-button v-permission="['1-14-16-2']" :title="$t('updates.sc')" scope-row-create-person-id- size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
<!--修改开始=================================================-->
<my-dialog :editcontrol.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist"/>
<!--修改结束=================================================-->
</el-card>
</div>
</template>
<script>
import { customerProductList, deleteCustomerProduct } from '@/api/Customer'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import permission from '@/directive/permission/index.js' //
import permission2 from '@/directive/permission2/index.js' //
import checkPermission from '@/utils/permission' //
import MyCustomer from '../SaleOrder/components/MyCustomer'
import MyDialog from './components/MyDialog'
import DetailList from './components/DetailList'
var _that
export default {
name: 'CustomerGroupList',
directives: { waves, permission, permission2 },
components: { Pagination, MyCustomer, MyDialog, DetailList },
filters: {
statFilter(status) {
const statusMap = {
1: '启用',
2: '停用'
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
}
},
data() {
return {
customerId: '',
repositoryId: '',
repositorycontrol: false,
repositories: [],
tableHeight: 200,
step1: '',
step2: '',
step3: '',
step4: '',
step5: '',
step6: '',
step7: '',
step8: '',
receiptVisible: false,
//
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,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionIds
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
activated() {
this.getlist()
// this.getrepos()
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140
}, 100)
},
mounted() {
this.getlist()
// this.getrepos()
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140
}, 100)
},
beforeCreate() {
_that = this
},
methods: {
numFormat(num) {
var res = num.toString().replace(/\d+/, function(n) { //
return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
return $1 + ','
})
})
return res
},
//
getSummaries2(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = this.numFormat(values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return (Number(prev) + Number(curr)).toFixed(6)
} else {
return (Number(prev)).toFixed(6)
}
}, 0))
// console.log('sums[index]', sums[index])
sums[index] += ''
} else {
sums[index] = ''
}
})
return sums
},
//
// handleReview3(row) {
// this.reviewParms = {}
// this.reviewParms.id = row.id
// // this.reviewParms.endPersonId = this.$store.getters.userId
// this.$confirm(this.$t('prompt.qfjd'), this.$t('prompt.fjd'), {
// distinguishCancelAndClose: true,
// confirmButtonText: this.$t('prompt.fjd'),
// type: 'warning'
// }).then(() => {
// this.reviewParms.receiptStat = 2
// const parms = JSON.stringify(this.reviewParms)
// updateprepReturn(parms).then(res => {
// if (res.data.ret === 200) {
// this.$message({
// type: 'success',
// message: this.$t('prompt.fjdcg')
// })
// this.getlist()
// }
// })
// })
// },
isReview3(row) {
if (row.receiptStat === 3) {
return true
}
},
isReview4(row) {
//
if (row.judgeStat === 2) {
return true
}
//
// if (row.judgeStat === 2 && row.confirmPersonId === null) {
// return true
// }
},
repositoryname(val) {
console.log(val)
this.repositoryId = val.repositoryName
this.getemplist.repositoryId = val.id
},
// focus
handlechooseRep() {
this.customercontrol = true
},
clearrep() {
this.getemplist.repositoryId = this.$store.getters.repositoryId
this.repositoryId = ''
},
//
// getrepos() {
// console.log('this.$store.getters.repositoryId', this.$store.getters.repositoryId)
// if (this.$store.getters.repositoryId !== '' && this.$store.getters.repositoryId !== null && this.$store.getters.repositoryId !== undefined) {
// searchRepository(null, this.$store.getters.repositoryId, this.$store.getters.regionIds).then(res => {
// if (res.data.ret === 200) {
// this.repositories = res.data.data.content.list
// } else {
// this.$message.error('')
// }
// })
// }
// },
clickRow(val) {
if (val.judgeStat === 0) {
this.$refs.table.toggleRowSelection(val)
}
},
checkPermission,
//
selectInit(row, index) {
if (row.judgeStat !== 0) {
return false
} else {
return true
}
},
//
clearCustomer() {
this.getemplist.customerId = ''
this.customerId = ''
},
// 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.customerId = val.customerName
},
agentdata(val) {
this.getemplist.customerId = val.id
this.customerName = val.agentName
},
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
customerProductList(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)
})
},
//
restFilter() {
this.customerName = ''
this.getemplist.customerId = ''
},
restFilter2() {
this.stockPersonId = ''
this.getemplist.stockPersonId = ''
},
//
handleFilter() {
console.log('this.date', this.date)
if (this.date && this.date.length !== 0) {
this.getemplist.beginTime = this.date[0] + ' 00:00:00'
this.getemplist.endTime = this.date[1] + ' 23:59:59'
} else {
this.getemplist.beginTime = ''
this.getemplist.endTime = ''
}
this.getemplist.pageNum = 1
customerProductList(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()
}
})
},
//
handleEdit(row) {
console.log(row)
this.personalForm = Object.assign({}, row)
if (row.stat !== null) {
this.personalForm.stat = String(row.stat)
}
this.editVisible = true
},
//
refreshlist(val) {
if (val === true) {
this.getlist()
}
},
//
handleDetail(row) {
console.log(row)
this.detailvisible = true
this.personalForm = Object.assign({}, row)
},
//
isReview(row) {
if (row.approvalUseVos !== '' && row.approvalUseVos !== null && row.approvalUseVos !== undefined && row.approvalUseVos.length !== 0) {
const approvalUse = row.approvalUseVos
const index = approvalUse[approvalUse.length - 1].stepHandler.indexOf(',' + this.$store.getters.userId + ',')
console.log(approvalUse[approvalUse.length - 1].stepHandler)
console.log(index)
if (index > -1 && (row.judgeStat === 1 || row.judgeStat === 0)) {
return true
}
}
},
//
handleSelectionChange(val) {
this.moreaction = val
},
//
//
handleCommand(command) {
const ids = this.moreaction.map(item => item.id).join()
if (command === 'delete') {
this.$confirm(this.$t('prompt.scts'), this.$t('prompt.ts'), {
confirmButtonText: this.$t('prompt.qd'),
cancelButtonText: this.$t('prompt.qx'),
type: 'warning'
}).then(() => {
deleteCustomerProduct(ids, this.$store.getters.userId).then(res => {
if (res.data.ret === 200 || res.data.ret === 100) {
this.$notify({
title: this.$t('prompt.sccg'),
type: 'success',
offset: 100
})
this.getlist()
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('prompt.yqxsc')
})
})
}
},
//
handleDelete(row) {
this.$confirm(this.$t('prompt.scts'), this.$t('prompt.ts'), {
confirmButtonText: this.$t('prompt.qd'),
cancelButtonText: this.$t('prompt.qx'),
type: 'warning'
}).then(() => {
deleteCustomerProduct(row.id, this.$store.getters.userId).then(res => {
if (res.data.ret === 200 || res.data.ret === 100) {
this.$notify({
title: this.$t('prompt.sccg'),
type: 'success',
offset: 100
})
this.getlist()
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('prompt.yqxsc')
})
})
},
//
handleAdd() {
this.$router.push('/Customer/NewCustomerGroup')
},
//
handleExport() {
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
const filterVal = ['id', 'SaleOrderName', 'SaleOrderShortName', 'typeName', 'regionName', 'buyerName', 'levelName', 'createName', 'createTime']
const data = this.formatJson(filterVal, this.list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '经销商资料表'
})
this.downloadLoading = false
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
//
handlePrint() {
console.log(456)
}
}
}
</script>
<style rel="stylesheet/css" scoped>
.ERP-container >>> .el-form-item__label{
color: #909399;
text-align: left;
}
.app-container >>> .el-table .cell {
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 24px;
word-break: keep-all;
word-wrap: break-word;
white-space: pre-wrap;
}
.ERP-container {
margin-left:10px;
}
.filter-container{
padding: 20px;
padding-left: 0px;
}
.filter-item{
width: 180px;
margin-left: 10px;
padding: 10px 0;
}
.filter-item2{
width: 180px;
margin-left: 5px;
padding: 10px 0;
}
.box-card {
/* border : 1px solid #f1f1ff !important; */
border-bottom : 1px solid #f1f1ff00 !important
}
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
</style>

View file

@ -0,0 +1,237 @@
<template>
<div class="ERP-container">
<div class="app-container" style="padding-right: 0">
<!--基本信息-->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never">
<div ref="geren" class="form-name">{{ $t('Hmodule.basicinfo') }}</div>
<div class="container" style="margin-top: 25px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" size="mini" status-icon class="demo-ruleForm" label-position="left" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('update4.groupName')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.groupName" style="width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.khm')" prop="customerId" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="customerId" style="width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.stat')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-select v-model="personalForm.stat" style="width: 200px">
<el-option label="启用" value="1"/>
<el-option label="停用" value="2"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.summary')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.summary" style="width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never" style="margin-top: 5px">
<div ref="fuzhu" class="form-name" >{{ $t('updates.ddmx') }}</div>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="chooseProduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list"
:key="tableKey"
:edit-config="{ showIcon: true, showStatus: true}"
class="click-table1"
stripe
border
size="small"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.wpfl')" prop="productCategoryName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.jbdw')" prop="unit" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ggxh')" prop="productTypeName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" min-width="150px"/>
<el-editable-column :label="$t('StockOrder.currency')" :edit-render="{name: 'ElSelect', options: currencyList, type: 'visible'}" prop="currency" align="center" min-width="200px"/>
<el-editable-column :label="$t('update4.customerPrice')" :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" min-width="150px"/>
</el-editable>
</div>
</el-card>
<!--操作-->
<div class="buttons" style="position:fixed;bottom: 0;width: 100%;height: 40px; background: #fff;z-index:99">
<el-button :loading="saveloding" type="primary" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
</div>
</div>
</div>
</template>
<script>
import MyCustomer from '../SaleOrder/components/MyCustomer'
import MyDetail from './components/MyDetail'
import { addCustomerProduct } from '@/api/Customer'
export default {
name: 'NewCustomerGroup',
components: { MyCustomer, MyDetail },
data() {
const validatePass = (rule, value, callback) => {
if (this.customerId === undefined || this.customerId === null || this.customerId === '') {
callback(new Error('please select customer'))
} else {
callback()
}
}
return {
personalForm: {
stat: '1',
createId: this.$store.getters.userId,
countryId: this.$store.getters.countryId
},
personalrules: {
customerId: [
{ required: true, validator: validatePass, trigger: 'change' }
]
},
customercontrol: false,
customerId: '',
saveloding: false,
list: [],
control: false,
moreaction: '',
tableKey: 0,
currencyList: [{ value: 1, label: 'PHP' }, { value: 2, label: 'USD' }, { value: 3, label: 'RMB' }, { value: 4, label: 'LKR' }]
}
},
methods: {
//
handleSelectionChange(val) {
this.moreaction = val
},
productdetail(val) {
this.list = val
this.tableKey = Math.random()
},
chooseProduct() {
this.control = true
},
handlecancel() {
this.$router.go(-1)
const view = { path: '/Customer/NewCustomerGroup', name: 'NewCustomerGroup', fullPath: '/Customer/NewCustomerGroup', title: 'NewCustomerGroup' }
this.$store.dispatch('delView', view).then(({ visitedViews }) => {
})
},
clearForm() {
this.personalForm = {
stat: '1',
createId: this.$store.getters.userId,
countryId: this.$store.getters.countryId
}
this.customerId = ''
},
handlesave() {
if (this.list.length === 0) {
console.log(12333)
}
this.saveloding = true
setTimeout(() => {
const parms = JSON.stringify(this.personalForm)
const detailParms = JSON.stringify(this.list)
this.$refs.personalForm.validate((valid) => {
if (valid) {
addCustomerProduct(parms, detailParms).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.clearForm()
this.$refs.editable.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
this.saveloding = false
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.saveloding = false
return false
}
})
}, 1000)
},
customerdata(val) {
console.log(val)
this.customerId = val.customerName
this.personalForm.customerId = val.id
},
chooseCustomer() {
this.customercontrol = true
}
}
}
</script>
<style scoped>
.ERP-container{
margin-right: 0;
}
.form-name{
font-weight: bold;
font-size: 18px;
color: #373e4f;
padding: 5px;
margin-bottom: -20px;
}
.container{
margin-top: 5px;
}
.el-button+.el-button{
width: 98px;
}
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
</style>

View file

@ -0,0 +1,241 @@
<template>
<el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.id +$t('updates.xqing')" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)">
<div id="printTest" >
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('update4.groupName')" style="width: 100%;">
<span>{{ personalForm.groupName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.khm')" style="width: 100%;">
<span>{{ personalForm.customerName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.stat')" style="width: 100%;">
<span>{{ personalForm.stat | statFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.summary')" style="width: 100%;">
<span>{{ personalForm.summary }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never" style="margin-top: 5px">
<div ref="fuzhu" class="form-name" >{{ $t('updates.ddmx') }}</div>
<div class="container">
<el-editable
:data.sync="list"
class="click-table1"
stripe
border
size="small"
style="width: 100%">
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.wpfl')" prop="productCategoryName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.jbdw')" prop="unit" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ggxh')" prop="productTypeName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" min-width="150px"/>
<!-- <el-editable-column :label="$t('StockOrder.currency')" prop="currency" align="center" min-width="200px"/> -->
<el-editable-column :label="$t('update4.customerPrice')" prop="price" align="center" min-width="150px"/>
</el-editable>
</div>
</el-card>
<!--审核状态-->
</div>
</el-dialog>
</template>
<script>
// import { getPrintCount, addPrint } from '@/api/public'
// import printJS from 'print-js'
// import { productlist } from '@/api/public'
// import { searchprepReceipt } from '@/api/PrepReceipt'
// import { searchsaleOut } from '@/api/SaleOut'
var _that
export default {
filters: {
statFilter(status) {
const statusMap = {
1: '启用',
2: '停用'
}
return statusMap[status]
},
payTypeFilter(status) {
const statusMap = {
1: '方式1',
2: '方式2'
}
return statusMap[status]
},
payModeFilter(status) {
const statusMap = {
1: '货到付款',
2: '当场支付'
}
return statusMap[status]
},
invoiceTypeFilter(status) {
const statusMap = {
1: '无',
2: '增值税'
}
return statusMap[status]
},
customerTypeFliter(status) {
const statusMap = {
1: '经销商',
2: '零售商'
}
return statusMap[status]
},
statfilter(status) {
const statusMap = {
0: _that.$t('updates.wsh'),
1: _that.$t('updates.shz'),
2: _that.$t('Hmodule.shtg'),
3: _that.$t('Hmodule.shbtg')
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.cgsq'),
2: _that.$t('updates.cgxq'),
3: _that.$t('Hmodule.Nosource')
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
}
},
props: {
detailcontrol: {
type: Boolean,
default: false
},
detaildata: {
type: Object,
default: null
}
},
data() {
return {
//
tableData3: [],
saleOutparms: {
pageNum: 1,
pageSize: 9999,
sourceNumber: this.detaildata.number,
repositoryId: 0
},
//
tableData2: [],
//
heji1: '',
heji2: '',
//
reviewList: [],
//
list: [],
list3: [],
//
editVisible: this.detailcontrol,
//
personalForm: this.detaildata,
//
prepReceiptData: {
pageNum: 1,
pageSize: 9999,
sourceNumber: this.detaildata.number,
repositoryId: 0
}
}
},
watch: {
detailcontrol() {
this.editVisible = this.detailcontrol
},
detaildata() {
this.personalForm = this.detaildata
this.list = this.personalForm.customerProductGroupDetailVos
}
},
beforeCreate() {
_that = this
},
methods: {
}
}
</script>
<style scoped>
.edit >>> .el-dialog{
-webkit-transform: none;
transform: none;
position: absolute;
right: 0;
left: auto;
height: auto;
}
.edit >>> .el-dialog__header{
background: #fff;
position: fixed;
top: 0;
display: block;
width: 1010px;
z-index: 100;
border-bottom: 1px solid #f1f1f1;
}
.edit >>> .el-dialog__body{
padding-left: 0;
padding-right: 0;
padding-top: 10px;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
}
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.el-col-12{
width: 49%;
}
@media print {
.print {
display: none;
}
.print2 {
display: block !important;
}
}
</style>

View file

@ -0,0 +1,358 @@
<template>
<el-dialog :visible.sync="productVisible" :control="control" :close-on-press-escape="false" :title="$t('Hmodule.xzsp')" top="10px" append-to-body @close="$emit('update:control', false)">
<div class="filter-container">
<!-- 搜索条件栏目 -->
<el-input v-model="getemplist.code" :placeholder="$t('Product.code')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.productname" :placeholder="$t('Product.productname')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="supplierid" :placeholder="$t('Product.supplierid')" class="filter-item" clearable @keyup.enter.native="handleFilter" @clear="restFilter2" @focus="handlechoose"/>
<my-supplier :control.sync="empcontrol" @supplierName="supplierName"/>
<el-select v-model="getemplist.categoryid" :placeholder="$t('Hmodule.wpfl')" class="filter-item" clearable>
<el-option :label="$t('otherlanguage.zc')" value="1"/>
<el-option :label="$t('otherlanguage.pj')" value="2"/>
<el-option :label="$t('otherlanguage.jgj')" value="3"/>
<el-option :label="$t('otherlanguage.xhp')" value="4"/>
<el-option :label="$t('otherlanguage.dc')" value="5"/>
<el-option :label="$t('otherlanguage.xss')" value="6"/>
<el-option :label="$t('otherlanguage.pjj')" value="7"/>
<el-option :label="$t('otherlanguage.hj')" value="8"/>
</el-select>
<!-- 更多搜索条件下拉栏 -->
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="click">
<el-select v-model="getemplist.typeid" :placeholder="$t('Hmodule.qxzggxh')" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option
v-for="(item, index) in types"
:key="index"
:label="item.categoryName"
:value="item.id"
/>
</el-select>
<el-select v-model="getemplist.isactive" :placeholder="$t('Hmodule.qxzsxj')" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option :label="$t('Hmodule.s1')" value="1"/>
<el-option :label="$t('Hmodule.x2')" value="2"/>
</el-select>
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" style="float: right" @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-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" @click="handleFilter">{{ $t('public.search') }}</el-button>
<!-- 新建操作 -->
<el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</div>
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
ref="table"
:key="tableKey"
:data="list"
:height="tableHeight"
:row-key="getRowKeys"
size="small"
border
fit
highlight-current-row
style="width: 100%;"
@selection-change="handleSelectionChange">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column :label="$t('Product.code')" :resizable="false" prop="code" align="center" width="120">
<template slot-scope="scope">
<span>{{ scope.row.code }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.productname')" :resizable="false" prop="ProductName" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.categoryid')" :resizable="false" prop="category" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.category }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.typeid')" :resizable="false" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.productType }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.color')" :resizable="false" prop="color" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.color }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.kpigrade')" :resizable="false" prop="kpiGrade" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.kpiGrade }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.point')" :resizable="false" prop="point" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.point }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.saleprice')" :resizable="false" prop="costPrice" align="center" width="100">
<template slot-scope="scope">
<span>{{ scope.row.salePrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.purchaseprice')" :resizable="false" prop="purchasePrice" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.purchasePrice }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createid')" :resizable="false" prop="createName" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Product.createTime')" :resizable="false" prop="createTime" align="center" width="150">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pagenum" :limit.sync="getemplist.pagesize" style="padding: 0" @pagination="getlist" />
<span slot="footer" class="dialog-footer">
<div style="padding-top: 10px; text-align: left;">{{ $t('update4.yxz') }}{{ tiaoshu }}{{ $t('update4.tiao') }} </div>
<el-button v-waves type="success" style="text-align: center;" @click="handleAddTo">{{ $t('Hmodule.sure') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { chooseProduct, searchEmpCategory2 } from '@/api/Product'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import MySupplier from '../../Product/components/MySupplier'
import MyTree from '../../Product/components/MyTree' // Secondary package based on el-pagination
// eslint-disable-next-line no-unused-vars
var _that
export default {
directives: { waves },
components: { MyTree, MySupplier, Pagination },
filters: {
genderFilter(status) {
const statusMap = {
1: '男',
2: '女'
}
return statusMap[status]
}
},
props: {
control: {
type: Boolean,
default: false
},
personalform: {
type: Object,
default: null
}
},
data() {
return {
getRowKeys(row) {
return row.code
},
select_orderId: [],
select_order_number: [],
tiaoshu: 0,
tableHeight: 200,
//
query: this.personalform,
//
supplierid: '',
//
empcontrol: false,
//
types: [],
//
treecontrol: false,
//
categoryid: '',
//
productVisible: this.control,
//
visible2: false,
//
moreaction: '',
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
productid: '',
code: '',
productname: '',
categoryid: '',
typeid: '',
isactive: '',
Productid: '',
pagenum: 1,
pagesize: 10
}
}
},
watch: {
control() {
this.productVisible = this.control
console.log(this.control)
this.getlist()
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
}, 100)
},
personalform() {
this.query = this.personalform
console.log('this.query', this.query)
}
},
created() {
this.getlist()
},
beforeCreate() {
_that = this
},
methods: {
getlist() {
//
this.listLoading = true
this.getemplist.searchRepositoryId = ''
chooseProduct(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)
})
//
searchEmpCategory2(2).then(res => {
if (res.data.ret === 200) {
this.types = res.data.data.content.list
}
})
},
restFilter() {
this.categoryid = ''
this.getemplist.categoryid = ''
},
restFilter2() {
this.supplierid = ''
this.getemplist.supplierid = ''
},
//
handleFilter() {
this.getemplist.pagenum = 1
this.getemplist.searchRepositoryId = this.query.saleRepositoryId
chooseProduct(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()
}
})
},
//
handleSelectionChange(rows) {
this.moreaction = rows
this.tiaoshu = this.moreaction.length
this.select_order_number = this.moreaction.length
this.select_orderId = []
if (rows) {
rows.forEach(row => {
if (row) {
this.select_orderId.push(row.code)
}
})
}
},
// focus
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierid = val.supplierName
this.getemplist.supplierid = val.id
},
// focus
treechoose() {
this.treecontrol = true
},
//
tree(val) {
this.categoryid = val.categoryName
this.getemplist.categoryid = val.id
},
//
handleAdd() {
this.$router.push('/Product/NewProduct')
this.productVisible = false
},
//
handleAddTo() {
this.productVisible = false
console.log(this.moreaction)
const productDetail = this.moreaction.map(function(item) {
return {
productCode: item.code,
productName: item.productName,
productCategoryName: item.category,
productCategory: item.categoryId,
productTypeName: item.productType,
productType: item.productType,
typeId: item.typeId,
type: item.typeId,
color: item.color,
unit: item.saleMeasu,
price: item.salePrice,
currency: 3
}
})
console.log(productDetail)
this.$emit('product', productDetail)
}
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 150px;
margin-left: 20px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -0,0 +1,243 @@
<template>
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.id +$t('updates.xg')" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('update4.groupName')" style="width: 100%;">
<el-input v-model="personalForm.groupName" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.khm')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" style="margin-left: 18px;width: 200px" @focus="chooseCustomer"/>
<my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.stat')" style="width: 100%;">
<el-select v-model="personalForm.stat" style="margin-left: 18px;width: 200px">
<el-option label="启用" value="1"/>
<el-option label="停用" value="2"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.summary')" style="width: 100%;">
<el-input v-model="personalForm.summary" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" >{{ $t('updates.ddmx') }}</h2>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button @click="chooseProduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
</div>
<div class="container">
<el-editable
ref="editable"
:data.sync="list"
:key="tableKey"
:edit-config="{ showIcon: true, showStatus: true}"
class="click-table1"
stripe
border
size="small"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-editable-column type="selection" min-width="55" align="center"/>
<el-editable-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-editable-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" min-width="150px"/>
<el-editable-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.wpfl')" prop="productCategoryName" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.jbdw')" prop="unit" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ggxh')" prop="productType" align="center" min-width="150px"/>
<el-editable-column :label="$t('updates.ys')" prop="color" align="center" min-width="150px"/>
<el-editable-column :label="$t('StockOrder.currency')" :edit-render="{name: 'ElSelect', options: currencyList, type: 'visible'}" prop="currency" align="center" min-width="200px"/>
<el-editable-column :label="$t('update4.customerPrice')" :edit-render="{name: 'ElInputNumber', attrs: {min: 0}, type: 'visible'}" prop="price" align="center" min-width="150px"/>
</el-editable>
</div>
</el-card>
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
<el-button type="primary" @click="handleEditok()">{{ $t('Hmodule.baoc') }}</el-button>
</div>
</el-card>
</el-dialog>
</template>
<script>
import { updateCustomerProduct } from '@/api/Customer'
import MyCustomer from '../../SaleOrder/components/MyCustomer'
import MyDetail from './MyDetail'
var _that
export default {
components: { MyCustomer, MyDetail },
props: {
editcontrol: {
type: Boolean,
default: false
},
editdata: {
type: Object,
default: null
}
},
data() {
const validatePass = (rule, value, callback) => {
if (this.customerId === undefined || this.customerId === null || this.customerId === '') {
callback(new Error('please select customer'))
} else {
callback()
}
}
return {
//
editVisible: this.editcontrol,
//
personalForm: this.editdata,
personalrules: {
customerId: [
{ required: true, validator: validatePass, trigger: 'change' }
]
},
customercontrol: false,
customerId: '',
saveloding: false,
list: [],
control: false,
moreaction: '',
tableKey: 0,
currencyList: [{ value: 1, label: 'PHP' }, { value: 2, label: 'USD' }, { value: 3, label: 'RMB' }, { value: 4, label: 'LKR' }]
}
},
watch: {
editcontrol() {
this.editVisible = this.editcontrol
},
editdata() {
console.log(this.editdata)
this.personalForm = this.editdata
this.customerId = this.personalForm.customerName
this.list = this.personalForm.customerProductGroupDetailVos
this.tableKey = Math.random()
}
},
beforeCreate() {
_that = this
},
methods: {
//
handleSelectionChange(val) {
this.moreaction = val
},
customerdata(val) {
console.log(val)
this.customerId = val.customerName
this.personalForm.customerId = val.id
},
chooseCustomer() {
this.customercontrol = true
},
productdetail(val) {
this.list = val
this.tableKey = Math.random()
},
chooseProduct() {
this.control = true
},
handlecancel() {
this.editVisible = false
},
clearForm() {
this.personalForm = {
stat: '1',
createId: this.$store.getters.userId,
countryId: this.$store.getters.countryId
}
this.customerId = ''
},
deepClone(obj) {
const _obj = JSON.stringify(obj)
const objClone = JSON.parse(_obj)
return objClone
},
//
//
handleEditok() {
delete this.personalForm.customerProductGroupDetailVos
if (this.list.length === 0) {
console.log(12333)
}
const parms = JSON.stringify(this.personalForm)
const detailParms = JSON.stringify(this.$refs.editable.getRecords())
// console.log('this.list', this.$refs.editable.getRecords())
this.$refs.personalForm.validate((valid) => {
if (valid) {
updateCustomerProduct(parms, detailParms, this.$store.getters.userId).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: this.$t('prompt.czcg'),
message: this.$t('prompt.czcg'),
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.editVisible = false
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
return false
}
})
}
// -------------------------------------------------
}
}
</script>
<style scoped>
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
height: 100vh;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -246,7 +246,7 @@ export default {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()

View file

@ -245,7 +245,7 @@ export default {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()

View file

@ -112,7 +112,8 @@ export default {
6: _that.$t('update4.dingdantuik'),
7: _that.$t('update4.zhuanzhangcunk'),
8: _that.$t('update4.xiaoshoushoukuan'),
9: _that.$t('update4.huanhuodan')
9: _that.$t('update4.huanhuodan'),
10: _that.$t('route.saleRefund')
}
return statusMap[sta]
}

View file

@ -136,6 +136,12 @@
width="240"
sortable
align="center"/>
<el-table-column
:label="$t('route.saleRefund')"
prop="saleRefund"
width="240"
sortable
align="center"/>
<el-table-column
:label="$t('collectAndPay.payment')"
prop="payment"
@ -368,7 +374,7 @@ export default {
pageSize: 10,
type: '1',
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionId
regionIds: this.$store.getters.regionIds
},
//
personalForm: {},

View file

@ -742,7 +742,7 @@ export default {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -810,7 +810,7 @@ export default {
if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -854,7 +854,7 @@ export default {
}
if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -878,7 +878,7 @@ export default {
}
if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -1215,6 +1215,7 @@ export default {
})
return false
}
console.log('this.newcomarker.suretyPhone', this.newcomarker.suretyPhone)
if (this.newcomarker.suretyPhone.length !== 11 && (this.$store.getters.useCountry === 1 || this.$store.getters.useCountry === 2)) {
this.$notify.error({
title: 'wrong',
@ -1224,7 +1225,9 @@ export default {
return false
}
if ((this.newcomarker.suretyPhone.length !== 9 || this.newcomarker.suretyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
if ((this.newcomarker.suretyPhone.length !== 9 && this.newcomarker.suretyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
console.log('this.newcomarker.suretyPhone.length', this.newcomarker.suretyPhone.length)
this.$notify.error({
title: 'wrong',
message: this.$t('update4.dbrsjhcw'),
@ -1385,7 +1388,16 @@ export default {
console.log(response.data.content.picId)
},
handlesave2() {
if (this.personalForm.consultancyPhone.length !== 11) {
// if (this.personalForm.consultancyPhone.length !== 11) {
// this.$notify.error({
// title: 'wrong',
// message: 'consultancy Phone number is wrong',
// offset: 100
// })
// return false
// }
if (this.personalForm.consultancyPhone.length !== 11 && (this.$store.getters.useCountry === 1 || this.$store.getters.useCountry === 2)) {
this.$notify.error({
title: 'wrong',
message: 'consultancy Phone number is wrong',
@ -1393,6 +1405,18 @@ export default {
})
return false
}
if ((this.personalForm.consultancyPhone.length !== 9 && this.personalForm.consultancyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
console.log('this.personalForm.consultancyPhone.length', this.personalForm.consultancyPhone.length)
this.$notify.error({
title: 'wrong',
message: 'consultancy Phone number is wrong',
offset: 100
})
return false
}
if (this.personalForm.consultancyName !== null && this.personalForm.consultancyPhone !== null && this.personalForm.consultancyAddress !== null && this.personalForm.consultancyName !== '' && this.personalForm.consultancyPhone !== '' && this.personalForm.consultancyAddress !== '' && this.personalForm.consultancyName !== undefined && this.personalForm.consultancyPhone !== undefined && this.personalForm.consultancyAddress !== undefined) {
const lis = {}
lis.consultancyName = this.personalForm.consultancyName
@ -2216,7 +2240,6 @@ export default {
this.personalForm.consultancyAddressTwo = nowlistdata[1].consultancyAddress
}
}
this.isclick = true
const Data2 = this.productForm
for (const key in Data2) {
if (Data2[key] === '' || Data2[key] === undefined || Data2[key] === null) {
@ -2224,62 +2247,65 @@ export default {
}
}
const parms2 = JSON.stringify(Data2)
this.isclick = true
this.$refs.personalForm.validate((valid) => {
if (valid) {
setTimeout(() => {
this.$refs.personalForm.validate((valid) => {
if (valid) {
// this.$refs.upload.submit()
console.log('this.personalForm', this.personalForm)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
console.log('this.personalForm', this.personalForm)
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
}
console.log('Data2', Data)
const parms = JSON.stringify(Data)
console.log('parms', parms)
addinstallmentapply(parms, parms2, this.personalForm).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.isclick = false
this.restAllForm()
this.$refs.upload.clearFiles()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.$refs.personalForm3.clearValidate()
this.$refs.personalForm3.resetFields()
this.$refs.personalForm4.clearValidate()
this.$refs.personalForm4.resetFields()
this.$refs.personalForm5.clearValidate()
this.$refs.personalForm5.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
this.isclick = false
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.isclick = false
return false
}
console.log('Data2', Data)
const parms = JSON.stringify(Data)
console.log('parms', parms)
addinstallmentapply(parms, parms2, this.personalForm).then(res => {
console.log(res)
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.isclick = false
this.restAllForm()
this.$refs.upload.clearFiles()
this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.$refs.personalForm3.clearValidate()
this.$refs.personalForm3.resetFields()
this.$refs.personalForm4.clearValidate()
this.$refs.personalForm4.resetFields()
this.$refs.personalForm5.clearValidate()
this.$refs.personalForm5.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
this.isclick = false
}
})
} else {
this.$notify.error({
title: 'wrong',
message: 'Information is incomplete',
offset: 100
})
this.isclick = false
return false
}
})
})
}, 1000)
},
//
handlecancel() {

View file

@ -743,7 +743,7 @@ export default {
}
if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -765,7 +765,7 @@ export default {
if (String(value).length !== 10 && (this.$store.getters.useCountry === 3 || this.$store.getters.useCountry === 4)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else if (String(value).length !== 9 && (this.$store.getters.useCountry === 5)) {
} else if (String(value).length !== 9 && String(value).length !== 10 && (this.$store.getters.useCountry === 5)) {
callback(new Error(_that.$t('prompt.qsrzqdsjh')))
} else {
callback()
@ -1071,7 +1071,7 @@ export default {
})
return false
}
if ((this.newcomarker.suretyPhone.length !== 9 || this.newcomarker.suretyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
if ((this.newcomarker.suretyPhone.length !== 9 && this.newcomarker.suretyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.dbrsjhcw'),
@ -1225,6 +1225,22 @@ export default {
}
},
handlesave2() {
if (this.personalForm.consultancyPhone.length !== 11 && (this.$store.getters.useCountry === 1 || this.$store.getters.useCountry === 2)) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.dbrsjhcw'),
offset: 100
})
return false
}
if ((this.personalForm.consultancyPhone.length !== 9 && this.personalForm.consultancyPhone.length !== 10) && (this.$store.getters.useCountry === 5)) {
this.$notify.error({
title: 'wrong',
message: this.$t('update4.dbrsjhcw'),
offset: 100
})
return false
}
if (this.personalForm.consultancyName !== null && this.personalForm.consultancyPhone !== null && this.personalForm.consultancyAddress !== null && this.personalForm.consultancyName !== '' && this.personalForm.consultancyPhone !== '' && this.personalForm.consultancyAddress !== '' && this.personalForm.consultancyName !== undefined && this.personalForm.consultancyPhone !== undefined && this.personalForm.consultancyAddress !== undefined) {
const lis = {}
lis.consultancyName = this.personalForm.consultancyName

View file

@ -293,8 +293,8 @@ export default {
this.getlist()
} else {
this.$message({
type: 'success',
message: this.$t('prompt.fspcg')
type: 'error',
message: res.data.msg
})
}
})
@ -326,6 +326,11 @@ export default {
message: this.$t('prompt.fjdcg')
})
this.getlist()
} else {
this.$message({
type: 'error',
message: res.data.msg
})
}
})
})
@ -356,6 +361,11 @@ export default {
message: this.$t('prompt.jdcg')
})
this.getlist()
} else {
this.$message({
type: 'error',
message: res.data.msg
})
}
})
})
@ -479,6 +489,11 @@ export default {
message: this.$t('prompt.shcg')
})
this.getlist()
} else {
this.$message({
type: 'error',
message: res.data.msg
})
}
})
}).catch(action => {
@ -499,6 +514,11 @@ export default {
message: this.$t('prompt.shcg')
})
this.getlist()
} else {
this.$message({
type: 'error',
message: res.data.msg
})
}
})
})

View file

@ -132,7 +132,7 @@
</el-editable-column>
<el-editable-column :edit-render="{name: 'ElSelect',type: 'default'}" :label="$t('Hmodule.pc')" prop="batch" align="center" width="200px">
<template slot-scope="scope">
<el-select v-model="scope.row.batch" :value="scope.row.batch" :placeholder="$t('Hmodule.xcpc')" filterable clearable style="width: 100%;" @visible-change="updatebatch2($event,scope)">
<el-select v-model="scope.row.batch" :value="scope.row.batch" :placeholder="$t('Hmodule.xcpc')" filterable style="width: 100%;" @visible-change="updatebatch2($event,scope)">
<el-option
v-for="(item, index) in batchlist"
:key="index"

View file

@ -14,7 +14,7 @@
</el-col>
<el-col :span="6">
<el-form-item :label="$t('ProduceTask.sourceType')" prop="sourceType" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px" @change="chooseType">
<el-select v-model="personalForm.sourceType" style="width: 200px" @change="chooseType">
<el-option value="1" label="主生产计划" />
<el-option value="2" label="无来源" />
<el-option value="3" label="生产需求" />

View file

@ -66,6 +66,7 @@
<el-editable
ref="editable"
:data.sync="list2"
:key="tableKey"
:edit-config="{ showIcon: true, showStatus: true}"
:edit-rules="validRules"
class="click-table1"
@ -138,6 +139,7 @@ export default {
}
}
return {
tableKey: 0,
standardIds: [],
//
editVisible: this.editcontrol,
@ -312,21 +314,24 @@ export default {
},
//
productdetail(val) {
this.$refs.editable.clear()
// this.$refs.editable.clear()
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].productCode === nowlistdata[j].productCode) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.wpytj'),
offset: 100
})
return false
}
}
this.$refs.editable.insert(val[i])
}
// for (let i = 0; i < val.length; i++) {
// for (let j = 0; j < nowlistdata.length; j++) {
// if (val[i].productCode === nowlistdata[j].productCode) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.wpytj'),
// offset: 100
// })
// return false
// }
// }
// this.$refs.editable.insert(val[i])
// }
this.list2 = [...nowlistdata, ...val]
this.tableKey = Math.random()
},
//
handleAddSouce() {
@ -496,6 +501,7 @@ export default {
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
height: 100vh;
}
.el-col-12{
width: 49%;

View file

@ -611,9 +611,12 @@ export default {
})
},
baseMoney() {
const nowMonth = new Date()
console.log('nowMonth', nowMonth.getMonth() + 1)
queryProduceMonthExpenses(nowMonth.getMonth() + 1).then(res => {
const date = new Date()
const year = date.getFullYear()
const month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)
console.log('month', month)
const parms = year + '-' + month
queryProduceMonthExpenses(parms).then(res => {
console.log('res', res)
if (res.data.data.content) {
this.baseMoneyform.personExpenses = res.data.data.content.personExpenses

View file

@ -221,6 +221,7 @@ export default {
message: 'returnMoney is wrong',
offset: 100
})
return false
}
this.saveloding = true
setTimeout(() => {

View file

@ -686,6 +686,15 @@ export default {
delete this.personalForm.receiptStat
delete this.personalForm.approvalUseVos
if (Number(this.personalForm.receiptMoney) < Number(this.personalForm.returnMoney)) {
this.$notify.error({
title: 'wrong',
message: 'returnMoney is wrong',
offset: 100
})
return false
}
this.$refs.personalForm.validate((valid) => {
if (valid) {
const parms = JSON.stringify(this.personalForm)

View file

@ -2754,248 +2754,248 @@ export default {
return objClone
},
//
handlesave2() {
if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
this.personalForm.couponSupportOld = 0
}
const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
//
let m = 1
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
const re = elem.productCode.slice(0, 2)
if (re === '01') {
if (elem.carCode === null || elem.carCode === undefined || elem.carCode === '' || elem.motorCode === null || elem.motorCode === undefined || elem.motorCode === '') {
m = 2
}
}
if (re === '05') {
if (elem.batteryCode === null || elem.batteryCode === undefined || elem.batteryCode === '') {
m = 3
}
}
})
if (m === 3) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.dcckytbm'),
offset: 100
})
return false
}
if (m === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.zcckytbm'),
offset: 100
})
return false
}
//
let i = 0
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
EnterDetail.map(function(elem2) {
return elem2
}).forEach(function(elem2) {
if (elem2.productCode === elem.productCode && elem2.batch === elem.batch) {
const re = elem2.productCode.slice(0, 2)
//
if (re !== '01') {
i++
}
}
})
})
if (i > EnterDetail.length) {
this.$notify.error({
title: 'wrong',
message: 'same product can not have same batch',
offset: 100
})
return false
}
//
let j = 1
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.batch === null || elem.batch === undefined || elem.batch === '' || elem.location === null || elem.location === undefined || elem.location === '') {
j = 2
}
})
if (j === 2) {
this.$notify.error({
title: 'wrong',
message: this.$t('prompt.pchwbnwk'),
offset: 100
})
return false
}
// const EnterDetail2 = this.deepClone(this.$refs.editable2.getRecords())
if (EnterDetail.length === 0) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.mxbbnwk'),
// offset: 100
// })
// return false
}
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}
if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
delete elem.productName
}
if (elem.category === null || elem.category === '' || elem.category === undefined) {
delete elem.category
}
if (elem.type === null || elem.type === '' || elem.type === undefined) {
delete elem.type
}
if (elem.batch === '不使用') {
delete elem.batch
}
if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
delete elem.unit
}
if (elem.color === null || elem.color === '' || elem.color === undefined) {
delete elem.color
}
if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
delete elem.kpiGrade
}
if (elem.point === null || elem.point === '' || elem.point === undefined) {
delete elem.point
}
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
elem.quantity = 0
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
elem.salePrice = 0
}
if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
elem.costPrice = 0
}
if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
elem.costMoney = 0
}
if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
delete elem.includeTaxMoney
}
if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
elem.taxRate = 0
}
if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
elem.taxRate = elem.taxRate / 100
}
if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
elem.taxMoney = 0
}
if (elem.money === null || elem.money === '' || elem.money === undefined) {
elem.money = 0
}
if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
elem.includeTaxCostMoney = 0
}
if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
elem.discountRate = 0
}
if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
elem.discountRate = elem.discountRate / 100
}
if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
elem.discountMoney = 0
}
if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
delete elem.carCode
}
if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
delete elem.motorCode
}
if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
delete elem.batteryCode
}
return elem
})
const parms3 = ''
let couponNumbers = ''
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
}
}
couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
this.personalForm.couponNumbers = couponNumbers
if (this.personalForm.shouldMoney === '' || this.personalForm.shouldMoney === undefined || this.personalForm.shouldMoney === null) {
// this.$notify.error({
// title: 'wrong',
// message: '',
// offset: 100
// })
// return false
this.personalForm.shouldMoney = 0
}
if (this.personalForm.isFree === 1) {
this.personalForm.taxMoney = 0
this.personalForm.includeTaxMoney = 0
this.personalForm.money = 0
this.personalForm.shouldMoney = 0
this.personalForm.discount_money = 0
this.personalForm.actualMoney = 0
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
elem.money = 0
elem.taxprice = 0
elem.includeTaxMoney = 0
elem.includeTaxCostMoney = 0
elem.salePrice = 0
})
}
const parms2 = JSON.stringify(EnterDetail)
this.personalForm.judgeStat = 4
const Data = this.personalForm
for (const key in Data) {
if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
delete Data[key]
}
// if (key === 'judgeStat') {
// delete Data[key]
// }
}
const parms = JSON.stringify(Data)
createsaleOut(parms, parms2, parms3, this.personalForm, this.personalForm.receivableMoney2).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.restAllForm()
this.$refs.editable.clear()
// this.$refs.editable2.clear()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.$refs.personalForm3.clearValidate()
this.$refs.personalForm3.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
})
},
// handlesave2() {
// if (this.personalForm.couponSupportOld === null || this.personalForm.couponSupportOld === '' || this.personalForm.couponSupportOld === undefined) {
// this.personalForm.couponSupportOld = 0
// }
// const EnterDetail = this.deepClone(this.$refs.editable.getRecords())
// //
// let m = 1
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// const re = elem.productCode.slice(0, 2)
// if (re === '01') {
// if (elem.carCode === null || elem.carCode === undefined || elem.carCode === '' || elem.motorCode === null || elem.motorCode === undefined || elem.motorCode === '') {
// m = 2
// }
// }
// if (re === '05') {
// if (elem.batteryCode === null || elem.batteryCode === undefined || elem.batteryCode === '') {
// m = 3
// }
// }
// })
// if (m === 3) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.dcckytbm'),
// offset: 100
// })
// return false
// }
// if (m === 2) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.zcckytbm'),
// offset: 100
// })
// return false
// }
// //
// let i = 0
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// EnterDetail.map(function(elem2) {
// return elem2
// }).forEach(function(elem2) {
// if (elem2.productCode === elem.productCode && elem2.batch === elem.batch) {
// const re = elem2.productCode.slice(0, 2)
// //
// if (re !== '01') {
// i++
// }
// }
// })
// })
// if (i > EnterDetail.length) {
// this.$notify.error({
// title: 'wrong',
// message: 'same product can not have same batch',
// offset: 100
// })
// return false
// }
// //
// let j = 1
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// if (elem.batch === null || elem.batch === undefined || elem.batch === '' || elem.location === null || elem.location === undefined || elem.location === '') {
// j = 2
// }
// })
// if (j === 2) {
// this.$notify.error({
// title: 'wrong',
// message: this.$t('prompt.pchwbnwk'),
// offset: 100
// })
// return false
// }
// // const EnterDetail2 = this.deepClone(this.$refs.editable2.getRecords())
// if (EnterDetail.length === 0) {
// // this.$notify.error({
// // title: 'wrong',
// // message: this.$t('prompt.mxbbnwk'),
// // offset: 100
// // })
// // return false
// }
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
// delete elem.productCode
// }
// if (elem.productName === null || elem.productName === '' || elem.productName === undefined) {
// delete elem.productName
// }
// if (elem.category === null || elem.category === '' || elem.category === undefined) {
// delete elem.category
// }
// if (elem.type === null || elem.type === '' || elem.type === undefined) {
// delete elem.type
// }
// if (elem.batch === '使') {
// delete elem.batch
// }
// if (elem.unit === null || elem.unit === '' || elem.unit === undefined) {
// delete elem.unit
// }
// if (elem.color === null || elem.color === '' || elem.color === undefined) {
// delete elem.color
// }
// if (elem.kpiGrade === null || elem.kpiGrade === '' || elem.kpiGrade === undefined) {
// delete elem.kpiGrade
// }
// if (elem.point === null || elem.point === '' || elem.point === undefined) {
// delete elem.point
// }
// if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
// elem.quantity = 0
// }
// if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
// elem.salePrice = 0
// }
// if (elem.costPrice === null || elem.costPrice === '' || elem.costPrice === undefined) {
// elem.costPrice = 0
// }
// if (elem.costMoney === null || elem.costMoney === '' || elem.costMoney === undefined) {
// elem.costMoney = 0
// }
// if (elem.includeTaxMoney === null || elem.includeTaxMoney === '' || elem.includeTaxMoney === undefined) {
// delete elem.includeTaxMoney
// }
// if (elem.taxRate === null || elem.taxRate === '' || elem.taxRate === undefined) {
// elem.taxRate = 0
// }
// if (elem.taxRate !== null || elem.taxRate !== '' || elem.taxRate !== undefined) {
// elem.taxRate = elem.taxRate / 100
// }
// if (elem.taxMoney === null || elem.taxMoney === '' || elem.taxMoney === undefined) {
// elem.taxMoney = 0
// }
// if (elem.money === null || elem.money === '' || elem.money === undefined) {
// elem.money = 0
// }
// if (elem.includeTaxCostMoney === null || elem.includeTaxCostMoney === '' || elem.includeTaxCostMoney === undefined) {
// elem.includeTaxCostMoney = 0
// }
// if (elem.discountRate === null || elem.discountRate === '' || elem.discountRate === undefined) {
// elem.discountRate = 0
// }
// if (elem.discountRate !== null || elem.discountRate !== '' || elem.discountRate !== undefined) {
// elem.discountRate = elem.discountRate / 100
// }
// if (elem.discountMoney === null || elem.discountMoney === '' || elem.discountMoney === undefined) {
// elem.discountMoney = 0
// }
// if (elem.carCode === null || elem.carCode === '' || elem.carCode === undefined) {
// delete elem.carCode
// }
// if (elem.motorCode === null || elem.motorCode === '' || elem.motorCode === undefined) {
// delete elem.motorCode
// }
// if (elem.batteryCode === null || elem.batteryCode === '' || elem.batteryCode === undefined) {
// delete elem.batteryCode
// }
// return elem
// })
// const parms3 = ''
// let couponNumbers = ''
// for (let i = 0; i < this.personalForm.couponSupports.length; i++) {
// if (this.personalForm.couponSupports[i].couponSupport !== 0 && this.personalForm.couponSupports[i].couponSupport !== '') {
// couponNumbers = couponNumbers + this.personalForm.couponSupports[i].couponSupport + ','
// }
// }
// couponNumbers = couponNumbers.substring(0, couponNumbers.length - 1)
// this.personalForm.couponNumbers = couponNumbers
// if (this.personalForm.shouldMoney === '' || this.personalForm.shouldMoney === undefined || this.personalForm.shouldMoney === null) {
// // this.$notify.error({
// // title: 'wrong',
// // message: '',
// // offset: 100
// // })
// // return false
// this.personalForm.shouldMoney = 0
// }
// if (this.personalForm.isFree === 1) {
// this.personalForm.taxMoney = 0
// this.personalForm.includeTaxMoney = 0
// this.personalForm.money = 0
// this.personalForm.shouldMoney = 0
// this.personalForm.discount_money = 0
// this.personalForm.actualMoney = 0
// EnterDetail.map(function(elem) {
// return elem
// }).forEach(function(elem) {
// elem.money = 0
// elem.taxprice = 0
// elem.includeTaxMoney = 0
// elem.includeTaxCostMoney = 0
// elem.salePrice = 0
// })
// }
// const parms2 = JSON.stringify(EnterDetail)
// this.personalForm.judgeStat = 4
// const Data = this.personalForm
// for (const key in Data) {
// if (Data[key] === '' || Data[key] === undefined || Data[key] === null) {
// delete Data[key]
// }
// // if (key === 'judgeStat') {
// // delete Data[key]
// // }
// }
// const parms = JSON.stringify(Data)
// createsaleOut(parms, parms2, parms3, this.personalForm, this.personalForm.receivableMoney2).then(res => {
// if (res.data.ret === 200) {
// this.$notify({
// title: 'successful',
// message: 'save successful',
// type: 'success',
// offset: 100
// })
// this.restAllForm()
// this.$refs.editable.clear()
// // this.$refs.editable2.clear()
// this.$refs.personalForm.clearValidate()
// this.$refs.personalForm.resetFields()
// this.$refs.personalForm2.clearValidate()
// this.$refs.personalForm2.resetFields()
// this.$refs.personalForm3.clearValidate()
// this.$refs.personalForm3.resetFields()
// } else {
// this.$notify.error({
// title: 'wrong',
// message: res.data.msg,
// offset: 100
// })
// }
// })
// },
//
async handlesave() {
if (!this.personalForm.couponRemark && this.personalForm.couponSupportOld !== 0) {
@ -3360,6 +3360,9 @@ export default {
return false
}
let x = 1
const that = this
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
@ -3393,6 +3396,12 @@ export default {
if (elem.quantity === null || elem.quantity === '' || elem.quantity === undefined) {
elem.quantity = 1
}
console.log('elem.quantity', elem.quantity)
console.log('that.personalForm.isFree ', that.personalForm.isFree)
if (elem.quantity === 0 && that.personalForm.isFree === 1) {
x = 2
}
if (elem.salePrice === null || elem.salePrice === '' || elem.salePrice === undefined) {
elem.salePrice = 0
}
@ -3478,6 +3487,17 @@ export default {
}
return elem
})
if (x === 2) {
this.$notify.error({
title: 'wrong',
message: 'quantity is wrong',
offset: 100
})
this.saveloading = false
return false
}
const parms3 = ''
let couponNumbers = ''
for (let i = 0; i < this.personalForm.couponSupports.length; i++) {

View file

@ -893,7 +893,7 @@ export default {
row.taxMoney = row.salePrice * row.returnQuantity * (row.taxRate / 100)
row.money = (row.salePrice * row.returnQuantity + Number(row.taxMoney)).toFixed(6)
row.includeTaxMoney = (row.salePrice * row.returnQuantity + Number(row.salePrice * row.returnQuantity * (row.taxRate / 100))).toFixed(6)
row.discountMoney = (row.OriginalDiscountMont * row.returnQuantity).toFixed(6)
row.discountMoney = (row.salePrice * row.quantity * (1 - row.discount / 100)).toFixed(6)
return row.returnQuantity
}

View file

@ -18,6 +18,7 @@
<el-option :label="$t('updates.cgdhd')" value="1" />
<el-option :label="$t('updates.cgdd')" value="2" />
<el-option :label="$t('Hmodule.Nosource')" value="3" />
</el-select>
</el-form-item>
</el-col>
@ -27,7 +28,7 @@
</el-form-item>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
</el-col>
<el-col :span="6">
<el-col v-if="personalForm.sourceType !== '3'" :span="6">
<el-form-item label="源单编号" prop="sourceNumber" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.sourceNumber" style="width: 200px" @focus="handleAddSouce"/>
</el-form-item>
@ -104,6 +105,8 @@
<div ref="fuzhu" class="form-name">{{ $t('updates.rkdmx') }}</div>
<div class="buttons" style="margin-top: 35px;margin-bottom: 10px;">
<el-button v-if="personalForm.sourceType !== '3'" type="success" style="background:#3696fd;border-color:#3696fd " @click="handleAddproduct">{{ $t('Hmodule.tjsp') }}</el-button>
<my-detail :control.sync="control" @product="productdetail"/>
<el-button type="danger" @click="$refs.editable.removeSelecteds()">{{ $t('Hmodule.delete') }}</el-button>
<el-button type="primary" @click="checkStock()">{{ $t('updates.kckz') }}</el-button>
</div>

View file

@ -461,12 +461,13 @@ export default {
}
console.log(row.data.id)
console.log(row.id)
const confirmPersonId = this.$store.getters.userId
const query = JSON.stringify(row.data)
const that = this
editStoragein(query).then(res => {
console.log(res)
if (res.data.ret === 200) {
confirmStoragein(row.data.id).then(res => {
confirmStoragein(row.data.id, confirmPersonId).then(res => {
console.log(res)
if (res.data.ret === 200) {
row.data.stat = 2

View file

@ -890,10 +890,11 @@ export default {
console.log(row)
const query = JSON.stringify(EnterDetail)
const that = this
const confirmPersonId = this.$store.getters.userId
editStoragemove(query).then(res => {
console.log(res)
if (res.data.ret === 200) {
confirmStoragemove(row.data.id).then(res => {
confirmStoragemove(row.data.id, confirmPersonId).then(res => {
// console.log(res)
// row.data.stat = 2
// this.ischeck = false

View file

@ -364,6 +364,11 @@ export default {
message: this.$t('prompt.fjdcg')
})
this.getlist()
} else {
this.$message({
type: 'success',
message: res.data.msg
})
}
})
})
@ -394,6 +399,11 @@ export default {
message: this.$t('prompt.jdcg')
})
this.getlist()
} else {
this.$message({
type: 'success',
message: res.data.msg
})
}
})
})
@ -586,7 +596,7 @@ export default {
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
message: res.data.msg,
offset: 100
})
}
@ -617,7 +627,7 @@ export default {
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
message: res.data.msg,
offset: 100
})
}

View file

@ -0,0 +1,458 @@
<template>
<el-dialog :visible.sync="editVisible" :detailcontrol="detailcontrol" :detaildata="detaildata" :close-on-press-escape="false" :title="personalForm.refundNumber +$t('updates.xqing')" append-to-body width="1010px" class="edit" top="-10px" @close="$emit('update:detailcontrol', false)">
<div id="printTest" >
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
<!-- <button v-if="personalForm.judgeStat !== 0 || personalForm.judgeStat !== 3" class="print" style="font-size: 13px;background: white;" @click="printdata">{{ $t('updates.print') }}</button>
<button v-if="personalForm.sourceType === 1" style="font-size: 10px;margin-left: 10px" @click="handleMyReceipt2()">{{ $t('updates.fzdj') }}</button> -->
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('update4.refundTitle')" style="width: 100%;">
<span>{{ personalForm.title }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('ProduceTask.sourceType')" style="width: 100%;">
<span>{{ personalForm.sourceType | sourceTypeFilter }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" style="width: 100%;">
<span>{{ personalForm.sourceNumber }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="width: 100%;">
<span>{{ personalForm.customerName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.tuikuanjine')" style="width: 100%;">
<span>{{ personalForm.refundMoney }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="width: 100%;">
<span>{{ personalForm.refundRepositoryName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('CostInvoice.handlePersonId')" style="width: 100%;">
<span>{{ personalForm.handlePersonName }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="fuzhu" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('updates.spjl') }}</h2>
<div class="container" style="margin-top: 37px">
<el-table
:data="reviewList"
border
style="width: 100%">
<el-table-column
:label="$t('updates.dqbz')"
prop="step"
align="center"
min-width="150"/>
<el-table-column
:label="$t('updates.dqspr')"
prop="stepHandlerName"
align="center"
min-width="150"/>
<el-table-column
:label="$t('updates.spsj')"
prop="handleTime"
align="center"
min-width="150"/>
<el-table-column
:label="$t('updates.spyj')"
prop="stat"
align="center"
min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.stat | statfilter }}</span>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('updates.bzxx') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form :model="personalForm" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('public.createPersonName2')" prop="stockType" style="width: 100%;">
{{ personalForm.createPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.createDate2')" style="width: 100%;">
{{ personalForm.createDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.endPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.endDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.endDate }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyPersonName')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyPersonName }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('public.modifyDate')" prop="applyDate" style="width: 100%;">
{{ personalForm.modifyDate }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
</div>
</el-dialog>
</template>
<script>
import { getPrintCount, addPrint } from '@/api/public'
import printJS from 'print-js'
var _that
export default {
filters: {
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.sxckd'),
2: _that.$t('route.Receipt')
}
return statusMap[status]
}
},
props: {
detailcontrol: {
type: Boolean,
default: false
},
detaildata: {
type: Object,
default: null
}
},
data() {
return {
//
editVisible: this.detailcontrol,
//
personalForm: this.detaildata,
reviewList: []
}
},
watch: {
detailcontrol() {
this.editVisible = this.detailcontrol
},
detaildata() {
this.personalForm = this.detaildata
this.reviewList = []
const review = this.personalForm.approvalUseVos
for (const i in review) {
if (review[i].actualStepHandler !== null) {
this.reviewList.push(review[i])
}
}
}
},
beforeCreate() {
_that = this
},
methods: {
handlecancel() {
this.editVisible = false
},
cutnull(data) {
for (const x in data) {
if (data[x] === null) { // null ''
data[x] = ''
} else {
if (Array.isArray(data[x])) { //
data[x] = data[x].map(z => {
return this.cutnull(z)
})
}
if (typeof (data[x]) === 'object') { // json
data[x] = this.cutnull(data[x])
}
}
}
return data
},
async printdata() {
const arr = this.cutnull(this.list2)
for (const i in arr) {
arr[i].step = Number(i) + 1
}
const handleperson = this.reviewList.map(item => {
if (item.actualStepHandler) {
return item.stepHandlerName
}
}).join(',')
console.log(handleperson)
//
//
const param = {}
param.receiptId = this.personalForm.id
param.receiptTypeId = 29
//
const value = ['1-386-82']
const roles = this.$store.getters && this.$store.getters.roles
const permissionRoles = value
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
console.log('hasPermission=======', hasPermission)
if (hasPermission) {
printJS({
printable: arr,
type: 'json',
properties: [
{ field: 'step', displayName: '行号', columnSize: `100px` },
{ field: 'productCode', displayName: '物料代码', columnSize: `100px` },
{ field: 'productName', displayName: '物料名称', columnSize: `100px` },
{ field: 'productTypeName', displayName: '规格型号', columnSize: `100px` },
{ field: 'unit', displayName: '单位', columnSize: `100px` },
{ field: 'quantity', displayName: '订单数量', columnSize: `100px` },
{ field: 'deliveryDate', displayName: '需求日期', columnSize: `100px` }
],
header: `<div class="pringtitle">
<div class="custom-p"> 江苏嗯哇科技有限公司 </div>
<br>
<div class="ordername">销售订单列表</div>
<br>
<div class="line1"></div>
<div class="line2"></div>
<div class="supplier">
<div class="item">
<div class="itemname">客户名称</div>
<div class="itemcontent">${this.personalForm.customerName}</div>
</div>
<div class="item">
<div class="itemname">送货日期</div>
<div class="itemcontent">${this.personalForm.transDate}</div>
</div>
<div class="item">
<div class="itemname">订单编号</div>
<div class="itemcontent">${this.personalForm.number}</div>
</div>
</div>
</div>`,
bottom: `<div>
<div class="allmoney" style="display: flex;justify-content: space-around;width: 99%;height: 40px;align-items: center;border:1px solid;border-top: none;padding-right: 1%">
</div>
<div class="printbottom" style="display: flex;align-items: center;justify-content: center;width: 100%;margin-top: 20px">
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">审核</div>
<div class="bottomname" >${handleperson}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">部门</div>
<div class="bottomname">${this.personalForm.deptName || ''}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">业务员</div>
<div class="bottomname">${this.personalForm.salePersonName}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">制单</div>
<div class="bottomname">${this.personalForm.createPersonName}</div>
</div>
</div>
</div>`,
bottomStyle: '.printbottom: { display: flex;margin-top: 20px}',
style: '.custom-p {font-size:20px;text-align: center; }' +
' .ordername {text-align: center; font-size:25px;letter-spacing:15px}' +
'.pringtitle { line-height: 20px; margin-bottom: 10px }' +
'.line1 { width: 200px; border: 1px solid #000; margin: 0 auto }' +
'.line2 {width: 200px; border: 2px dashed #000; margin: 3px auto }' +
'.supplier {display: flex;justify-content: center; align-items: center;margin-top: 10px}' +
'.item { width: 33%; justify-content: center; align-items: center; display: flex}' +
'.item2 { width: 50%; justify-content: center; align-items: center; display: flex}' +
'.itemname2 { width: 20% }' +
'.itemcontent2 {width: 80%}' +
'.itemname { width: 40% }' +
'.itemcontent {width: 80%}',
gridHeaderStyle: 'font-size:12px; padding:3px; border:1px solid; color: #000; text-align:center;',
gridStyle: 'font-size:12px; padding:3px; border:1px solid; text-align:center; text-overflow:ellipsis; white-space:nowrap;',
repeatTableHeader: true
})
} else {
const printres = await getPrintCount(param)
if (printres.data.ret === 200) {
const res2 = printres.data.data.content
if (res2 !== null && res2.printCount > 0) {
this.$message.error('打印次数已经消耗完')
return false
}
}
this.$confirm('该单据只能打印一次,是否确认打印?(此操作为不可逆操作)', 'Warning', {
distinguishCancelAndClose: true,
confirmButtonText: '确认',
cancelButtonText: '取消'
})
.then(() => {
param.opreaterId = this.$store.getters.userId
// await
addPrint(param).then(res => {
if (res.data.ret === 200) {
const res = res.data.data.content
console.log('res', res)
}
})
printJS({
printable: arr,
type: 'json',
properties: [
{ field: 'step', displayName: '行号', columnSize: `100px` },
{ field: 'productCode', displayName: '物料代码', columnSize: `100px` },
{ field: 'productName', displayName: '物料名称', columnSize: `100px` },
{ field: 'productTypeName', displayName: '规格型号', columnSize: `100px` },
{ field: 'unit', displayName: '单位', columnSize: `100px` },
{ field: 'quantity', displayName: '订单数量', columnSize: `100px` },
{ field: 'deliveryDate', displayName: '需求日期', columnSize: `100px` }
],
header: `<div class="pringtitle">
<div class="custom-p"> 江苏嗯哇科技有限公司 </div>
<br>
<div class="ordername">销售订单列表</div>
<br>
<div class="line1"></div>
<div class="line2"></div>
<div class="supplier">
<div class="item">
<div class="itemname">客户名称</div>
<div class="itemcontent">${this.personalForm.customerName}</div>
</div>
<div class="item">
<div class="itemname">送货日期</div>
<div class="itemcontent">${this.personalForm.transDate}</div>
</div>
<div class="item">
<div class="itemname">订单编号</div>
<div class="itemcontent">${this.personalForm.number}</div>
</div>
</div>
</div>`,
bottom: `<div>
<div class="allmoney" style="display: flex;justify-content: space-around;width: 99%;height: 40px;align-items: center;border:1px solid;border-top: none;padding-right: 1%">
</div>
<div class="printbottom" style="display: flex;align-items: center;justify-content: center;width: 100%;margin-top: 20px">
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">审核</div>
<div class="bottomname" >${handleperson}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">部门</div>
<div class="bottomname">${this.personalForm.deptName || ''}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">业务员</div>
<div class="bottomname">${this.personalForm.salePersonName}</div>
</div>
<div class="bottomitem" style="width: 25%;display: flex;align-items: center;justify-content: center;flex-wrap: nowrap">
<div class="ceshi">制单</div>
<div class="bottomname">${this.personalForm.createPersonName}</div>
</div>
</div>
</div>`,
bottomStyle: '.printbottom: { display: flex;margin-top: 20px}',
style: '.custom-p {font-size:20px;text-align: center; }' +
' .ordername {text-align: center; font-size:25px;letter-spacing:15px}' +
'.pringtitle { line-height: 20px; margin-bottom: 10px }' +
'.line1 { width: 200px; border: 1px solid #000; margin: 0 auto }' +
'.line2 {width: 200px; border: 2px dashed #000; margin: 3px auto }' +
'.supplier {display: flex;justify-content: center; align-items: center;margin-top: 10px}' +
'.item { width: 33%; justify-content: center; align-items: center; display: flex}' +
'.item2 { width: 50%; justify-content: center; align-items: center; display: flex}' +
'.itemname2 { width: 20% }' +
'.itemcontent2 {width: 80%}' +
'.itemname { width: 40% }' +
'.itemcontent {width: 80%}',
gridHeaderStyle: 'font-size:12px; padding:3px; border:1px solid; color: #000; text-align:center;',
gridStyle: 'font-size:12px; padding:3px; border:1px solid; text-align:center; text-overflow:ellipsis; white-space:nowrap;',
repeatTableHeader: true
})
})
.catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '确认取消'
: '停留在当前页面'
})
})
}
//
}
}
}
</script>
<style scoped>
.edit >>> .el-dialog{
-webkit-transform: none;
transform: none;
position: absolute;
right: 0;
left: auto;
height: auto;
}
.edit >>> .el-dialog__header{
background: #fff;
position: fixed;
top: 0;
display: block;
width: 1010px;
z-index: 100;
border-bottom: 1px solid #f1f1f1;
}
.edit >>> .el-dialog__body{
padding-left: 0;
padding-right: 0;
padding-top: 10px;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
}
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.el-col-12{
width: 49%;
}
@media print {
.print {
display: none;
}
.print2 {
display: block !important;
}
}
</style>

View file

@ -0,0 +1,230 @@
<template>
<el-dialog :visible.sync="editVisible" :editcontrol="editcontrol" :editdata="editdata" :close-on-press-escape="false" :title="personalForm.refundNumber +$t('updates.xg')" width="1010px" class="edit" top="-10px" @close="$emit('update:editcontrol', false)">
<!--基本信息-->
<el-card class="box-card" style="margin-top: 63px" shadow="never">
<h2 ref="geren" class="form-name" style="font-size: 16px;color: #606266;margin-top: -5px;">{{ $t('Hmodule.basicinfo') }}</h2>
<div class="container" style="margin-top: 37px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" status-icon class="demo-ruleForm" label-width="130px">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('update4.refundTitle')" style="width: 100%;">
<el-input v-model="personalForm.title" style="margin-left: 18px;width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('ProduceTask.sourceType')" prop="sourceType" style="width: 100%;">
<el-select v-model="personalForm.sourceType" style="margin-left: 18px;width: 200px">
<el-option :label="$t('updates.sxckd')" value="1" />
<el-option :label="$t('route.Receipt')" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleReturn.sourceNumber')" prop="sourceNumber" style="width: 100%;">
<el-input v-model="personalForm.sourceNumber" style="margin-left: 18px;width: 200px" @focus="chooseSourceNumber"/>
<my-saleout :saleoutcontrol.sync="saleOutStat" :personaldata="personalForm" @saleOutdata="saleOutdata"/>
<my-receipt :saleoutcontrol.sync="receiptControl" @receiptData="receiptData"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="width: 100%;">
<el-input v-model="customerId" disabled style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('update4.tuikuanjine')" style="width: 100%;">
<el-input v-model="personalForm.refundMoney" type="number" style="margin-left: 18px;width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="width: 100%;">
<el-input v-model="saleRepositoryId" disabled style="margin-left: 18px;width: 200px" @focus="handlechooseRep"/>
<!-- <my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('CostInvoice.handlePersonId')" prop="handlePersonId" style="width: 100%;">
<el-input v-model="handlePersonId" style="margin-left: 18px;width: 200px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--子件信息-->
<el-card class="box-card" style="position: fixed;width: 1010px;z-index: 100;height: 74px;bottom: 0;" shadow="never">
<div class="buttons" style="float: right;padding-bottom: 10px">
<el-button @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
<el-button type="primary" @click="handleEditok()">{{ $t('Hmodule.baoc') }}</el-button>
</div>
</el-card>
</el-dialog>
</template>
<script>
import MySaleout from './MySaleout'
import MyReceipt from './MyReceipt'
import MyEmp from '../../SaleReturn/components/MyEmp'
import { updateSaleRefund } from '@/api/SaleOrder'
// eslint-disable-next-line no-unused-vars
var _that
export default {
components: { MySaleout, MyEmp, MyReceipt },
props: {
editcontrol: {
type: Boolean,
default: false
},
editdata: {
type: Object,
default: null
}
},
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (!this.personalForm.sourceNumber) {
callback(new Error('please select sourceNumber'))
} else {
callback()
}
}
return {
//
editVisible: this.editcontrol,
//
personalForm: this.editdata,
personalrules: {
sourceType: [
{ required: true, message: 'please select sourceType', trigger: 'change' }
],
sourceNumber: [
{ required: true, validator: validatePass, trigger: 'change' }
]
},
customerId: '',
saleRepositoryId: '',
handlePersonId: this.$store.getters.name,
saleOutStat: false,
saveloding: false,
stockControl: false,
receiptControl: false
}
},
watch: {
editcontrol() {
this.editVisible = this.editcontrol
},
editdata() {
console.log(this.editdata)
this.personalForm = this.editdata
this.customerId = this.personalForm.customerName
this.saleRepositoryId = this.personalForm.refundRepositoryName
this.personalForm.sourceType = String(this.editdata.sourceType)
}
},
created() {
// this.getTypes()
},
beforeCreate() {
_that = this
},
methods: {
receiptData(val) {
this.personalForm.sourceNumber = val.number
this.customerId = val.customerName
this.saleRepositoryId = val.receiptRepositoryName
this.personalForm.customerId = val.customerId
this.personalForm.refundRepositoryId = val.receiptRepositoryId
},
stockName(val) {
this.handlePersonId = val.personName
this.personalForm.handlePersonId = val.id
},
handlechooseStock() {
this.stockControl = true
},
chooseSourceNumber() {
if (this.personalForm.sourceType === '1') {
this.saleOutStat = true
} else if (this.personalForm.sourceType === '2') {
this.receiptControl = true
}
},
handlechooseRep() {
},
saleOutdata(val) {
console.log(val)
this.personalForm.sourceNumber = val.number
this.customerId = val.customerName
this.saleRepositoryId = val.saleRepositoryName
this.personalForm.customerId = val.customerId
this.personalForm.refundRepositoryId = val.saleRepositoryId
// this.personalForm.handlePersonId = val.number
},
//
//
handleEditok() {
delete this.personalForm.judgeStat
delete this.personalForm.receiptStat
delete this.personalForm.saleOrderDetailVos
this.$refs.personalForm.validate((valid) => {
if (valid) {
const parms = JSON.stringify(this.personalForm)
updateSaleRefund(parms).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: this.$t('prompt.czcg'),
message: this.$t('prompt.czcg'),
type: 'success',
duration: 1000,
offset: 100
})
this.$emit('rest', true)
this.editVisible = false
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
})
}
})
},
handlecancel() {
this.editVisible = false
}
// -------------------------------------------------
}
}
</script>
<style scoped>
.container >>> .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
margin-left: -10px;
}
.container >>> .el-form-item__label{
text-align: left;
}
.container >>> .el-form-item__label{
color: #60626696;
}
.edit >>> .el-dialog {
background:#f1f1f1 ;
left: 0;
height: 100vh;
}
.el-col-12{
width: 49%;
}
</style>

View file

@ -0,0 +1,598 @@
<template>
<el-dialog :visible.sync="employeeVisible" :saleoutcontrol="saleoutcontrol" :personaldata="personalForm" :close-on-press-escape="false" top="10px" title="选择收款单" append-to-body width="1100px" @close="$emit('update:saleoutcontrol', 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-input v-model="getemplist.number" :placeholder="$t('Receipt.number')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="receiptPersonId" :placeholder="$t('updates.skr')" size="small" class="filter-item" @clear="restFilter" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
<el-input v-model="getemplist.customerName" :placeholder="$t('Customer.customername')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.title" :placeholder="$t('updates.skdzt')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-select v-model="getemplist.searchRepositoryId" :placeholder="$t('Hmodule.xzmd')" size="small" clearable filterable class="filter-item">
<el-option
v-for="(item, index) in repositories"
:key="index"
:label="item.repositoryName"
:value="item.id"/>
</el-select>
<!--更多搜索条件-->
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="click">
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" :placeholder="$t('updates.djzt')" clearable style="width: 40%;float: left;margin-left: 20px">
<el-option :label="$t('updates.zd')" value="1"/>
<el-option :label="$t('updates.zx')" value="2"/>
<el-option :label="$t('updates.jd')" value="3"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" :placeholder="$t('updates.spzt')" clearable style="width: 40%;float: right;margin-right: 20px">
<el-option :label="$t('updates.wsh')" value="0"/>
<el-option :label="$t('updates.shz')" value="1"/>
<el-option :label="$t('updates.shtg')" value="2"/>
<el-option :label="$t('updates.shptg')" value="3"/>
</el-select>
<el-date-picker
v-model="date"
:default-time="['00:00:00', '23:59:59']"
type="daterange"
range-separator="-"
unlink-panels
value-format="yyyy-MM-dd"
style="width: 60%;margin-top:10px;margin-left:10px"/>
<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-button v-waves class="filter-item" type="primary" icon="el-icon-search" style="width: 86px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
<!-- <el-button v-waves class="filter-item" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button> -->
</el-form>
</el-row>
</el-card>
<el-card class="box-card" style="margin-top: 15px" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
ref="table"
:key="tableKey"
:data="list"
:height="tableHeight"
size="small"
border
fit
highlight-current-row
style="width: 100%;"
@current-change="handleCurrentChange">
<el-table-column :label="$t('Receipt.title')" :resizable="false" fixed="left" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.customerId')" :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('Receipt.allShouldMoney')" :resizable="false" prop="allShouldMoney" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.allShouldMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.receiptMoney')" :resizable="false" prop="receiptMoney" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.ontimeMoney')" :resizable="false" prop="ontimeMoney" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.ontimeMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.overdueMoney')" :resizable="false" prop="overdueMoney" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.overdueMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.receiptDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('Receipt.receiptPersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('NewEmployeeInformation.repositoryid')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.receiptRepositoryName }}</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">{{ $t('Hmodule.sure') }}</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { getRepositoryList, detailList } from '@/api/Expenses'
import { regionlist, searchRepository } from '@/api/public'
import { searchreceipt, updatereceipt, deletereceipt } from '@/api/Receipt'
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 '../../SaleReturn/components/MyEmp'
import MyCustomer from '../../SaleReturn/components/MyCustomer'
import MyAgent from '../../SaleReturn/components/MyAgent'
import MyAccept from '../../SaleReturn/components/MyAccept'
import MyRepository from '../../SaleReturn/components/MyRepository'
var _that
export default {
directives: { waves },
components: { MyRepository, MyAccept, MyEmp, MyCustomer, MyAgent, Pagination },
filters: {
isOntimeFilter(status) {
const statusMap = {
1: _that.$t('Receipt.zs'),
2: _that.$t('Receipt.bzs')
}
return statusMap[status]
},
judgeStatFilter(status) {
const statusMap = {
0: _that.$t('updates.wsh'),
1: _that.$t('updates.shz'),
2: _that.$t('Hmodule.shtg'),
3: _that.$t('Hmodule.shbtg')
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.fqsqd')
}
return statusMap[status]
},
sendTypeFilter(status) {
const statusMap = {
1: '已发货',
2: '未发货'
}
return statusMap[status]
}
},
props: {
saleoutcontrol: {
type: Boolean,
default: false
},
personaldata: {
type: Object,
default: null
}
},
data() {
return {
tableHeight: 200,
//
querydata: this.personaldata,
//
employeeVisible: this.saleoutcontrol,
date: [],
repositories: [],
pickerOptions1: {
disabledDate: (time) => {
return time.getTime() > Date.now() - 8.64e7
}
},
downloadLoading2: false,
categoryVisible: false,
isvoucherrep: false,
respositoryarr: [],
isvoucherregion: false,
sendregionIds: [],
regions: [],
props: {
value: 'id',
label: 'regionName',
children: 'regionListVos'
},
voucherparms: {
repositoryId: '',
regionId: '',
date: '',
type: 4
},
receiptVisible99: false,
//
receiptPersonId: '',
//
stockControl: false,
//
customerName: '',
//
customercontrol: false,
agentcontrol: false,
//
typeparms: {
pagenum: 1,
pagesize: 99999
},
//
types: [],
//
depts: [],
//
reviewParms: {
id: '',
judgePersonId: '',
judgeStat: ''
},
//
detailvisible: false,
//
visible2: false,
//
supplierId: '',
//
empcontrol: false,
//
moreaction: '',
//
downloadLoading: false,
//
list: [],
//
total: 0,
//
tableKey: 0,
//
listLoading: true,
//
getemplist: {
pageNum: 1,
pageSize: 10,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionIds
},
//
personalForm: {},
//
editVisible: false,
//
receiptVisible9: false,
picPaths: []
}
},
watch: {
saleoutcontrol() {
this.employeeVisible = this.saleoutcontrol
this.getlist()
this.getallrepositorys()
this.getallregionlist()
this.handlereps()
console.log(this.querydata)
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
}, 100)
},
personaldata() {
console.log(this.personaldata)
this.querydata = this.personaldata
}
},
beforeCreate() {
_that = this
},
methods: {
//
handlereps() {
console.log('this.$store.getters.repositoryId', this.$store.getters.repositoryId)
if (this.$store.getters.repositoryId !== '' && this.$store.getters.repositoryId !== null && this.$store.getters.repositoryId !== undefined) {
searchRepository(null, this.$store.getters.repositoryId, this.$store.getters.regionIds).then(res => {
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
this.$message.error('出错了')
}
})
}
},
clickRow(val) {
if (val.judgeStat === 0) {
this.$refs.table.toggleRowSelection(val)
}
},
closetag() {
this.categoryVisible = false
this.restvoucherparms()
},
restvoucherparms() {
this.voucherparms = {
repositoryId: '',
regionId: '',
date: '',
type: 4
}
this.respositoryarr = []
this.isvoucherregion = false
this.isvoucherrep = false
},
handlevoucher() {
console.log(this.voucherparms)
if (this.voucherparms.date === '' || this.voucherparms.date === null || this.voucherparms.date === undefined) {
this.$notify.error({
title: this.$t('prompt.qxxzrq'),
message: this.$t('prompt.qxxzrq'),
offset: 100
})
return false
}
if (this.voucherparms.repositoryId === '' && this.voucherparms.regionId === '') {
this.$notify.error({
title: this.$t('prompt.qxxzmdhqy'),
message: this.$t('prompt.qxxzmdhqy'),
offset: 100
})
return false
}
detailList(this.voucherparms).then(res => {
console.log(res)
if (res.data.ret === 200) {
if (res.data.data.content.length === 0) {
this.$notify.error({
title: '该门店或区域暂无凭证',
message: '该门店或区域暂无凭证',
offset: 100
})
return false
} else {
const senddata = {}
senddata.voucherlist = res.data.data.content
senddata.date = this.voucherparms.date
senddata.regionId = this.voucherparms.regionId
senddata.repositoryId = this.voucherparms.repositoryId
senddata.type = this.voucherparms.type
senddata.sourceType = 4
this.$store.dispatch('getvoucherdata', senddata)
this.$router.push({ path: '/Voucher/Newvoucher' })
}
}
})
},
//
getallrepositorys() {
getRepositoryList().then(res => {
if (res.data.ret === 200) {
this.respositoryarr = res.data.data.content.list
}
})
},
//
tranKTree(arr) {
if (!arr || !arr.length) return
return arr.map(item => ({
id: item.id,
regionName: item.regionName,
regionListVos: this.tranKTree(item.regionListVos)
}))
},
//
getallregionlist() {
regionlist().then(res => {
if (res.data.ret === 200) {
this.regions = this.tranKTree(res.data.data.content)
}
})
},
handlevoucherparms() {
this.categoryVisible = true
},
choosevoucherrep(val) {
console.log('val', val)
if (val === '') {
this.isvoucherregion = false
} else {
this.isvoucherregion = true
}
},
//
handlechange4(val) {
console.log(val)
if (val.length === 0) {
this.isvoucherrep = false
} else {
this.isvoucherrep = true
this.voucherparms.regionId = val[val.length - 1]
}
},
//
handleEdit(row) {
console.log(row)
this.editVisible = true
this.personalForm = Object.assign({}, row)
if (row.customerType) {
this.personalForm.customerType = String(row.customerType)
}
if (row.moneyType) {
this.personalForm.moneyType = String(row.moneyType)
}
},
//
check(row) {
console.log(row)
this.receiptVisible9 = true
this.picPaths = row.picPaths
},
// focus
handlechooseStock() {
this.stockControl = true
},
//
stockName(val) {
this.receiptPersonId = val.personName
this.getemplist.receiptPersonId = val.id
},
//
selectInit(row, index) {
if (row.judgeStat !== 0) {
return false
} else {
return true
}
},
//
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
searchreceipt(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.receiptPersonId = ''
this.getemplist.receiptPersonId = ''
},
//
handleFilter() {
console.log(this.date)
if (this.date === null) {
this.getemplist.beginTime = ''
this.getemplist.endTime = ''
} else if (this.date.length === 0) {
this.getemplist.beginTime = ''
this.getemplist.endTime = ''
} else {
this.getemplist.beginTime = this.date[0] + ' 00:00:00'
this.getemplist.endTime = this.date[1] + ' 23:59:59'
}
this.getemplist.pageNum = 1
searchreceipt(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
handlechoose() {
this.empcontrol = true
},
//
supplierName(val) {
console.log(val)
this.supplierId = val.supplierName
this.getemplist.supplierId = val.id
},
//
refreshlist(val) {
if (val === true) {
this.getlist()
}
},
//
handleAdd() {
this.$router.push('/SaleOut/AddSaleOut')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
this.$emit('receiptData', 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

@ -0,0 +1,502 @@
<template>
<el-dialog :visible.sync="employeeVisible" :saleoutcontrol="saleoutcontrol" :personaldata="personalForm" :close-on-press-escape="false" top="10px" title="选择销售出库单" append-to-body width="1100px" @close="$emit('update:saleoutcontrol', 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('SaleOut.title')" class="filter-item" 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="出库单编号" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
</el-form-item>
</el-col>
<el-col :span="3" style="margin-left: 20px">
<el-form-item>
<el-input v-model="outPersonId" :placeholder="$t('SaleOut.outPersonId')" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechooseAccept" @clear="restFilter3"/>
</el-form-item>
<my-accept :accetpcontrol.sync="accetpcontrol" @acceptName="acceptName"/>
</el-col>
<!--更多搜索条件-->
<el-col :span="3" style="margin-left: 30px">
<el-popover
v-model="visible2"
placement="bottom"
width="500"
trigger="click">
<el-input v-model="saleRepositoryId" :placeholder="$t('SaleOut.saleRepositoryId')" style="width: 40%;float: left;margin-left: 20px;" clearable @focus="handlechooseRep" @clear="restFilter4"/>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
<el-input v-model="getemplist.customerName" :placeholder="$t('updates2.customerName')" style="width: 40%;float: right;margin-right: 20px" clearable @keyup.enter.native="handleFilter"/>
<!--<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" :placeholder="$t('updates.djzt')" clearable style="width: 40%;float: right;margin-right: 20px">-->
<!--<el-option value="1" :label="$t('updates.zd')"/>-->
<!--<el-option value="2" :label="$t('updates.zx')"/>-->
<!--<el-option value="3" :label="$t('updates.jd')"/>-->
<!--</el-select>-->
<!--<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" :placeholder="$t('updates.spzt')" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">-->
<!--<el-option value="0" :label="$t('updates.wsh')"/>-->
<!--<el-option value="1" :label="$t('updates.shz')"/>-->
<!--<el-option value="2" :label="$t('updates.shtg')"/>-->
<!--<el-option value="3" :label="$t('updates.shptg')"/>-->
<!--</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"
ref="table"
:key="tableKey"
:data="list"
:height="tableHeight"
size="small"
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('SaleOut.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('SaleOut.outPersonId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.confirmPersonName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOut.outDate')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.outDate }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOut.saleRepositoryId')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.saleRepositoryName }}</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">{{ $t('Hmodule.sure') }}</el-button>
</el-card>
</el-dialog>
</template>
<script>
import { searchsaleOut } from '@/api/SaleOut'
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 '../../SaleReturn/components/MyEmp'
import MyCustomer from '../../SaleReturn/components/MyCustomer'
import MyAgent from '../../SaleReturn/components/MyAgent'
import MyAccept from '../../SaleReturn/components/MyAccept'
import MyRepository from '../../SaleReturn/components/MyRepository'
var _that
export default {
directives: { waves },
components: { MyRepository, MyAccept, MyEmp, MyCustomer, MyAgent, Pagination },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: _that.$t('updates.wsh'),
1: _that.$t('updates.shz'),
2: _that.$t('Hmodule.shtg'),
3: _that.$t('Hmodule.shbtg')
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
},
stockTypeFilter(status) {
const statusMap = {
1: '采购1'
}
return statusMap[status]
},
sendTypeFilter(status) {
const statusMap = {
1: '已发货',
2: '未发货'
}
return statusMap[status]
}
},
props: {
saleoutcontrol: {
type: Boolean,
default: false
},
personaldata: {
type: Object,
default: null
}
},
data() {
return {
tableHeight: 200,
//
querydata: this.personaldata,
//
employeeVisible: this.saleoutcontrol,
//
saleRepositoryId: '',
//
repositorycontrol: false,
//
outPersonId: '',
//
accetpcontrol: false,
//
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.regionIds,
isActive: 1,
isReturn: 1
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
watch: {
saleoutcontrol() {
this.employeeVisible = this.saleoutcontrol
this.getlist()
console.log(this.querydata)
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 180
}, 100)
},
personaldata() {
console.log(this.personaldata)
this.querydata = this.personaldata
}
},
beforeCreate() {
_that = this
},
methods: {
// focus
handlechooseRep() {
this.repositorycontrol = true
},
repositoryname(val) {
this.saleRepositoryId = val.repositoryName
this.personalForm.saleRepositoryId = val.id
},
// focus
handlechooseAccept() {
this.accetpcontrol = true
},
acceptName(val) {
this.outPersonId = val.personName
this.getemplist.outPersonId = val.id
},
//
selectInit(row, index) {
if (row.judgeStat !== 0) {
return false
} else {
return true
}
},
//
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) {
// console.log('', val)
this.getemplist.customerId = val.id
this.customerName = val.customerName
},
agentdata(val) {
// console.log('', val)
this.getemplist.customerId = val.id
this.customerName = val.agentName
},
//
updatecountry() {
this.getlist()
},
getlist() {
//
this.listLoading = true
searchsaleOut(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list.filter(item => {
return item.confirmPersonId !== null
})
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 = ''
},
restFilter2() {
this.stockPersonId = ''
this.getemplist.stockPersonId = ''
},
restFilter3() {
this.outPersonId = ''
this.getemplist.outPersonId = ''
},
restFilter4() {
this.saleRepositoryId = ''
this.getemplist.saleRepositoryId = ''
},
//
handleFilter() {
this.getemplist.pageNum = 1
if (this.getemplist.customerName !== null && this.getemplist.customerName !== undefined && this.getemplist.customerName !== '') {
this.getemplist.customerType = 2
} else {
this.getemplist.customerType = null
}
searchsaleOut(this.getemplist).then(res => {
if (res.data.ret === 200) {
this.list = res.data.data.content.list.filter(item => {
return item.confirmPersonId !== null
})
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('/SaleOut/AddSaleOut')
},
//
handleCurrentChange(val) {
this.choosedata = val
},
//
handleConfirm() {
this.employeeVisible = false
console.log(this.choosedata)
const saleOutdata = this.choosedata.saleOutDetailVos.concat(this.choosedata.saleOutGiftVos)
for (const i in saleOutdata) {
saleOutdata[i].sourceNumber = this.choosedata.number
}
console.log('源单', saleOutdata)
const outRepositoryId = this.choosedata.saleRepositoryId
const outRepositoryName = this.choosedata.saleRepositoryName
const saleOutDetail = saleOutdata.map(function(item) {
return {
returnQuantity: 1,
productCode: item.productCode,
productName: item.productName,
productType: item.productTypeName,
unit: item.unit,
color: item.color,
category: item.category,
productCategoryName: item.productCategoryName,
type: item.type,
productTypeName: item.productType,
// basicQuantity: item.quantity,
salePrice: item.salePrice,
costPrice: 0,
costMonney: 0,
deliverQuantity: item.applyQuantity,
deliverMoney: item.money,
outRepositoryId: outRepositoryId,
outRepositoryName: outRepositoryName,
batch: item.batch,
kpiGrade: item.kpiGrade,
point: item.point,
// taxprice: item.salePrice - item.taxMoney,
taxRate: Number(item.taxRate) * 100 || 0,
taxMoney: item.taxMoney || 0,
discount: item.discountRate * 100 || 0,
discountMoney: 0,
OriginalDiscountMont: item.discountMoney || 0,
alreadyReturnQuantity: item.retreatQuantity,
carCode: item.carCode,
motorCode: item.motorCode,
batteryCode: item.batteryCode,
sourceNumber: item.sourceNumber,
sendQuantity: item.quantity,
locationId: item.locationId,
locationName: item.locationName,
includeTaxCostMoney: 0,
includeTaxMoney: (item.salePrice) * 1 + Number(item.taxMoney) || 0,
money: (item.salePrice) * 1 + Number(item.taxMoney) || 0,
stat: 0
}
})
this.$emit('saleOutDetail', saleOutDetail)
this.$emit('saleOutdata', 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

@ -0,0 +1,245 @@
<template>
<div class="ERP-container">
<div class="app-container" style="padding-right: 0">
<!--基本信息-->
<el-card :body-style=" { padding: '5px' }" class="box-card" shadow="never">
<div ref="geren" class="form-name">{{ $t('Hmodule.basicinfo') }}</div>
<div class="container" style="margin-top: 25px">
<el-form ref="personalForm" :model="personalForm" :rules="personalrules" :inline="true" size="mini" status-icon class="demo-ruleForm" label-position="left" label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('update4.refundTitle')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.title" style="width: 200px" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('ProduceTask.sourceType')" prop="sourceType" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-select v-model="personalForm.sourceType" style="width: 200px">
<el-option :label="$t('updates.sxckd')" value="1" />
<el-option :label="$t('route.Receipt')" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleReturn.sourceNumber')" prop="sourceNumber" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.sourceNumber" style="width: 200px" @focus="chooseSourceNumber"/>
<my-saleout :saleoutcontrol.sync="saleOutStat" :personaldata="personalForm" @saleOutdata="saleOutdata"/>
<my-receipt :saleoutcontrol.sync="receiptControl" @receiptData="receiptData"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.customerName')" prop="customerId" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="customerId" disabled style="width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('update4.tuikuanjine')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="personalForm.refundMoney" type="number" style="width: 200px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('SaleOrder.saleRepositoryId')" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="saleRepositoryId" disabled style="width: 200px" @focus="handlechooseRep"/>
<!-- <my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('CostInvoice.handlePersonId')" prop="handlePersonId" style="margin-left: 18px;width: 100%;margin-bottom: 0">
<el-input v-model="handlePersonId" style="width: 200px" @focus="handlechooseStock"/>
<my-emp :control.sync="stockControl" @stockName="stockName"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-card>
<!--操作-->
<div class="buttons" style="position:fixed;bottom: 0;width: 100%;height: 40px; background: #fff;z-index:99">
<el-button :loading="saveloding" type="primary" style="background:#3696fd;border-color:#3696fd;width: 98px" @click="handlesave()">{{ $t('Hmodule.baoc') }}</el-button>
<el-button type="danger" @click="handlecancel()">{{ $t('Hmodule.cancel') }}</el-button>
</div>
</div>
</div>
</template>
<script>
import MySaleout from './componets/MySaleout'
import MyReceipt from './componets/MyReceipt'
import MyEmp from '../SaleReturn/components/MyEmp'
import { addSaleRefund } from '@/api/SaleOrder'
export default {
name: 'NewSaleRefund',
components: { MySaleout, MyEmp, MyReceipt },
data() {
const validatePass = (rule, value, callback) => {
console.log(value)
if (!this.personalForm.sourceNumber) {
callback(new Error('please select sourceNumber'))
} else {
callback()
}
}
return {
personalForm: {
sourceType: '1',
handlePersonId: this.$store.getters.userId,
createPersonId: this.$store.getters.userId,
countryId: this.$store.getters.countryId,
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
refundMoney: 0
},
personalrules: {
sourceType: [
{ required: true, message: 'please select sourceType', trigger: 'change' }
],
sourceNumber: [
{ required: true, validator: validatePass, trigger: 'change' }
]
},
customerId: '',
saleRepositoryId: '',
handlePersonId: this.$store.getters.name,
saleOutStat: false,
saveloding: false,
stockControl: false,
receiptControl: false
}
},
methods: {
receiptData(val) {
this.personalForm.sourceNumber = val.number
this.customerId = val.customerName
this.saleRepositoryId = val.receiptRepositoryName
this.personalForm.customerId = val.customerId
this.personalForm.refundRepositoryId = val.receiptRepositoryId
},
stockName(val) {
this.handlePersonId = val.personName
this.personalForm.handlePersonId = val.id
},
handlechooseStock() {
this.stockControl = true
},
chooseSourceNumber() {
if (this.personalForm.sourceType === '1') {
this.saleOutStat = true
} else if (this.personalForm.sourceType === '2') {
this.receiptControl = true
}
},
handlechooseRep() {
},
saleOutdata(val) {
console.log(val)
this.personalForm.sourceNumber = val.number
this.customerId = val.customerName
this.saleRepositoryId = val.saleRepositoryName
this.personalForm.customerId = val.customerId
this.personalForm.refundRepositoryId = val.saleRepositoryId
// this.personalForm.handlePersonId = val.number
},
clearForm() {
this.personalForm = {
sourceType: '1',
handlePersonId: this.$store.getters.userId,
createPersonId: this.$store.getters.userId,
countryId: this.$store.getters.countryId,
repositoryId: this.$store.getters.repositoryId,
regionId: this.$store.getters.regionId,
refundMoney: 0
}
this.customerId = ''
this.saleRepositoryId = ''
this.handlePersonId = this.$store.getters.name
},
handlesave() {
if (!this.personalForm.refundMoney) {
this.$notify.error({
title: 'wrong',
message: 'please input refundMoney',
offset: 100
})
return false
}
this.saveloding = true
setTimeout(() => {
this.$refs.personalForm.validate((valid) => {
if (valid) {
const parms = JSON.stringify(this.personalForm)
addSaleRefund(parms, this.personalForm).then(res => {
if (res.data.ret === 200) {
this.$notify({
title: 'successful',
message: 'save successful',
type: 'success',
offset: 100
})
this.clearForm()
this.$refs.personalForm.clearValidate()
this.$refs.personalForm.resetFields()
} else {
this.$notify.error({
title: 'wrong',
message: res.data.msg,
offset: 100
})
}
this.saveloding = false
})
}
})
}, 500)
},
handlecancel() {
}
}
}
</script>
<style scoped>
.ERP-container{
margin-right: 0;
}
.form-name{
font-weight: bold;
font-size: 18px;
color: #373e4f;
padding: 5px;
margin-bottom: -20px;
}
.container{
margin-top: 5px;
}
.el-button+.el-button{
width: 98px;
}
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
</style>

View file

@ -0,0 +1,750 @@
<template>
<div class="ERP-container">
<el-card :body-style=" { padding: '5px' }" class="box-card" style="margin-top: 5px" shadow="never">
<el-input v-model="getemplist.title" :placeholder="$t('SaleOrder.title')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="getemplist.refundNumber" :placeholder="$t('updates.dddh')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
<el-input v-model="repositoryId" :placeholder="$t('StockAlarm.searchRepositoryId')" size="small" class="filter-item" clearable @keyup.enter.native="handleFilter" @focus="handlechooseRep" @clear="clearrep"/>
<my-repository :repositorycontrol.sync="repositorycontrol" @repositoryname="repositoryname"/>
<el-popover
v-model="visible2"
placement="bottom"
width="500"
size="small"
trigger="click">
<el-input v-model="getemplist.customerName" :placeholder="$t('SaleOrder.customerName')" size="small" style="width: 40%;float: right;margin-right: 20px;" clearable/>
<!-- <my-customer :customercontrol.sync="customercontrol" @customerdata="customerdata"/>
<my-agent :agentcontrol.sync="agentcontrol" @agentdata="agentdata"/> -->
<el-select v-model="getemplist.receiptStat" :value="getemplist.receiptStat" :placeholder="$t('updates.djzt')" size="small" clearable style="width: 40%;float: left;margin-left: 20px;margin-top: 20px">
<el-option :label="$t('updates.zd')" value="1"/>
<el-option :label="$t('updates.zx')" value="2"/>
<el-option :label="$t('updates.jd')" value="3"/>
</el-select>
<el-select v-model="getemplist.judgeStat" :value="getemplist.judgeStat" :placeholder="$t('updates.spzt')" size="small" clearable style="width: 40%;float: right;margin-right: 20px;margin-top: 20px">
<el-option :label="$t('updates.wsh')" value="0"/>
<el-option :label="$t('updates.shz')" value="1"/>
<el-option :label="$t('updates.shtg')" value="2"/>
<el-option :label="$t('updates.shptg')" value="3"/>
</el-select>
<el-date-picker
v-model="date"
type="daterange"
range-separator="-"
size="small"
unlink-panels
start-placeholder="销售日期"
end-placeholder="销售日期"
value-format="yyyy-MM-dd"
style="margin-top: 20px;margin-left: 20px"/>
<!-- <el-input v-model="getemplist.customerName" :placeholder="$t('updates2.customerName')" style="width: 40%;float: left;margin-left: 20px;margin-top: 20px" clearable @keyup.enter.native="handleFilter"/> -->
<div class="seachbutton" style="width: 100%;float: right;margin-top: 20px">
<el-button v-waves class="filter-item" type="primary" size="small" style="float: right" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</div>
<el-button v-waves slot="reference" type="primary" size="small" 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-button v-waves class="filter-item" type="primary" size="small" icon="el-icon-search" style="width: 86px;margin-top: 10px" round @click="handleFilter">{{ $t('public.search') }}</el-button>
</el-card>
<el-card :body-style=" { padding: '6px'}" class="box-card" shadow="never">
<!-- 批量操作 -->
<el-dropdown @command="handleCommand">
<el-button v-waves size="small" class="filter-item2" style="margin-left: 0" type="primary">
{{ $t('public.batchoperation') }} <i class="el-icon-arrow-down el-icon--right"/>
</el-button>
<el-dropdown-menu slot="dropdown" style="width: 140px">
<el-dropdown-item v-permission="['54-414-2']" style="text-align: left" command="delete"><svg-icon icon-class="shanchu" style="width: 40px"/>{{ $t('public.delete') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- 表格导出操作 -->
<el-button v-permission="['54-414-6']" v-waves :loading="downloadLoading" size="small" class="filter-item2" style="width: 86px" @click="handleExport"> <svg-icon icon-class="daochu"/>{{ $t('public.export') }}</el-button>
<!-- 打印操作 -->
<!-- <el-button v-permission="['54-414-7']" v-waves size="small" class="filter-item2" icon="el-icon-printer" style="width: 86px" @click="handlePrint">{{ $t('public.print') }}</el-button> -->
<!-- 新建操作 -->
<el-button v-permission="['54-414-1']" v-waves size="small" class="filter-item2" icon="el-icon-plus" type="success" style="width: 86px" @click="handleAdd">{{ $t('public.add') }}</el-button>
</el-card>
<el-card :body-style=" { padding: '10px' }" class="box-card" shadow="never">
<!-- 列表开始 -->
<el-table
v-loading="listLoading"
ref="table"
:height="tableHeight"
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@row-click="clickRow"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="selectInit"
type="selection"
width="55"
fixed="left"
align="center"
/>
<el-table-column :label="$t('public.id')" :resizable="false" fixed="left" align="center" min-width="150">
<template slot-scope="scope">
<span class="link-type" @click="handleDetail(scope.row)">{{ scope.row.refundNumber }}</span>
</template>
<detail-list :detailcontrol.sync="detailvisible" :detaildata.sync="personalForm"/>
</el-table-column>
<el-table-column :label="$t('SaleOrder.title')" :resizable="false" fixed="left" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.title }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('SaleOrder.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('update4.returnMoney')" :resizable="false" prop="returnMoney" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.refundMoney }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('recoveryCarDetail.repositoryName')" :resizable="false" prop="refundRepositoryName" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.refundRepositoryName }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('ProduceTask.sourceType')" :resizable="false" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.sourceType | sourceTypeFilter }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('public.judgeStat')" :resizable="false" 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-column :label="$t('public.actions')" :resizable="false" align="center" min-width="540">
<template slot-scope="scope">
<el-button v-permission2="['54-414-3', scope.row.createPersonId]" v-show="scope.row.judgeStat === 0&&scope.row.receiptStat === 1" :key="scope.row.id + Math.random()" :title="$t('updates.xg')" type="primary" size="mini" icon="el-icon-edit" circle @click="handleEdit(scope.row)"/>
<el-button v-show="isReview(scope.row)&&(scope.row.receiptStat === 1||scope.row.receiptStat === 2||scope.row.receiptStat === 3)" :title="$t('updates.spi')" type="warning" size="mini" icon="el-icon-view" circle @click="handleReview(scope.row)"/>
<el-button v-permission2="['54-414-2', scope.row.createPersonId]" v-show="scope.row.judgeStat === 0&&(scope.row.receiptStat === 1||scope.row.receiptStat === 2||scope.row.receiptStat === 3)" :key="scope.row.id + Math.random()" :title="$t('updates.sc')" scope-row-create-person-id- size="mini" type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)"/>
<el-button v-permission="['54-414-76']" v-show="isReview4(scope.row)&&(scope.row.receiptStat === 1||scope.row.receiptStat === 2)" :title="$t('updates.fsp')" type="warning" size="mini" circle @click="handleReview4(scope.row)"><svg-icon icon-class="fanhui"/></el-button>
<el-button v-permission="['54-414-17']" v-show="isReview3(scope.row)&&(scope.row.receiptStat === 1||scope.row.receiptStat === 2||scope.row.receiptStat === 3)" :title="$t('updates.fjd')" type="success" size="mini" icon="el-icon-back" circle @click="handleReview3(scope.row)"/>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<pagination v-show="total>0" :total="total" :page.sync="getemplist.pageNum" :limit.sync="getemplist.pageSize" @pagination="getlist" />
<!--修改开始=================================================-->
<my-dialog :editcontrol.sync="editVisible" :editdata.sync="personalForm" @rest="refreshlist"/>
<!--修改结束=================================================-->
</el-card>
</div>
</template>
<script>
import { checkReceiptOrder2, searchRepository } from '@/api/public'
import { saleRefundList, deleteSaleRefund, judgeSaleRefund } from '@/api/SaleOrder'
import { getdeptlist } from '@/api/BasicSettings'
import { searchStockCategory } from '@/api/StockCategory'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'
import permission from '@/directive/permission/index.js' //
import permission2 from '@/directive/permission2/index.js' //
import checkPermission from '@/utils/permission' //
import MyRepository from '../SaleReturn/components/MyRepository'
import DetailList from './componets/DetailList'
import MyDialog from './componets/MyDialog'
var _that
export default {
name: 'SaleRefundList',
directives: { waves, permission, permission2 },
components: { Pagination, MyRepository, MyDialog, DetailList },
filters: {
judgeStatFilter(status) {
const statusMap = {
0: _that.$t('updates.wsh'),
1: _that.$t('updates.shz'),
2: _that.$t('Hmodule.shtg'),
3: _that.$t('Hmodule.shbtg')
}
return statusMap[status]
},
receiptStatFilter(status) {
const statusMap = {
1: _that.$t('updates.zd'),
2: _that.$t('updates.zx'),
3: _that.$t('updates.jd')
}
return statusMap[status]
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.sxckd'),
2: _that.$t('route.Receipt')
}
return statusMap[status]
}
},
data() {
return {
repositoryId: '',
repositorycontrol: false,
repositories: [],
tableHeight: 200,
step1: '',
step2: '',
step3: '',
step4: '',
step5: '',
step6: '',
step7: '',
step8: '',
receiptVisible: false,
//
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,
repositoryId: this.$store.getters.repositoryId,
regionIds: this.$store.getters.regionIds
},
//
personalForm: {},
//
editVisible: false,
//
date: []
}
},
activated() {
this.getlist()
this.getrepos()
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140
}, 100)
},
mounted() {
this.getlist()
this.getrepos()
setTimeout(() => {
this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140
}, 100)
},
beforeCreate() {
_that = this
},
methods: {
numFormat(num) {
var res = num.toString().replace(/\d+/, function(n) { //
return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
return $1 + ','
})
})
return res
},
//
getSummaries2(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = this.numFormat(values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return (Number(prev) + Number(curr)).toFixed(6)
} else {
return (Number(prev)).toFixed(6)
}
}, 0))
// console.log('sums[index]', sums[index])
sums[index] += ''
} else {
sums[index] = ''
}
})
return sums
},
//
handleReview3(row) {
this.reviewParms = {}
this.reviewParms.id = row.id
// this.reviewParms.endPersonId = this.$store.getters.userId
this.$confirm(this.$t('prompt.qfjd'), this.$t('prompt.fjd'), {
distinguishCancelAndClose: true,
confirmButtonText: this.$t('prompt.fjd'),
type: 'warning'
}).then(() => {
this.reviewParms.receiptStat = 2
const parms = JSON.stringify(this.reviewParms)
judgeSaleRefund(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: this.$t('prompt.fjdcg')
})
this.getlist()
}
})
})
},
isReview3(row) {
if (row.receiptStat === 3) {
return true
}
},
isReview4(row) {
//
if (row.judgeStat === 2) {
return true
}
//
// if (row.judgeStat === 2 && row.confirmPersonId === null) {
// return true
// }
},
handleReview4(row) {
this.reviewParms = {}
this.reviewParms.id = row.id
this.reviewParms.judgePersonId = this.$store.getters.userId
this.$confirm(this.$t('prompt.qfsp'), this.$t('prompt.fsp'), {
distinguishCancelAndClose: true,
confirmButtonText: this.$t('prompt.fsp'),
type: 'warning'
}).then(() => {
this.reviewParms.judgeStat = 0
const parms = JSON.stringify(this.reviewParms)
judgeSaleRefund(parms).then(res => {
if (res.data.ret === 200) {
if (res.data.data.result === false) {
this.$message({
type: 'error',
message: this.$t('prompt.fspsb')
})
} else {
this.$message({
type: 'success',
message: this.$t('prompt.fspcg')
})
}
this.getlist()
} else {
this.$message({
type: 'success',
message: this.$t('prompt.fspcg')
})
}
})
})
},
repositoryname(val) {
console.log(val)
this.repositoryId = val.repositoryName
this.getemplist.refundRepositoryId = val.id
},
// focus
handlechooseRep() {
this.repositorycontrol = true
},
clearrep() {
this.getemplist.refundRepositoryId = ''
this.repositoryId = ''
},
//
getrepos() {
console.log('this.$store.getters.repositoryId', this.$store.getters.repositoryId)
if (this.$store.getters.repositoryId !== '' && this.$store.getters.repositoryId !== null && this.$store.getters.repositoryId !== undefined) {
searchRepository(null, this.$store.getters.repositoryId, this.$store.getters.regionIds).then(res => {
if (res.data.ret === 200) {
this.repositories = res.data.data.content.list
} else {
this.$message.error('出错了')
}
})
}
},
clickRow(val) {
if (val.judgeStat === 0) {
this.$refs.table.toggleRowSelection(val)
}
},
checkPermission,
//
selectInit(row, index) {
if (row.judgeStat !== 0) {
return false
} else {
return true
}
},
//
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
saleRefundList(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 = ''
},
restFilter2() {
this.stockPersonId = ''
this.getemplist.stockPersonId = ''
},
//
handleFilter() {
console.log('this.date', this.date)
if (this.date && this.date.length !== 0) {
this.getemplist.beginTime = this.date[0] + ' 00:00:00'
this.getemplist.endTime = this.date[1] + ' 23:59:59'
} else {
this.getemplist.beginTime = ''
this.getemplist.endTime = ''
}
this.getemplist.pageNum = 1
saleRefundList(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()
}
})
},
//
handleEdit(row) {
console.log(row)
this.personalForm = Object.assign({}, row)
this.personalForm.sourceType = String(row.sourceType)
this.editVisible = true
},
//
refreshlist(val) {
if (val === true) {
this.getlist()
}
},
//
handleDetail(row) {
console.log(row)
this.detailvisible = true
this.personalForm = Object.assign({}, row)
},
//
isReview(row) {
if (row.approvalUseVos !== '' && row.approvalUseVos !== null && row.approvalUseVos !== undefined && row.approvalUseVos.length !== 0) {
const approvalUse = row.approvalUseVos
const index = approvalUse[approvalUse.length - 1].stepHandler.indexOf(',' + this.$store.getters.userId + ',')
console.log(approvalUse[approvalUse.length - 1].stepHandler)
console.log(index)
if (index > -1 && (row.judgeStat === 1 || row.judgeStat === 0)) {
return true
}
}
},
//
handleReview(row) {
this.reviewParms = {}
this.reviewParms.id = row.id
this.reviewParms.judgePersonId = this.$store.getters.userId
this.$confirm(this.$t('prompt.qsh'), this.$t('prompt.sh'), {
distinguishCancelAndClose: true,
confirmButtonText: this.$t('prompt.tg'),
cancelButtonText: this.$t('prompt.btg'),
type: 'warning'
}).then(() => {
this.reviewParms.judgeStat = 2
const parms = JSON.stringify(this.reviewParms)
judgeSaleRefund(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: this.$t('prompt.shcg')
})
this.getlist()
}
})
}).catch(action => {
if (action === 'cancel') {
//
this.$confirm('是否确认审核不通过?', 'Warning', {
distinguishCancelAndClose: true,
confirmButtonText: '确认',
cancelButtonText: '取消'
})
.then(() => {
this.reviewParms.judgeStat = 3
const parms = JSON.stringify(this.reviewParms)
judgeSaleRefund(parms).then(res => {
if (res.data.ret === 200) {
this.$message({
type: 'success',
message: this.$t('prompt.shcg')
})
this.getlist()
}
})
})
.catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '确认取消'
: '停留在当前页面'
})
})
// ================
}
})
},
//
handleSelectionChange(val) {
this.moreaction = val
},
//
//
handleCommand(command) {
const ids = this.moreaction.map(item => item.id).join()
if (command === 'delete') {
this.$confirm(this.$t('prompt.scts'), this.$t('prompt.ts'), {
confirmButtonText: this.$t('prompt.qd'),
cancelButtonText: this.$t('prompt.qx'),
type: 'warning'
}).then(() => {
deleteSaleRefund(this.$store.getters.userId, ids).then(res => {
if (res.data.ret === 200 || res.data.ret === 100) {
this.$notify({
title: this.$t('prompt.sccg'),
type: 'success',
offset: 100
})
this.getlist()
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('prompt.yqxsc')
})
})
}
},
//
handleDelete(row) {
this.$confirm(this.$t('prompt.scts'), this.$t('prompt.ts'), {
confirmButtonText: this.$t('prompt.qd'),
cancelButtonText: this.$t('prompt.qx'),
type: 'warning'
}).then(() => {
deleteSaleRefund(row.id, row.id).then(res => {
if (res.data.ret === 200 || res.data.ret === 100) {
this.$notify({
title: this.$t('prompt.sccg'),
type: 'success',
offset: 100
})
this.getlist()
} else {
this.$notify.error({
title: 'wrong',
message: 'wrong',
offset: 100
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('prompt.yqxsc')
})
})
},
//
handleAdd() {
this.$router.push('/saleRefund/NewSaleRefund')
},
//
handleExport() {
this.downloadLoading = true
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['供应商编号', '供应商名称', '供应商简称', '供应商类别', '所在区域', '采购员', '供应商优质级别', '建档人', '建档日期']
const filterVal = ['id', 'SaleOrderName', 'SaleOrderShortName', 'typeName', 'regionName', 'buyerName', 'levelName', 'createName', 'createTime']
const data = this.formatJson(filterVal, this.list)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '经销商资料表'
})
this.downloadLoading = false
})
},
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
return v[j]
}))
},
//
handlePrint() {
console.log(456)
}
}
}
</script>
<style rel="stylesheet/css" scoped>
.ERP-container >>> .el-form-item__label{
color: #909399;
text-align: left;
}
.app-container >>> .el-table .cell {
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 24px;
word-break: keep-all;
word-wrap: break-word;
white-space: pre-wrap;
}
.ERP-container {
margin-left:10px;
}
.filter-container{
padding: 20px;
padding-left: 0px;
}
.filter-item{
width: 180px;
margin-left: 10px;
padding: 10px 0;
}
.filter-item2{
width: 180px;
margin-left: 5px;
padding: 10px 0;
}
.box-card {
/* border : 1px solid #f1f1ff !important; */
border-bottom : 1px solid #f1f1ff00 !important
}
.normal >>> .el-dialog__header {
padding: 20px 20px 10px;
background: #fff;
position: static;
top: auto;
z-index: auto;
width: auto;
border-bottom: none;
}
.normal >>> .el-dialog {
-webkit-transform: none;
transform: none;
left: 0;
position: relative;
margin: 0 auto;
height: auto;
}
</style>