2024-09-09 修改了大部分下拉组件为模糊筛选,减轻前端渲染压力

This commit is contained in:
2024-09-09 15:26:17 +08:00
parent fe5d3b70df
commit 563132273c
717 changed files with 107188 additions and 138520 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,449 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<el-select v-model="customerNameValue" style="width:250px" placeholder="售后客户名称" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 20;searchTable()">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="contractSelectionValue" style="width:200px" placeholder="合同编号" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 20;searchTable()">
<el-option
v-for="item in contractSelection"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">投产日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;margin-right: 330px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 20;searchTable()"/>
<!-- <el-tooltip :open-delay="700" effect="dark" content="查看库存信息" placement="top">-->
<!-- <el-button type="text" size="mini" @click="handleStock"><svg-icon icon-class="库存查询" style="width: 20px;height: 20px"/></el-button>-->
<!-- </el-tooltip>-->
</el-row>
<div style="float: left">
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="mini" style="width: 1301px;" height="222" @row-click="searchTable1">
<el-table-column :width="setColumnWidth('合同编号')" label="订单编号" align="center">
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column width="71px" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column label="售后原因" align="center">
<template slot-scope="scope">
{{ scope.row.售后原因 }}
</template>
</el-table-column>
<el-table-column width="65px" label="下单人" align="center">
<template slot-scope="scope">
{{ scope.row.创建人 }}
</template>
</el-table-column>
<el-table-column width="85px" label="下单日期" align="center">
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column width="65px" label="投产人" align="center">
<template slot-scope="scope">
{{ scope.row.投产人 }}
</template>
</el-table-column>
<el-table-column width="85px" label="投产日期" align="center">
<template slot-scope="scope">
{{ scope.row.下达日期 }}
</template>
</el-table-column>
<el-table-column width="155px" label="对应老合同" align="center">
<template slot-scope="scope">
{{ scope.row.原合同编号 }}
</template>
</el-table-column>
<el-table-column width="275px" label="解决方案" align="center">
<template slot-scope="scope">
{{ scope.row.解决方案 }}
</template>
</el-table-column>
<el-table-column width="55px" label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="500" effect="dark" content="删除合同" placement="top">
<el-button :disabled="Number(scope.row.是否接收) === 1 || Number(scope.row.是否启用) === 0" type="text" icon="el-icon-delete" style="margin-right: 10px" size="mini" @click="deleteProject(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 10px" @mouseover="show=true" @mouseleave="show=false">
<el-table v-loading="loading1" :data="tableData1" :header-cell-style="changeStyle" highlight-current-row border size="mini" style="width: 1821px;margin-top: 10px" height="430px">
<el-table-column width="50px" label="序号" fixed type="index" align="center"/>
<el-table-column width="120px" fixed label="部件名称" align="center">
<template slot-scope="scope">
<template v-if="parseInt(scope.row.是否合同创建)===0&&scope.row.edit ===true">
<el-input v-model="scope.row.产品名称" size="mini" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.产品名称 }}
</template>
</template>
</el-table-column>
<el-table-column width="70px" label="单位" fixed align="center">
<template slot-scope="scope">
<template v-if="parseInt(scope.row.是否合同创建)===0&&scope.row.edit ===true">
<el-input v-model="scope.row.单位" size="mini" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.单位 }}
</template>
</template>
</el-table-column>
<el-table-column width="80px" label="数量" fixed align="center">
<template slot-scope="scope">
<template v-if="parseInt(scope.row.是否合同创建)===0&&scope.row.edit ===true">
<el-input v-model="scope.row.数量" size="mini" type="number" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.数量 }}
</template>
</template>
</el-table-column>
<el-table-column width="200px" label="产品详情" fixed align="center">
<template slot-scope="scope">
<template v-if="parseInt(scope.row.是否合同创建)===0&&scope.row.edit ===true">
<el-input v-model="scope.row.产品详情" size="mini" type="textarea" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.产品详情 }}
</template>
</template>
</el-table-column>
<el-table-column width="140px" label="售后人员" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit ===true">
<el-select v-model="scope.row.售后人员编号" style="width:95%" placeholder="选择售后人员" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 20;searchTable()">
<el-option
v-for="item in afterSalesPersonnel"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else>
{{ scope.row.售后人员姓名 }}
</template>
</template>
</el-table-column>
<el-table-column width="170px" label="完成日期" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit ===true">
<el-date-picker
v-model="scope.row.售后完成时间"
style="width: 95%"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
size="small"
placeholder="选择完成日期"/>
</template>
<template v-else>
{{ scope.row.售后完成时间 }}
</template>
</template>
</el-table-column>
<el-table-column label="售后结果" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit ===true">
<el-input v-model="scope.row.售后结果" size="mini" type="textarea" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.售后结果 }}
</template>
</template>
</el-table-column>
<el-table-column width="250px" label="客户评价" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit ===true">
<el-input v-model="scope.row.客户评价" size="mini" type="textarea" style="width: 100%" @dblclick.native.stop/>
</template>
<template v-else>
{{ scope.row.客户评价 }}
</template>
</template>
</el-table-column>
<el-table-column width="97px" label="操作" fixed="right" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" @click="editProduct(scope.row)">确认</el-button>
<el-button v-if="scope.row.edit" type="text" size="mini" @click="cancel(scope.row)">取消</el-button>
<el-tooltip :open-delay="700" effect="dark" content="编辑" placement="top">
<el-button v-if="scope.row.edit === false" type="text" icon="el-icon-edit-outline" size="mini" @click="scope.row.edit = !scope.row.edit"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="删除" placement="top">
<el-button v-if="scope.row.edit === false" :disabled="parseInt(scope.row.是否合同创建)===1" type="text" icon="el-icon-minus" size="mini" @click="deleteProduct(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-button v-show="show" icon="el-icon-circle-plus-outline" size="mini" @click="createProduct"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
contractSelectionValue: '',
contractSelection: [],
afterSalesPersonnel: [],
remarks: '',
orderValue: '',
customerName: [],
customerNameValue: '',
dateRange: '',
show: false,
// 以上是新增
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
tableData10: [], // 产品信息表
tableData100: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
this.getContractSelection()
this.getAfterSalesPersonnel()
this.getCustomer()
},
methods: {
deleteProject(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['项目流水号', row.项目流水号]
var Data = this.CreateData('12', 'PDM_项目名称_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable() {
let check, check1, check2
this.customerNameValue ? check = 1 : check = 0
this.contractSelectionValue ? check2 = 1 : check2 = 0
this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
var param = []
param[0] = ['买方名称_check', check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['投产日期_check', check1]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['合同编号_check', check2]
param[6] = ['项目流水号', this.contractSelectionValue]
var Data = this.CreateData('11', '订单信息_售后服务查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
console.log(response.data, '订单信息')
})
},
getContractSelection() {
var param = []
var Data = this.CreateData('11', 'PDM_项目名称_售后服务_查询订单', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractSelection.push({
label: response.data[i].合同编号,
value: response.data[i].项目流水号
})
}
})
},
getAfterSalesPersonnel() {
var param = []
var Data = this.CreateData('11', '售后服务_售后人员_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.afterSalesPersonnel.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getCustomer() {
var param = []
var Data = this.CreateData('11', '售后服务_合同管理_客户信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].售后客户流水号
})
}
})
},
searchTable1(row) {
this.tableData100 = []
this.orderValue = row.项目流水号
this.remarks = row.合同备注
this.searchTable2()
},
searchTable2() {
this.loading1 = true
this.tableData100 = []
var param = []
param[0] = ['项目流水号', this.orderValue]
var Data = this.CreateData('11', '合同信息_产品信息_售后服务_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData100.push({
组件流水号: response.data[i].组件流水号,
产品流水号: response.data[i].产品流水号,
是否滑台: response.data[i].是否滑台,
产品名称: response.data[i].产品名称,
产品详情: response.data[i].产品详情,
单位: response.data[i].单位,
数量: response.data[i].数量,
售后人员编号: response.data[i].售后人员流水号,
售后人员姓名: response.data[i].售后人员姓名,
售后完成时间: response.data[i].售后完成日期,
售后结果: response.data[i].售后结果,
客户评价: response.data[i].客户评价,
是否合同创建: response.data[i].是否合同创建,
原产品名称: response.data[i].产品名称,
原产品详情: response.data[i].产品详情,
原数量: response.data[i].数量,
原单位: response.data[i].单位,
原售后人员编号: response.data[i].售后人员流水号,
原售后完成时间: response.data[i].售后完成日期,
原售后结果: response.data[i].售后结果,
原客户评价: response.data[i].客户评价,
edit: false
})
}
}).then(() => {
this.tableData1 = this.tableData100
console.log('tableData100', this.tableData1)
this.loading1 = false
})
},
cancel(row) {
row.产品名称 = row.原产品名称
row.产品详情 = row.原产品详情
row.单位 = row.原单位
row.数量 = row.原数量
row.售后人员编号 = row.原售后人员编号
row.售后完成时间 = row.原售后完成时间
row.售后结果 = row.原售后结果
row.客户评价 = row.原客户评价
row.edit = false
},
createProduct() {
var param = []
param[0] = ['项目流水号', this.orderValue]
var Data = this.CreateData('12', '售后服务_产品信息_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
},
deleteProduct(row) {
var param = []
param[0] = ['组件流水号', row.组件流水号]
param[1] = ['是否合同创建', row.是否合同创建]
var Data = this.CreateData('12', '售后合同_组件名称_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable2()
} else {
this.$message.error('删除失败')
}
})
},
editProduct(row) {
console.log('售后完成时间', row.售后完成时间)
var param = []
param[0] = ['组件流水号', row.组件流水号]
param[1] = ['产品名称', row.产品名称]
param[2] = ['产品详情', row.产品详情]
param[3] = ['单位', row.单位]
param[4] = ['数量', row.数量]
if (Number(row.是否合同创建) === 0) {
param[5] = ['产品流水号', 0]
} else {
param[5] = ['产品流水号', row.产品流水号]
}
param[6] = ['售后人员流水号', row.售后人员编号]
param[7] = ['售后完成时间', row.售后完成时间]
param[8] = ['售后结果', row.售后结果]
param[9] = ['客户评价', row.客户评价]
param[10] = ['是否合同创建', row.是否合同创建]
var Data = this.CreateData('12', '售后服务_产品详细参数_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable2()
} else {
this.$message.error('编辑失败')
}
})
row.edit = !row.edit
},
// 以上是可以用的
changeStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 19 || columnIndex === 16 || columnIndex === 17 || columnIndex === 18) {
return 'background:#31384B;color:white'
} else {
return 'background:#2283D4;color:white'
}
}
}
}
</script>

View File

@@ -0,0 +1,352 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
clearable
remote
@change="searchTable();getOrder(customerNameValue)">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="orderValue"
style="width:200px"
placeholder="订单编号"
size="small"
filterable
clearable
@change="searchTable();getProduct()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 30px; font-size: 13px;color: black">服务时间</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="searchTable"/>
<el-select
v-model="productNameValue"
style="width:100px"
placeholder="产品名称"
size="small"
filterable
clearable
@change="searchTable">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
<div style="margin-top: 20px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1321px"
height="740px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('序号')" label="次数" type="index" align="center"/>
<el-table-column
:width="setColumnWidth('买方名称')"
label="买方名称"
align="center"
sortable="买方名称"
prop="买方名称"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('订单编号')"
label="订单编号"
align="center"
sortable="订单编号"
prop="订单编号"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('产品名称')"
label="产品名称"
align="center"
sortable="产品名称"
prop="产品名称"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center" prop="数量">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('发货数')" label="发货数" align="center" prop="发货数">
<template slot-scope="scope">
{{ scope.row.发货数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('售后反馈')" label="售后反馈" align="center">
<template slot-scope="scope">
{{ scope.row.售后反馈 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('反馈时间')" label="反馈时间" align="center">
<template slot-scope="scope">
{{ scope.row.反馈时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('处理结果')" label="处理结果" align="center">
<template slot-scope="scope">
{{ scope.row.处理结果 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('服务时间')" label="服务时间" align="center">
<template slot-scope="scope">
{{ scope.row.服务时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('服务人')" label="服务人" align="center">
<template slot-scope="scope">
{{ scope.row.服务人 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="查看售后服务照片" placement="top">
<el-button
type="text"
icon="el-icon-picture-outline"
size="mini"
@click="uploadOrViewPhotos(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="600px">
<el-image
v-for="url in urls"
:key="url"
:src="url"
:preview-src-list="urls"
lazy
style="width: 500px; height: 500px"/>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
orderValue: '',
orderArray: [],
productNameValue: '',
productName: [],
servePeopleValue: '',
servePeople: [],
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
dialogFormVisible: false,
urls: [],
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
fetchData() {
this.getCustomer('')
this.getOrder('')
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getOrder(query) {
this.orderArray = []
let customerNameValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['买方名称', this.customerNameValue]
param[2] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_通过客户_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderArray.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProduct() {
this.productNameValue = ''
this.productName = []
if (this.orderValue) {
var param = []
param[0] = ['订单流水号', this.orderValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
searchTable() {
let customerNameValue_check, dateRange_check, productNameValue_check, orderValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
var param = []
param[0] = ['客户流水号_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['订单编号_check', orderValue_check]
param[6] = ['订单流水号', this.orderValue]
param[7] = ['产品名称_check', productNameValue_check]
param[8] = ['组件流水号', this.productNameValue]
param[9] = ['排序名称', this.orderName]
param[10] = ['排序方式', this.order]
var Data = this.CreateData('11', '售后服务_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
uploadOrViewPhotos(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['售后服务流水号', row.售后服务流水号]
var Data = this.CreateData('11', '售后服务_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
sortChange(column) {
if (column.prop === '买方名称') {
this.orderName = 1
} else if (column.prop === '订单编号') {
this.orderName = 2
} else if (column.prop === '产品名称') {
this.orderName = 3
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,131 @@
<template>
<div style="margin: 20px 20px 20px 20px;width: 1200px;height: 810px">
<el-form ref="form" :inline="true" :model="form" label-width="160px">
<el-form-item label="公司名称:" style="margin-top: 50px">
<el-input v-model="form.name" style="width: 350px"/>
</el-form-item>
<el-form-item label="公司地址:" style="margin-top: 50px;">
<el-input v-model="form.adress" style="width: 350px"/>
</el-form-item>
<el-form-item label="开户行:">
<el-input v-model="form.bank" style="width: 350px"/>
</el-form-item>
<el-form-item label="账号:">
<el-input v-model="form.account" style="width: 350px"/>
</el-form-item>
<el-form-item label="服务热线:">
<el-input v-model="form.serviceHotline" style="width: 350px"/>
</el-form-item>
<el-form-item label="联系电话:">
<el-input v-model="form.contactNumber" style="width: 350px"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="form.contacts" style="width: 350px"/>
</el-form-item>
<el-form-item label="传真:">
<el-input v-model="form.fax" style="width: 350px"/>
</el-form-item>
<el-form-item label="收货人:">
<el-input v-model="form.consignee" style="width: 350px"/>
</el-form-item>
<el-form-item label="收货人电话:">
<el-input v-model="form.receiverTelephoneNumber" style="width: 350px"/>
</el-form-item>
<el-form-item label="合同协议:">
<el-input v-model="form.agreement" :rows="11" type="textarea" style="width: 875px"/>
</el-form-item>
<el-button type="primary" style="margin-top: 20px;margin-left: 520px;width: 100px" @click="modifyCompanyInformation()">修改</el-button>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
adress: '',
receiverTelephoneNumber: '',
consignee: '',
fax: '',
contacts: '',
contactNumber: '',
serviceHotline: '',
account: '',
bank: '',
agreement: ''
}
}
},
computed: {
},
created() {
this.searchCompanyInformation()
},
methods: {
searchCompanyInformation() {
var param = []
var Data = this.CreateData('11', '基础表_公司信息维护表_查询', param)
this.ExecDatabase(Data).then(response => {
this.form.name = response.data[0].公司名称
this.form.adress = response.data[0].公司地址
this.form.bank = response.data[0].开户行
this.form.account = response.data[0].账号
this.form.serviceHotline = response.data[0].服务热线
this.form.contactNumber = response.data[0].联系电话
this.form.contacts = response.data[0].联系人
this.form.fax = response.data[0].传真
this.form.consignee = response.data[0].收货人
this.form.receiverTelephoneNumber = response.data[0].收货人电话
this.form.agreement = response.data[0].合同协议
})
},
modifyCompanyInformation() {
this.$confirm('是否确认修改公司信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['公司名称', this.form.name]
param[1] = ['公司地址', this.form.adress]
param[2] = ['开户行', this.form.bank]
param[3] = ['账号', this.form.account]
param[4] = ['服务热线', this.form.serviceHotline]
param[5] = ['联系电话', this.form.contactNumber]
param[6] = ['联系人', this.form.contacts]
param[7] = ['传真', this.form.fax]
param[8] = ['收货人', this.form.consignee]
param[9] = ['收货人电话', this.form.receiverTelephoneNumber]
param[10] = ['合同协议', this.form.agreement]
var Data = this.CreateData('12', '基础表_公司信息维护表_修改', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchCompanyInformation()
} else {
this.$message.error('修改失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消修改'
})
})
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-input__inner{
border-radius: 0px;
text-align: center;
}
/deep/.el-button--primary {
color: #409EFF;
background: #ecf5ff;
border-color: #b3d8ff;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,397 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="customerName" style="width: 200px" size="small" clearable placeholder="客户名称" @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-input v-model="region" style="width: 200px;margin-left: 10px" clearable size="small" placeholder="省份" @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>
<el-button type="distribution" icon="el-icon-circle-plus-outline" size="small" @click="addCustomer();flag1 = 1">客户</el-button>
</div>
<div style="margin-top: 20px">
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 1491px" height="740px">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('客户编码')" label="客户编码" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户编码 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('客户名称')" label="客户名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('简称')" label="简称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.简称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('省份')" label="省份" align="center">
<template slot-scope="scope">
{{ scope.row.省份 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="联系人" align="center">
<template slot-scope="scope">
{{ scope.row.联系人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('联系电话')" label="联系电话" align="center">
<template slot-scope="scope">
{{ scope.row.经理电话 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('收货电话')" label="收货电话" align="center">
<template slot-scope="scope">
{{ scope.row.电话 }}
</template>
</el-table-column>
<el-table-column width="190px" label="邮寄地址" align="center">
<template slot-scope="scope">
{{ scope.row.地址 }}
</template>
</el-table-column>
<el-table-column width="150px" label="电子邮箱" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.电子邮箱 }}
</template>
</el-table-column>
<el-table-column width="150px" label="备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-tooltip :open-delay="1000" class="item" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button
size="mini"
type="text"
class="el-icon-edit-outline"
@click="handleEdit(scope.row);flag1 = 2"/>
</div>
</el-tooltip>
<el-tooltip :open-delay="1000" class="item" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button
size="mini"
type="text"
style="margin-left: 20px"
class="el-icon-delete"
@click="handleDelete(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogFormVisible" center width="700px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-col :span="12">
<el-form-item label="省份:" prop="省份">
<el-select v-model="form.省份" size="mini" style="margin: 0;width: 200px" placeholder="请选择省份" filterable clearable>
<el-option
v-for="item in province"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户编码:" prop="客户编码">
<el-input v-model="form.客户编码" clearable size="small" style="width:200px" placeholder="请输入客户编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称:" prop="客户名称">
<el-input v-model="form.客户名称" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="简称:" prop="简称">
<el-input v-model="form.简称" clearable size="small" style="width:200px" placeholder="请输入简称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人:" prop="联系人">
<el-input v-model="form.联系人" clearable size="small" style="width:200px" placeholder="请输入联系人"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话:" prop="经理电话">
<el-input v-model="form.经理电话" clearable size="small" style="width:200px" placeholder="请输入联系电话"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收货人:" prop="收货人">
<el-input v-model="form.收货人" clearable size="small" style="width:200px" placeholder="请输入收货人"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收货电话:" prop="联系电话">
<el-input v-model="form.联系电话" clearable size="small" style="width:200px" placeholder="请输入收货电话"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮寄地址:" prop="邮寄地址">
<el-input v-model="form.邮寄地址" clearable size="small" style="width:200px" placeholder="请输入邮寄地址"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电子邮箱:" prop="电子邮箱">
<el-input v-model="form.电子邮箱" clearable size="small" style="width:200px" placeholder="请输入电子邮箱"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注:" prop="备注">
<el-input v-model="form.备注" clearable size="small" style="width:200px" placeholder="请输入备注"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button type="distribution" size="small" @click="submit('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
region: '', // 地区
customerName: '', // 客户名称
customerValue: '',
province: [],
dialogFormVisible: false,
form: {
客户编码: '',
客户名称: '',
简称: '',
省份: '',
联系人: '',
经理电话: '',
收货人: '',
联系电话: '',
邮寄地址: '',
电子邮箱: '',
备注: ''
},
people: [],
rules: {
省份: [{ required: true, message: '请选择省份' }],
客户名称: [{ required: true, message: '请输入客户名称' }],
收货人: [{ required: true, message: '请输入收货人' }],
联系电话: [{ required: true, message: '请输入收货电话' }],
简称: [{ required: true, message: '请输入简称' }],
经理电话: [{ required: true, message: '请输入联系电话' }],
联系人: [{ required: true, message: '请输入联系人' }]
},
title: '',
flag1: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 客户信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
fetchData() {
this.getPeople()
this.getProvince()
},
getPeople() {
var param = []
var Data = this.CreateData('11', '人员信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getProvince() {
var param = []
var Data = this.CreateData('11', '省份信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.province.push({
label: response.data[i].省份,
value: response.data[i].省份流水号
})
}
})
},
addCustomer() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '新增客户'
this.dialogFormVisible = true
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑客户'
this.customerValue = row.客户流水号
this.form.省份 = parseInt(row.省份流水号)
this.form.客户编码 = row.客户编码
this.form.客户名称 = row.客户名称
this.form.简称 = row.简称
this.form.联系人 = row.联系人
this.form.经理电话 = row.经理电话
this.form.收货人 = row.收货人
this.form.联系电话 = row.电话
this.form.邮寄地址 = row.地址
this.form.电子邮箱 = row.电子邮箱
this.form.备注 = row.备注
this.dialogFormVisible = true
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.flag1 === 1) {
var param = []
param[0] = ['省份', this.form.省份]
param[1] = ['客户名称', this.form.客户名称]
param[2] = ['简称', this.form.简称]
param[3] = ['联系人', this.form.联系人]
param[4] = ['经理电话', this.form.经理电话]
param[5] = ['收货人', this.form.收货人]
param[6] = ['联系电话', this.form.联系电话]
param[7] = ['邮寄地址', this.form.邮寄地址]
param[8] = ['电子邮箱', this.form.电子邮箱]
param[9] = ['备注', this.form.备注]
param[10] = ['客户编码', this.form.客户编码]
var Data = this.CreateData('12', '客户管理_客户信息_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新增成功')
this.dialogFormVisible = false
this.searchTable()
} else {
this.$message.success('新增失败')
}
})
this.flag1 = ''
} else if (this.flag1 === 2) {
var param1 = []
param1[0] = ['省份', this.form.省份]
param1[1] = ['客户名称', this.form.客户名称]
param1[2] = ['简称', this.form.简称]
param1[3] = ['联系人', this.form.联系人]
param1[4] = ['经理电话', this.form.经理电话]
param1[5] = ['收货人', this.form.收货人]
param1[6] = ['联系电话', this.form.联系电话]
param1[7] = ['邮寄地址', this.form.邮寄地址]
param1[8] = ['电子邮箱', this.form.电子邮箱]
param1[9] = ['备注', this.form.备注]
param1[10] = ['客户流水号', this.customerValue]
param1[11] = ['客户编码', this.form.客户编码]
var Data1 = this.CreateData('12', '客户管理_客户信息_编辑', param1)
this.ExecDatabase(Data1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false
this.searchTable()
} else {
this.$message.success('编辑失败')
}
})
this.flag1 = ''
}
}
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
searchTable() {
let customerName_check, region_check
this.customerName ? customerName_check = 1 : customerName_check = 0
this.region ? region_check = 1 : region_check = 0
var param = []
param[0] = ['客户名称_check', customerName_check]
param[1] = ['客户名称', this.customerName]
param[2] = ['地区_check', region_check]
param[3] = ['地区', this.region]
var Data = this.CreateData('11', '客户管理_客户信息_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
handleDelete(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['客户流水号', row.客户流水号]
var Data = this.CreateData('12', '客户管理_客户信息_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,652 @@
<template>
<div class="app-container">
<el-card style="height: 790px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable();getCustomerNo(contractNoValue)">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="contractNoValue"
:remote-method="getCustomerNo"
style="width:200px"
placeholder="合同编号"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in contractNo"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">创建日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 100;searchTable()"/>
<!--<el-select v-model="orderValue" style="width:200px" placeholder="订单编号" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<el-select
v-model="orderStateValue"
style="width:100px"
placeholder="订单状态"
size="small"
filterable
clearable
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in orderState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-checkbox v-model="checked" @change="pageCurrent = 1;pageSize = 100;searchTable()">全部</el-checkbox>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
@click="pageCurrent = 1;pageSize = 100;searchTable()">查询
</el-button>
<el-button
icon="el-icon-phone"
type="primary"
plain
size="small"
style="margin-left: 250px"
@click="DeliveryNotice()">通知发货
</el-button>
</div>
<el-col style="width: 981px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
border
stripe
size="small"
style="width: 981px"
height="680px"
@row-click="searchTable1"
@sort-change="sortChange">
<el-table-column width="60px" label="状态" align="center" prop="状态">
<template slot-scope="scope">
{{ scope.row.订单状态 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('买方名称')" label="买方" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方 }}
</template>
</el-table-column>
<el-table-column label="客户要求" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户要求 }}
</template>
</el-table-column>
<el-table-column width="80px" label="合同备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.合同备注 }}
</template>
</el-table-column>
<el-table-column width="105px" label="交货日期" align="center" sortable="完成期限" prop="完成期限">
<template slot-scope="scope">
{{ scope.row.完成期限 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="合同金额" align="center">
<template slot-scope="scope">
{{ scope.row.合同金额 ? Number(scope.row.合同金额).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="90px" label="收款日期" align="center">
<template slot-scope="scope">
{{ scope.row.收款日期 }}
</template>
</el-table-column>
<el-table-column width="90px" label="已收款项" align="center">
<template slot-scope="scope">
{{ scope.row.未收款项 ? Number(scope.row.未收款项).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="90px" label="未收款项" align="center">
<template slot-scope="scope">
{{ scope.row.已收款项 ? Number(scope.row.已收款项).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="160px" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit" @click="Collection(scope.row)">收款</el-button>
<el-button type="text" size="mini" icon="el-icon-search" @click="searchTable2(scope.row)">记录</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, prev, pager, next"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-left: 10px;width: 671px">
<el-table
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
border
stripe
size="small"
style="width: 721px"
height="680px"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column :width="setColumnWidth('状态')" label="产品状态" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.任务状态 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="75px" label="订单数量" align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="60px" label="完成数" align="center">
<template slot-scope="scope">
{{ scope.row.完成数量 }}
</template>
</el-table-column>
<el-table-column width="90px" label="已通知发货" align="center">
<template slot-scope="scope">
{{ scope.row.已通知发货数量 }}
</template>
</el-table-column>
<el-table-column width="60px" label="已发数" align="center">
<template slot-scope="scope">
{{ scope.row.已发数量 }}
</template>
</el-table-column>
<el-table-column label="本次发货数" align="center">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.本次发货数"
:max="scope.row.数量-scope.row.已通知发货数量"
:min="0"
style="width: 100%"
size="small"/>
</template>
</el-table-column>
</el-table>
</el-col>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="已收款" center width="400px">
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="center"
label-width="110px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="已收金额" prop="moneyValue">
<el-input-number
v-model="form.moneyValue"
:min="0"
:step="1"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注">
<el-input
v-model="form.备注"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff1()">取消</el-button>
<el-button type="distribution" size="small" @click="updateMoney()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="收款记录" center width="500px">
<el-table
:data="tableData2"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
border
stripe
size="small"
style="width: 460px"
height="300px">
<el-table-column align="center" width="60" type="index" label="序号"/>
<el-table-column width="100px" label="收款金额" align="center">
<template slot-scope="scope">
{{ scope.row.金额 }}
</template>
</el-table-column>
<el-table-column width="100px" label="收款时间" align="center">
<template slot-scope="scope">
{{ scope.row.时间 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit" @click="update(scope.row)">修改金额</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="收款金额" center width="400px">
<el-form
ref="form1"
:model="form1"
:rules="rules1"
label-position="center"
label-width="110px"
class="demo-ruleForm">
<el-row>
<el-col :span="12">
<el-form-item label="收款金额" prop="moneyValue">
<el-input-number
v-model="form1.moneyValue"
:min="0"
:step="1"
size="small"
style="width:200px"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible2=false">取消</el-button>
<el-button type="distribution" size="small" @click="submitUpdate()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
numberValue: '',
contractNo: [],
contractNoValue: '',
checked: false,
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
orderValue: '', // 订单编号
orderArray: [], // 订单编号数组
dateRange: '', // 下单日期
orderStateValue: '', // 订单状态
orderState: [], // 合同状态数组
loading: false, // 数据加载
projectValue: '',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
tableData2: [],
form: {
moneyValue: '',
备注: ''
},
rules: {
moneyValue: [{ required: true, message: '请输入收款金额', trigger: 'blur' }]
},
form1: {
moneyValue: ''
},
rules1: {
moneyValue: [{ required: true, message: '请输入收款金额', trigger: 'blur' }]
},
moneyValue: '',
multipleSelection: [],
multipleSelection_variable: [],
deliveryNum: [],
orderFloatValue: '',
groupNum: [],
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
this.getCustomerNo(this.contractNoValue)
this.searchTable()
},
methods: {
searchTable2(row) {
var param = []
param[0] = ['项目流水号', row.项目流水号]
var Data = this.CreateData('11', '发货通知_订单信息_收款查看', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
this.dialogFormVisible1 = true
})
},
getCustomerNo(query) {
this.contractNo = []
this.contractNoValue = ''
let check
this.customerNameValue ? check = 1 : check = 0
var param = []
param[0] = ['买方名称_check', check]
param[1] = ['买方名称', this.customerNameValue]
param[2] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_通过客户_查询数据_BAK', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNo.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
fetchData() {
this.getCustomer()
this.getOrder('')
this.getOrderState()
},
update(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.form1.moneyValue = row.金额
this.numberValue = row.id
this.projectValue = row.项目流水号
this.dialogFormVisible2 = true
},
submitUpdate() {
this.$refs['form1'].validate((valid) => {
if (valid) {
var param = []
param[0] = ['项目流水号', this.projectValue]
param[1] = ['金额', this.form1.moneyValue]
param[2] = ['id', this.numberValue]
var Data = this.CreateData('12', '发货通知_订单信息_收款记录修改', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('更改成功')
this.searchTable()
var param = []
param[0] = ['项目流水号', this.projectValue]
var Data = this.CreateData('11', '发货通知_订单信息_收款查看', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
this.dialogFormVisible2 = false
} else {
this.$message.warning('更改失败!')
}
})
} else {
return false
}
})
},
Collection(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.projectValue = row.项目流水号
this.dialogFormVisible = true
},
callOff1() {
this.dialogFormVisible = false
},
updateMoney() {
this.$refs['form'].validate((valid) => {
if (valid) {
var param = []
param[0] = ['项目流水号', this.projectValue]
param[1] = ['收款金额', this.form.moneyValue]
param[2] = ['备注', this.form.备注]
var Data = this.CreateData('12', '发货通知_订单信息_收款', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('更改成功')
this.searchTable()
this.dialogFormVisible = false
} else {
this.$message.warning('更改失败!')
}
})
} else {
return false
}
})
},
cancelShipment(row) {
var param = []
param[0] = ['订单流水号', row.订单流水号]
var Data = this.CreateData('12', '发货通知_取消发货', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('取消发货成功')
this.searchTable()
} else {
this.$message.warning('取消发货失败!')
}
})
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getOrder(query) {
this.orderArray = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderArray.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getOrderState() {
var param = []
var Data = this.CreateData('11', '订单状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderState.push({
label: response.data[i].订单状态,
value: response.data[i].订单状态流水号
})
}
})
},
selectable(row) {
return row.本次发货数 > 0 && row.数量 - row.已通知发货数量 > 0
},
searchTable() {
let customerNameValue_check, orderValue_check, dateRange_check, orderStateValue_check, check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.contractNoValue ? orderValue_check = 1 : orderValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
if (this.orderStateValue === 0) {
orderStateValue_check = 1
} else if (this.orderStateValue) {
orderStateValue_check = 1
} else {
orderStateValue_check = 0
}
this.checked ? check = 1 : check = 0
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['订单编号_check', orderValue_check]
param[3] = ['订单流水号', this.contractNoValue]
param[4] = ['下单日期_check', dateRange_check]
param[5] = ['开始时间', this.dateRange[0]]
param[6] = ['结束时间', this.dateRange[1]]
param[7] = ['订单状态_check', orderStateValue_check]
param[8] = ['订单状态', this.orderStateValue]
param[9] = ['是合全部_check', check]
param[10] = ['排序名称', this.orderName]
param[11] = ['排序方式', this.order]
var Data = this.CreateData('11', '发货通知_订单信息_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
this.orderFloatValue = row.订单流水号
var param = []
param[0] = ['订单流水号', row.订单流水号]
var Data = this.CreateData('11', '发货通知_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
sortChange(column) {
if (column.prop === '完成期限') {
this.orderName = 1
} else if (column.prop === '调拨日期') {
this.orderName = 2
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
DeliveryNotice() {
if (this.multipleSelection.length !== 0) {
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
this.deliveryNum = []
this.groupNum = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
this.deliveryNum[i] = this.multipleSelection_variable[i].本次发货数
this.groupNum[i] = this.multipleSelection_variable[i].组件流水号
}
var param = []
param[0] = ['本次发货数组', this.deliveryNum]
param[1] = ['组件流水号组', this.groupNum]
var Data = this.CreateData('12', '发货管理_通知发货', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('通知成功')
var param1 = []
param1[0] = ['订单流水号', this.orderFloatValue]
var Data1 = this.CreateData('11', '发货通知_产品信息_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData1 = response.data
})
} else {
this.$message.success('通知失败')
}
})
} else {
this.$message.warning('请勾选要发货的产品')
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.ziduan {
width: 50px !important;
}
</style>

View File

@@ -0,0 +1,59 @@
<template>
<div>
<el-card>
<el-tabs v-model="activeName" type="border-card" @tab-click="Refresh">
<el-tab-pane label="下单通知" name="1"><orderNotice ref="fresh1"/></el-tab-pane>
<el-tab-pane label="付款通知" name="2"><paymentOrder ref="fresh2"/></el-tab-pane>
<el-tab-pane label="发货通知" name="3"><DeliveryNotice ref="fresh3"/></el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import orderNotice from '@/views/SalesManagement/DeliveryNotice/orderNotice.vue'
import paymentOrder from '@/views/SalesManagement/DeliveryNotice/paymentOrder.vue'
import DeliveryNotice from '@/views/SalesManagement/DeliveryNotice/DeliveryNotice.vue'
export default {
components: {
'orderNotice': orderNotice,
'paymentOrder': paymentOrder,
'DeliveryNotice': DeliveryNotice
},
data() {
return {
activeName: '1',
label: '`',
isDisable: true
}
},
methods: {
Refresh() {
switch (this.activeName) {
case '1': {
this.label = '`'
this.isDisable = true
break
}
case '2': {
this.label = '`'
this.isDisable = true
break
}
case '3': {
this.label = '`'
this.isDisable = true
break
}
}
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-card__body{
padding: 0px!important;
}
</style>

View File

@@ -0,0 +1,294 @@
<template>
<div class="app-container">
<el-card style="height: 790px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="customerNameValue" style="width:200px" placeholder="买方名称/收货人" size="small" clearable/>
<el-select
v-model="contractNoValue"
:remote-method="getCustomerNo"
style="width:200px"
placeholder="合同编号"
size="small"
filterable
clearable
remote>
<el-option
v-for="item in contractNo"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">通知日期</span>
<el-date-picker
v-model="dateRange"
size="small"
placeholder="选择日期"
align="center"
style="width:200px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
@change="pageCurrent = 1;pageSize = 20;searchTable()"
/>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;pageSize = 20;searchTable()">查询
</el-button>
</div>
<el-col style="width: 1461px">
<el-table
v-loading="loading"
:data="tableData"
height="680px"
highlight-current-row
border
stripe
size="small"
style="width: 1461px">
<el-table-column :width="setColumnWidth('合同编号')" label="合同编号" align="center" prop="合同编号">
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('买方名称')" label="买方名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('金额')" label="合同金额(元)" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.合同金额 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="交货期限" align="center">
<template slot-scope="scope">
{{ scope.row.交货期限 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('付款方式')" label="付款方式" align="center">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('税率')" label="税率" align="center">
<template slot-scope="scope">
{{ scope.row.税率 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('备注')" label="合同备注" align="center">
<template slot-scope="scope">
{{ scope.row.合同备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="签订日期" align="center">
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="创建人" align="center">
<template slot-scope="scope">
{{ scope.row.创建人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="提交日期" align="center">
<template slot-scope="scope">
{{ scope.row.提交日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="通知人" align="center">
<template slot-scope="scope">
{{ scope.row.通知人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="通知日期" align="center">
<template slot-scope="scope">
{{ scope.row.通知日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('备注')" align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="noticeOrder(scope.row)">通知下单</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
contractNoValue: '', // 合同编号
contractNo: [], // 合同编号数组
// orderValue: '', // 订单编号
// orderArray: [], // 订单编号数组
dateRange: '', // 通知日期
orderStateValue: '', // 订单状态
orderState: [], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData100: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getCustomer('')
this.getCustomerNo('')
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getCustomerNo(query) {
this.contractNo = []
var param = []
param[0] = ['合同编号', query]
var Data = this.CreateData('11', '合同管理_合同编号_查询数据_BAK', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contractNo.push({
label: response.data[i].合同编号,
value: response.data[i].合同编号
})
}
})
},
searchTable() {
let dateRange_check
this.tableData100 = []
if (this.customerNameValue) {
this.customerNameValue_check = 1
} else {
this.customerNameValue_check = 0
}
if (this.contractNoValue) {
this.contractNoValue_check = 1
} else {
this.contractNoValue_check = 0
}
// this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
// this.contractNoValue ? contractNoValue_check = 1 : contractNoValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['买方名称_check', this.customerNameValue_check]
param[1] = ['客户', this.customerNameValue]
param[2] = ['合同编号_check', this.contractNoValue_check]
param[3] = ['合同编号', this.contractNoValue]
param[4] = ['通知日期_check', dateRange_check]
param[5] = ['通知日期', this.dateRange]
console.log(param)
var Data = this.CreateData('11', '会计通知_下单通知_查询数据_bak', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData100.push({
项目流水号: response.data.rows[i].项目流水号,
合同编号: response.data.rows[i].合同编号,
买方名称: response.data.rows[i].客户名称,
合同金额: response.data.rows[i].合同金额,
交货期限: response.data.rows[i].交货期限,
付款方式: response.data.rows[i].付款方式,
税率: response.data.rows[i].税率,
收货人: response.data.rows[i].收货人员,
合同备注: response.data.rows[i].合同备注,
签订日期: response.data.rows[i].签订日期,
提交日期: response.data.rows[i].提交日期,
创建人: response.data.rows[i].创建人,
通知人: response.data.rows[i].通知人,
通知日期: response.data.rows[i].通知日期
})
}
}
this.total = response.data.total
}).then(() => {
this.tableData = this.tableData100
})
},
noticeOrder(row) {
this.$confirm('是否确认通知?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['项目流水号', row.项目流水号]
param[1] = ['通知人', this.id]
var Data = this.CreateData('12', '会计通知_下单通知', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('通知成功')
this.searchTable()
} else {
this.$message.error('通知失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消确认'
})
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,403 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="supplierName"
style="width:150px; text-align: center"
placeholder="供应商"
size="small"
clearable
filterable
@change="pageCurrent=1;searchTable();getContract()">
<el-option
v-for="item in suppliers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="contractValue"
:remote-method="getContract"
style="width:150px; text-align: center"
placeholder="合同号"
size="small"
clearable
filterable
remote
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in contract"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="purchaseState"
style="width:100px;"
size="small"
placeholder="采购状态"
filterable
clearable
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in purchaseStates"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">付款日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;searchTable()"/>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px;"
@click="pageCurrent = 1;searchTable()">查询
</el-button>
</div>
<el-col style="width: 821px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
border
stripe
size="small"
height="680px"
style="width: 821px"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('状态')" label="采购状态" align="center" prop="采购状态">
<template slot-scope="scope">
{{ scope.row.采购状态 }}
</template>
</el-table-column>
<el-table-column width="130px" label="采购合同号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购合同号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('买方名称')" label="供应商" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column width="100px" label="合同金额" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.合同金额 ? Number(scope.row.合同金额).toFixed(2) : 0.00 }}
</template>
</el-table-column>
<el-table-column width="90px" label="付款金额" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.付款金额 ? Number(scope.row.付款金额).toFixed(2) : 0.00 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="付款日期" align="center">
<template slot-scope="scope">
{{ scope.row.付款日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="审批时间" align="center">
<template slot-scope="scope">
{{ scope.row.审批时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="paymentOrder(scope.row)">付款通知</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-top: 10px;margin-left: 30px;width: 801px">
<el-table
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
border
stripe
size="small"
height="680px"
style="width: 801px">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column :width="setColumnWidth('采购件')" label="采购件" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.采购件 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" label="图号/规格" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('材料')" label="材料" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="数量" align="center">
<template slot-scope="scope">
{{ scope.row.采购数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单位')" label="单位" align="center">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单价')" label="单价(元)" align="center">
<template slot-scope="scope">
{{ scope.row.单价 ? Number(scope.row.单价).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单价')" label="金额" align="center">
<template slot-scope="scope">
{{ scope.row.金额 ? Number(scope.row.金额).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('备注')" label="采购备注" align="center">
<template slot-scope="scope">
{{ scope.row.采购备注 }}
</template>
</el-table-column>
</el-table>
</el-col>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="付款通知" center width="350px">
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="left"
class="demo-ruleForm"
label-width="100px"
style="margin: auto">
<el-form-item label="付款金额" prop="paymentAmount">
<el-input-number
v-model="form.paymentAmount"
:min="0"
:max="MaxMoney"
style="width: 180px"
size="small"
clearable
placeholder="请输入付款金额"/>
</el-form-item>
<el-form-item label="付款时间" prop="paymentTime1">
<el-date-picker
v-model="form.paymentTime1"
size="small"
align="center"
style="width: 180px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="请选择付款时间"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="submitSuccession('form')"> </el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getNowShotTime } from '@/utils/tool'
export default {
data() {
return {
purchaseStates: [],
purchaseState: '',
suppliers: [],
supplierName: '',
contractValue: '',
contract: [],
paymentTime: '', // 付款时间
dateRange: '', // 通知日期
loading: false, // 数据加载
dialogFormVisible: false,
title: '',
MaxMoney: 0,
form: {
paymentAmount: '',
paymentTime1: ''
},
rules: {
paymentAmount: [{ required: true, message: '请输入' }],
paymentTime1: [{ required: true, message: '请选择' }]
},
multipleSelection: [],
multipleSelection_variable: [],
deliveryNum: [],
orderFloatValue: '',
groupNum: [],
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageCurrent1: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSuppliers()
this.getContract()
this.getState()
this.searchTable()
},
getSuppliers() {
var param = []
var Data = this.CreateData('11', '供应商_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.suppliers.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商流水号
})
}
})
},
getContract(query) {
this.contract = []
let supplierName_check
this.supplierName ? supplierName_check = 1 : supplierName_check = 0
var param = []
param[0] = ['供应商流水号_check', supplierName_check]
param[1] = ['供应商流水号', this.supplierName]
param[2] = ['采购合同编号', query]
var Data = this.CreateData('11', '仓储管理_采购合同_通过供应商查询_BAK', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.contract.push({
label: response.data[i].采购合同编号,
value: response.data[i].采购合同流水号
})
}
})
},
getState() {
var param = []
var Data = this.CreateData('11', '采购管理_采购合同查询_采购状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.purchaseStates.push({
label: response.data[i].采购状态名称,
value: response.data[i].采购状态流水号
})
}
})
},
searchTable() {
this.tableData1 = []
let supplierName_check, contractValue_check, purchaseState_check, dateRange_check
this.supplierName ? supplierName_check = 1 : supplierName_check = 0
this.contractValue ? contractValue_check = 1 : contractValue_check = 0
this.purchaseState ? purchaseState_check = 1 : purchaseState_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['供应商流水号_check', supplierName_check]
param[1] = ['供应商流水号', this.supplierName]
param[2] = ['采购合同_check', contractValue_check]
param[3] = ['采购合同流水号', this.contractValue]
param[4] = ['采购状态_check', purchaseState_check]
param[5] = ['采购状态', this.purchaseState]
param[6] = ['付款日期_check', dateRange_check]
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
param[9] = ['排序名称', this.orderName]
param[10] = ['排序方式', this.order]
var Data = this.CreateData('11', '采购管理_采购合同_付款通知_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
var param = []
param[0] = ['采购合同流水号', row.采购合同流水号]
var Data = this.CreateData('11', '采购管理_采购合同明细_全部_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
paymentOrder(row) {
this.MaxMoney = Number(row.合同金额)
this.form.paymentAmount = Number(row.合同金额) - Number(row.付款金额)
console.log(this.form.paymentAmount, Number(row.合同金额), Number(row.付款金额), row.付款金额)
this.form.paymentTime1 = getNowShotTime()
this.orderFloatValue = row.采购合同流水号
this.dialogFormVisible = true
},
submitSuccession(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['付款金额', this.form.paymentAmount]
param[1] = ['付款时间', this.form.paymentTime1]
param[2] = ['采购合同流水号', this.orderFloatValue]
var Data = this.CreateData('12', '付款通知_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '付款成功',
type: 'success'
})
this.searchTable()
this.dialogFormVisible = false
} else {
this.$message.error('付款失败')
}
})
} else {
return false
}
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,411 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="orderValue"
:remote-method="getOrder"
style="width:200px"
placeholder="订单编号"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable();getProductName()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">通知日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-select
v-model="productValue"
style="width:100px;margin-left: 10px"
placeholder="产品名称"
size="small"
filterable
clearable
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in product"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productStateValue"
style="width:100px;margin-left: 10px"
placeholder="产品状态"
size="small"
filterable
clearable
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in productState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;pageSize = 100;searchTable()">查询
</el-button>
</div>
<div style="margin-top: 20px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName"
highlight-current-row
show-summary
border
size="small"
style="width: 1531px"
height="740px"
@sort-change="sortChange">
<el-table-column
:width="setColumnWidth('通知日期')"
label="通知日期"
align="center"
prop="通知日期"
sortable="通知日期">
<template slot-scope="scope">
{{ scope.row.通知日期 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('订单编号')"
label="订单编号"
align="center"
prop="订单编号"
sortable="订单编号"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('买方名称')"
label="买方名称"
align="center"
prop="买方名称"
sortable="买方名称"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="交货日期" align="center">
<template slot-scope="scope">
{{ scope.row.交货日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('状态')" label="状态" align="center">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('通知发货数')" label="通知发货数" align="center" prop="本次发货">
<template slot-scope="scope">
{{ scope.row.本次发货 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('实际发货数')" label="实际发货数" align="center" prop="本次已发数量">
<template slot-scope="scope">
{{ scope.row.本次已发数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('累计发货数')" label="累计发货数" align="center" prop="已发数">
<template slot-scope="scope">
{{ scope.row.已发数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="订单数量" align="center" prop="订单数量">
<template slot-scope="scope">
{{ scope.row.订单数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品详情')" label="产品详情" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品详情 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="!(Number(scope.row.本次已发数量)===0 && Number(scope.row.是否选入)===0)"
type="text"
icon="el-icon-delete"
size="mini"
@click="deleteNotice(scope.row)"/>
</template>
</el-table-column>
</el-table>
</div>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
orderValue: '', // 订单编号
orderArray: [], // 订单编号数组
product: [],
productValue: '',
productStateValue: '', // 产品状态
productState: [], // 产品状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getCustomer('')
this.getOrder('')
this.getTaskStateType()
this.searchTable()
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getOrder(query) {
this.orderArray = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderArray.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductName() {
this.productValue = ''
this.product = []
if (this.orderValue) {
var param = []
param[0] = ['订单流水号', this.orderValue]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.product.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
}
},
getTaskStateType() {
var param = []
var Data = this.CreateData('11', '基础表_产品状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productState.push({
label: response.data[i].任务状态,
value: response.data[i].任务状态流水号
})
}
})
},
searchTable() {
let customerNameValue_check, dateRange_check, productStateValue_check, orderValue_check, productValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
this.productValue ? productValue_check = 1 : productValue_check = 0
if (this.productStateValue === 0) {
productStateValue_check = 1
} else if (this.productStateValue) {
productStateValue_check = 1
} else {
productStateValue_check = 0
}
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
param[5] = ['产品状态_check', productStateValue_check]
param[6] = ['产品状态流水号', this.productStateValue]
param[7] = ['订单流水号_check', orderValue_check]
param[8] = ['订单流水号', this.orderValue]
param[9] = ['组件流水号_check', productValue_check]
param[10] = ['组件流水号', this.productValue]
param[11] = ['排序名称', this.orderName]
param[12] = ['排序方式', this.order]
var Data = this.CreateData('11', '产品发货_通知记录_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
deleteNotice(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['发货通知流水号', row.发货通知流水号]
var Data = this.CreateData('12', '发货通知_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
sortChange(column) {
if (column.prop === '通知日期') {
this.orderName = 1
} else if (column.prop === '订单编号') {
this.orderName = 2
} else if (column.prop === '买方名称') {
this.orderName = 3
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
tableRowClassName({ row, rowIndex }) {
if (row.状态 === '未接受') {
return 'no-accept'
} else if (row.状态 === '装配中') {
return 'assembly'
} else if (row.状态 === '完成') {
return 'complete'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.el-table .no-accept {
background: #F2D1D6 !important;
}
.el-table .assembly {
background: #98D7FC !important;
}
.el-table .complete {
background: #c6d7b3 !important;
}
</style>

View File

@@ -0,0 +1,518 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="consignee" style="width: 100px" size="small" clearable placeholder="收货人"/>
<el-input v-model="orderValue" style="width: 200px" size="small" clearable placeholder="买方/订单号"/>
<el-input v-model="logistics" style="width: 150px" size="small" clearable placeholder="物流单号"/>
<span style="font-size: 13px;color: black">发货日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
clearable
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-select v-model="deliveryStateValue" style="width:100px;margin-left: 10px" placeholder="发货状态" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in deliveryState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>
</div>
<el-col style="margin-top: 10px;width: 891px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:summary-method="getSummaries"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 891px"
height="740px"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('状态')" label="发货状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.发货状态==='未审核'" type="info" size="small" style="margin: 0px">未审核</el-tag>
<el-tag v-if="scope.row.发货状态==='待审核'" type="primary" size="small" style="margin: 0px">待审核</el-tag>
<el-tag v-if="scope.row.发货状态==='已审核'" type="warning" size="small" style="margin: 0px">已审核</el-tag>
<el-tag v-if="scope.row.发货状态==='已发货'" type="success" size="small" style="margin: 0px">已发货</el-tag>
</template>
</el-table-column>
<el-table-column width="120px" label="发货单号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.发货单号 }}
</template>
</el-table-column>
<el-table-column width="87px" label="发货日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.发货日期 }}
</template>
</el-table-column>
<el-table-column width="60px" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column label="收货地址" align="center">
<template slot-scope="scope">
{{ scope.row.收货地址 }}
</template>
</el-table-column>
<el-table-column width="102px" label="物流单号" align="center">
<template slot-scope="scope">
{{ scope.row.物流单号 }}
</template>
</el-table-column>
<el-table-column width="87px" label="发货金额" align="center" prop="发货金额">
<template slot-scope="scope">
{{ Number(scope.row.发货金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="90px" label="发货备注" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.发货备注 }}
</template>
</el-table-column>
<el-table-column width="117px" label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-top" size="mini" @click="uploadPicture(scope.row)">照片</el-button>
<el-button v-show="Number(token)===8 || Number(token)===2" :disabled="scope.row.发货状态==='已发货'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"/>
<el-button type="text" icon="el-icon-edit" size="mini" @click="handleEdit(scope.row)"/>
<el-button size="mini" type="text" icon="el-icon-picture-outline" @click="handlePicture(scope.row)"/>
<el-tooltip :open-delay="500" effect="dark" content="退回发货单" placement="top">
<el-button :disabled="scope.row.发货状态==='未确认'" type="text" icon="el-icon-back" @click="confirmReturn(scope.row)"/>
</el-tooltip>
<el-button :disabled="scope.row.审核状态 > 0" size="mini" type="text" @click="review(scope.row)">审核</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-top: 10px;margin-left: 20px;width: 751px">
<el-table ref="table1" :data="tableData1" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border stripe size="small" style="width: 751px" height="740px">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="买方名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="发货数量" align="center" prop="发货数量">
<template slot-scope="scope">
{{ scope.row.发货数量 ? scope.row.发货数量 : scope.row.查询实际发量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单价')" label="单价" align="center" prop="单价">
<template slot-scope="scope">
{{ Number(scope.row.单价).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="110px" label="金额" align="center" prop="金额">
<template slot-scope="scope">
{{ Number((scope.row.发货数量 ? scope.row.发货数量 : scope.row.查询实际发量) * scope.row.单价).toFixed(2) }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="订单数" align="center" prop="订单数">
<template slot-scope="scope">
{{ scope.row.订单数 }}
</template>
</el-table-column>
</el-table>
</el-col>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="600px">
<el-image v-for="url in urls" :key="url" :src="url" :preview-src-list="urls" lazy style="width: 500px; height: 500px"/>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="编辑发货信息" center width="360px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="100px" class="demo-ruleForm">
<el-form-item label="物流单号" prop="物流单号">
<el-input v-model="form.物流单号" style="width:200px;" placeholder="物流单号" size="small" clearable/>
</el-form-item>
<el-form-item label="收货人" prop="收货人">
<el-input v-model="form.收货人" style="width:200px;" placeholder="收货人" size="small" clearable/>
</el-form-item>
<el-form-item label="收货地址" prop="收货地址">
<el-input v-model="form.收货地址" :rows="4" type="textarea" style="width:200px;" placeholder="收货地址" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button type="distribution" size="small" @click="submitUpdate('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="上传图片" center width="320px">
<el-upload
id="invoiceScan"
ref="upload"
:multiple="true"
:auto-upload="false"
:on-success="uploadSuccess"
:on-exceed="warningExceed"
:limit="limit"
:data="Data"
:action="upload"
style="margin-left: 60px"
list-type="picture-card">
<i class="el-icon-plus"/>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible2=false">取消</el-button>
<el-button type="distribution" size="small" @click="submit2('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { url } from '@/utils/request'
export default {
data() {
return {
Data: {},
limit: 1000,
upload: url,
dialogFormVisible1: false,
dialogFormVisible2: false,
listValue: '',
form: {
物流单号: '',
收货人: '',
收货地址: ''
},
rules: {
物流单号: [{ required: true, message: '请输入物流单号', trigger: 'blur' }],
收货人: [{ required: true, message: '请输入收货人', trigger: 'blur' }],
收货地址: [{ required: true, message: '请输入收货地址', trigger: 'change' }]
},
dialogFormVisible: false,
urls: [],
consignee: '', // 收货人
logistics: '', // 物流单号
orderValue: '', // 订单号
dateRange: '', // 发货日期
deliveryStateValue: '', // 发货状态
deliveryState: [{
value: 0,
label: '未确认'
}, {
value: 1,
label: '已发货'
}], // 发货状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
deliveryMxValue: [],
deliveryNum: [],
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
})
},
created() {
this.searchTable()
},
methods: {
review(row) {
this.$confirm('是否通知审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param1 = []
param1[0] = ['发货单流水号', row.发货单流水号]
var Data1 = this.CreateData('12', '发货查询_发货单_通知审核', param1)
this.ExecDatabase(Data1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('通知成功')
this.searchTable()
} else {
this.$message.error('通知失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
warningExceed() {
this.$message.error('仅可上传五张照片')
},
uploadSuccess(res) { // 上传成功回调
this.dialogFormVisible1 = false
this.$refs.upload.clearFiles()
},
submit2() {
var param = []
param[0] = ['发货单流水号', this.listValue]
param[1] = ['文件名称', '']
param[2] = ['文件后缀', '']
param[3] = ['文件内容', null]
var Data1 = this.CreateData('15', '发货管理_发货单_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible2 = false
this.$nextTick(() => {
this.searchTable()
})
},
uploadPicture(row) {
this.dialogFormVisible2 = true
this.listValue = row.发货单流水号
},
submitUpdate(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param1 = []
param1[0] = ['发货单流水号', this.form.发货单流水号]
param1[1] = ['物流单号', this.form.物流单号]
param1[2] = ['收货人', this.form.收货人]
param1[3] = ['收货地址', this.form.收货地址]
var Data1 = this.CreateData('12', '发货查询_发货单_编辑', param1)
this.ExecDatabase(Data1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable()
this.dialogFormVisible1 = false
} else {
this.$message.error('编辑失败')
}
})
}
})
},
callOff(formName) {
this.form.物流单号 = ''
this.form.收货人 = ''
this.form.收货地址 = ''
this.dialogFormVisible1 = false
this.$refs[formName].resetFields()
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑物料'
this.form.物流单号 = row.物流单号
this.form.发货单流水号 = row.发货单流水号
this.form.收货人 = row.收货人
this.form.收货地址 = row.收货地址
this.dialogFormVisible1 = true
},
searchTable() {
console.log(this.token)
this.tableData1 = []
let consignee_check, dateRange_check, deliveryStateValue_check, logistics_check, orderValue_check
this.consignee ? consignee_check = 1 : consignee_check = 0
this.logistics ? logistics_check = 1 : logistics_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
if (this.deliveryStateValue === 0) {
deliveryStateValue_check = 1
} else if (this.deliveryStateValue) {
deliveryStateValue_check = 1
} else {
deliveryStateValue_check = 0
}
var param = []
param[0] = ['收货人_check', consignee_check]
param[1] = ['收货人', this.consignee]
param[2] = ['发货状态_check', deliveryStateValue_check]
param[3] = ['发货状态', this.deliveryStateValue]
param[4] = ['订单号_check', orderValue_check]
param[5] = ['订单号', this.orderValue]
param[6] = ['物流单号_check', logistics_check]
param[7] = ['物流单号', this.logistics]
param[8] = ['时间_check', dateRange_check]
param[9] = ['开始时间', this.dateRange[0]]
param[10] = ['结束时间', this.dateRange[1]]
param[11] = ['排序名称', '']
param[12] = ['排序方式', '']
var Data = this.CreateData('11', '产品发货_发货单_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
param[1] = ['已发', 0]
var Data = this.CreateData('11', '产品发货_发货单明细_查询数据新', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
handlePicture(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
var Data = this.CreateData('11', '发货单_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
handleDelete(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
var Data = this.CreateData('12', '产品发货_发货单_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
confirmReturn(row) {
this.$confirm('是否退回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.deliveryMxValue = []
this.deliveryNum = []
for (let i = 0; i < this.tableData1.length; i++) {
this.deliveryMxValue.push(this.tableData1[i].发货单明细流水号)
if (isNaN(this.tableData1[i].发货数量) === false) {
if (this.tableData1[i].发货数量 !== '' && this.tableData1[i].发货数量 !== '0' && this.tableData1[i].发货数量 !== null) {
this.deliveryNum.push(this.tableData1[i].发货数量)
} else {
this.$message.error('已发数量不能为0或空')
break
}
} else {
this.$message.error('已发数量必须为数值')
break
}
}
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
param[1] = ['发货单明细流水号组', this.deliveryMxValue]
param[2] = ['已发数量组', this.deliveryNum]
var Data = this.CreateData('12', '产品查询_发货单_退回发货', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('退回成功')
this.searchTable()
// this.searchTable1()
this.tableData1 = []
} else {
this.$message.success('退回失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 6) {
const values = data.map(item => Number(item['发货金额']))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = sums[index].toFixed(2)
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.ziduan {
width: 50px!important;
}
</style>

View File

@@ -0,0 +1,273 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="consignee" style="width: 100px" size="small" clearable placeholder="收货人" @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-input v-model="orderValue" style="width: 200px" size="small" clearable placeholder="买方/订单号" @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-input v-model="logistics" style="width: 150px" size="small" clearable placeholder="物流单号" @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable()">查询</el-button>
</div>
<el-col style="margin-top: 10px;width: 891px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
border
stripe
size="small"
style="width: 891px"
height="740px"
@row-click="searchTable1">
<el-table-column width="120px" label="发货单号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.发货单号 }}
</template>
</el-table-column>
<el-table-column width="87px" label="发货日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.发货日期 }}
</template>
</el-table-column>
<el-table-column width="60px" label="收货人" align="center">
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column label="收货地址" align="center">
<template slot-scope="scope">
{{ scope.row.收货地址 }}
</template>
</el-table-column>
<el-table-column width="102px" label="物流单号" align="center">
<template slot-scope="scope">
{{ scope.row.物流单号 }}
</template>
</el-table-column>
<el-table-column width="87px" label="发货金额" align="center" prop="发货金额">
<template slot-scope="scope">
{{ Number(scope.row.发货金额).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="90px" label="发货备注" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.发货备注 }}
</template>
</el-table-column>
<el-table-column width="117px" label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-check" size="mini" @click="handleEdit(scope.row)">通过</el-button>
<el-button size="mini" type="text" icon="el-icon-picture-outline" @click="handlePicture(scope.row)"/>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-top: 10px;margin-left: 20px;width: 751px">
<el-table ref="table1" :data="tableData1" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border stripe size="small" style="width: 751px" height="740px">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column :width="setColumnWidth('订单号')" label="订单号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="买方名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('产品名称')" label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="发货数量" align="center" prop="发货数量">
<template slot-scope="scope">
{{ scope.row.发货数量 ? scope.row.发货数量 : scope.row.查询实际发量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单价')" label="单价" align="center" prop="单价">
<template slot-scope="scope">
{{ Number(scope.row.单价).toFixed(2) }}
</template>
</el-table-column>
<el-table-column width="110px" label="金额" align="center" prop="金额">
<template slot-scope="scope">
{{ Number((scope.row.发货数量 ? scope.row.发货数量 : scope.row.查询实际发量) * scope.row.单价).toFixed(2) }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="订单数" align="center" prop="订单数">
<template slot-scope="scope">
{{ scope.row.订单数 }}
</template>
</el-table-column>
</el-table>
</el-col>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="图片" center style="" width="600px">
<el-image v-for="url in urls" :key="url" :src="url" :preview-src-list="urls" lazy style="width: 500px; height: 500px"/>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { url } from '@/utils/request'
export default {
data() {
return {
Data: {},
limit: 1000,
upload: url,
dialogFormVisible1: false,
dialogFormVisible2: false,
listValue: '',
form: {
物流单号: '',
收货人: '',
收货地址: ''
},
rules: {
物流单号: [{ required: true, message: '请输入物流单号', trigger: 'blur' }],
收货人: [{ required: true, message: '请输入收货人', trigger: 'blur' }],
收货地址: [{ required: true, message: '请输入收货地址', trigger: 'change' }]
},
dialogFormVisible: false,
urls: [],
consignee: '', // 收货人
logistics: '', // 物流单号
orderValue: '', // 订单号
dateRange: '', // 发货日期
deliveryStateValue: '', // 发货状态
deliveryState: [{
value: 0,
label: '未确认'
}, {
value: 1,
label: '已发货'
}], // 发货状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
deliveryMxValue: [],
deliveryNum: [],
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
})
},
created() {
this.searchTable()
},
methods: {
handleEdit(row) {
this.$confirm('是否审核通过?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
var Data = this.CreateData('12', '产品发货_发货单_审核', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审核成功')
this.searchTable()
// this.searchTable1()
this.tableData1 = []
} else {
this.$message.success('审核失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
searchTable() {
console.log(this.token)
this.tableData1 = []
let consignee_check, logistics_check, orderValue_check
this.consignee ? consignee_check = 1 : consignee_check = 0
this.logistics ? logistics_check = 1 : logistics_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
var param = []
param[0] = ['收货人_check', consignee_check]
param[1] = ['收货人', this.consignee]
param[2] = ['订单号_check', orderValue_check]
param[3] = ['订单号', this.orderValue]
param[4] = ['物流单号_check', logistics_check]
param[5] = ['物流单号', this.logistics]
var Data = this.CreateData('11', '产品发货_发货单_审核数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
param[1] = ['已发', 0]
var Data = this.CreateData('11', '产品发货_发货单明细_查询数据新', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
handlePicture(row) {
this.dialogFormVisible = true
this.urls = []
var param = []
param[0] = ['发货单流水号', row.发货单流水号]
var Data = this.CreateData('11', '发货单_图片_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.ziduan {
width: 50px!important;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,679 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<!--<el-select v-model="piciNumberValue" style="width:200px" placeholder="批次码" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in piciNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<el-input v-model="piciNumberValue" style="width:200px" placeholder="批次码" size="small" clearable/>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 20;searchTable1()">查询</el-button>
<!--<el-select v-model="productpartNameValue" style="width:200px;margin-left: 10px" placeholder="部件" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="productpartNameValue" style="width:200px;margin-left: 10px" placeholder="类型" size="small" filterable clearable @change="searchTable1()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>-->
<!-- <el-input v-model="partNameValue" style="width:100px;margin-left: 10px" placeholder="零件名称" size="small" clearable/>-->
<!--<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable1()">查询</el-button>
<el-button icon="el-icon-download" type="success" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;pageSize = 100;searchTable1()">导出</el-button>-->
</div>
<el-table :data="tableData2" height="740px" size="small" style="width: 1610px" highlight-current-row border>
<el-table-column label="序号" align="center" type="index" width="60px"/>
<el-table-column width="140px" align="center" label="批次码" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('物料名称')" align="center" label="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" align="center" label="图号" prop="图号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
<!--<el-table-column :width="setColumnWidth('数量')" align="center" label="数量" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>-->
<el-table-column :width="setColumnWidth('类型')" align="center" label="类型" prop="类型" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" align="center" label="入库日期" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.入库时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('供应商')" align="center" label="供应商" prop="供应商" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" align="center" label="出库日期" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.出库时间 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('领料单号')" align="center" label="领料单号" prop="领料单号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
<el-table-column width="70px" align="center" label="领料人" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.领料人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('买方名称')" align="center" label="买方名称" prop="买方名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" align="center" label="订单编号" prop="订单编号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" align="center" label="下单人" prop="下单人" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.创建人 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="Number(scope.row.工艺计划流水号)===0"
size="mini"
type="text"
@click="processTraceability(scope.row)">过程追溯</el-button>
<el-button
:disabled="Number(scope.row.是否主轴)===0"
size="mini"
type="text"
@click="qualityTesting(scope.row)">质检卡</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center width="991px">
<el-table :data="tableData1" :header-cell-style="{background: '#2283D4',color: 'white'}" highlight-current-row border size="small" style="width: 941px;">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" prop="序号">
<template slot-scope="scope">
{{ scope.row.序号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" label="工序" align="center" prop="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column width="70px" label="操作者" align="center">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column width="140px" label="加工设备" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="分配数量" align="center">
<template slot-scope="scope">
{{ scope.row.分配数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="完成数量" align="center">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="开始时间" align="center">
<template slot-scope="scope">
{{ scope.row.开始加工 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" label="结束时间" align="center">
<template slot-scope="scope">
{{ scope.row.完成时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-popover placement="top" width="740" trigger="click">
<el-table :data="gridData" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini">
<el-table-column :width="setColumnWidth('序号')" align="center" type="index" label="序号">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" align="center" label="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="质检数" align="center">
<template slot-scope="scope">
{{ scope.row.检测数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="不良数" align="center">
<template slot-scope="scope">
{{ scope.row.不良数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('处理方式')" label="不合格原因" align="center">
<template slot-scope="scope">
{{ scope.row.不合格原因文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('处理方式')" label="处理方式" align="center">
<template slot-scope="scope">
{{ scope.row.处理方案 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="质检人" align="center">
<template slot-scope="scope">
{{ scope.row.检测人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('时间日期')" label="质检时间" align="center">
<template slot-scope="scope">
{{ scope.row.检测时间 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" :disabled="Number(scope.row.检测数)===0" type="text" size="mini" @click="showDelivery(scope.row, scope.$index)">
质检记录
</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center width="851px">
<div id="WGBLD" style="width: 880px">
<div style="margin: 0 0 10px 0px">
<div><span style="font-size: 23px;margin-left: 260px">浙江景耀数控科技有限公司</span></div>
<div style=";margin-top: 10px"><span style="font-size: 20px;margin-left: 295px">镗铣动力头出厂检验单</span></div>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17"><span>&nbsp;</span></el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp; {{ dateTime }}</span>
</el-col>
</el-row>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17">
<span>&nbsp;:&nbsp;{{ siteFactory }}</span>
</el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp;{{ Telephone }}</span>
</el-col>
</el-row>
<el-row style="margin: 10px 0 10px 20px">
<el-col :span="17">
<span>&nbsp;:&nbsp;{{ webSite }}</span>
</el-col>
<el-col :span="7">
<span>&nbsp;:&nbsp;{{ Fax }}</span>
</el-col>
</el-row>
</div>
<div style="width: 800px;height: 100%;">
<div class="process" style="width: 800px;height: 240px;border: solid 2px black; border-bottom: 0px!important;"/>
<table cellspacing="0px" align="center" style="table-layout:fixed;border-color: black!important; border-bottom: 0px!important;" border="1px solid black" width="100%">
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">产品名称</td>
<td colspan="10" style="text-align: center;">{{ productName1Value }}</td>
<td colspan="2" style="text-align: center;">产品ID</td>
<td colspan="10" style="text-align: center;">{{ productIDValue }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">规格型号</td>
<td colspan="10" style="text-align: center;">{{ specificationModel }}</td>
<td colspan="2" style="text-align: center;">&nbsp;&nbsp;</td>
<td colspan="10" style="text-align: center;">{{ turnSpeedValue }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">编号</td>
<td colspan="10" style="text-align: center;">检测项</td>
<td colspan="2" style="text-align: center;">允许值</td>
<td colspan="4" style="text-align: center;">实测值</td>
<td colspan="6" style="text-align: center;">判定</td>
</tr>
<tr v-for="(list,index) in tableData20" :key="index" style="height: 40px">
<td colspan="2" style="text-align: center;width: 60px;padding: 0 10px 0 10px">{{ list.编号 }}</td>
<td colspan="10" style="text-align: center;">{{ list.检测项 }}</td>
<td colspan="2" style="text-align: center;">{{ list.允许值 }}</td>
<td colspan="4" style="text-align: center;">{{ list.实测值 }}</td>
<td colspan="6" style="text-align: center;">
<el-checkbox v-model="list.checkNum1" disabled style="margin: 0">精密级</el-checkbox>
<el-checkbox v-model="list.checkNum2" disabled style="margin-left: 10px">高精密级</el-checkbox>
</td>
</tr>
</table>
<table cellspacing="0px" align="center" style="table-layout:fixed;border-color: black!important;" border="1px solid black" width="100%; ">
<tr style="height: 40px">
<td colspan="24" style="font-size: 20px"> &nbsp;&nbsp;结论&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ conclusion }}</td>
</tr>
<tr style="height: 40px">
<td colspan="3" style="text-align: center;">装配人员</td>
<td colspan="3" style="text-align: center;">{{ assemblerPeople }}</td>
<td colspan="2" style="text-align: center;">检验</td>
<td colspan="4" style="text-align: center;">{{ testPeople }}</td>
<td colspan="2" style="text-align: center;">审核</td>
<td colspan="4" style="text-align: center;">{{ toExamine }}</td>
<td colspan="2" style="text-align: center;">品检部</td>
<td colspan="4" style="text-align: center;">{{ qualitDepartment }}</td>
</tr>
</table>
</div>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
gridData: [],
productName1Value: '',
batchNumber: '',
piciNumberValue: '',
piciNumber: [],
tableData20: [],
productIDValue: '',
turnSpeedValue: '',
process: '', // 工艺计划流水号
orderNumberTypeValue: '', // 操作者
orderNumberType: [], // 操作者数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
partNameValue: '', // 零件名称
machine: [],
machineValue: '',
people: [],
peopleValue: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
orderName1: '', // 排序列名
order1: '', // 排序方式
dateTime: '',
dialogFormVisible: false, // 零件追溯
tableData1: [], // 零件追溯
dialogFormVisible1: false, // 质检
tableData3: [], // 质检
siteFactory: '',
webSite: '',
Telephone: '',
Fax: '', // 传真
qdrawing: '', // 图纸
productName: '', // 产品名称
productBarcode: '', // 产品条形码
specificationModel: '', // 规格型号
turnSpeed: '', // 转速
conclusion: '本产品检验符合要求,准予出厂', // 结论
assemblerPeople: '', // 装配人员
testPeople: '', // 检验
toExamine: '', // 审核
qualitDepartment: '' // 品检部
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
if (this.$refs['table']) {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
}
},
created() {
this.getOrderNumberType()
// this.getpiciNumber()
this.getMachine()
this.getPeople()
this.getProcess()
this.searchTable1()
this.getproductpartName()
},
methods: {
getOrderNumberType() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
// getpiciNumber() {
// var param = []
// var Data = this.CreateData('11', '物料追溯_批次码列表_查询', param)
// this.ExecDatabase(Data).then(response => {
// for (let i = 0; i < response.data.length; i++) {
// this.piciNumber.push({
// label: response.data[i].批次编号,
// value: response.data[i].批次编号
// })
// }
// })
// },
getproductpartName() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productpartName.push({
label: response.data[i].工位号,
value: response.data[i].设备流水号
})
}
})
},
getMachine() {
var param = []
var Data = this.CreateData('11', '设备信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
value: response.data[i].设备流水号
})
}
})
},
getPeople() {
var param = []
param[0] = ['考核部门编号', 19]
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_查询数据_根据部门编号', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.people.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
getProcess() {
var param = []
// 参数数量与名称要与存储过程对应
var Data = this.CreateData('11', '工艺名称_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData4 = response.data
})
},
showDelivery(row) {
var param = []
param[0] = ['工艺任务流水号', row.工艺任务流水号]
var Data = this.CreateData('11', '物料追溯_工序质检信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.gridData = response.data
})
},
searchTable1() {
let piciNumberValue_check
this.piciNumberValue ? piciNumberValue_check = 1 : piciNumberValue_check = 0
var param = []
param[0] = ['批次码', this.piciNumberValue]
param[1] = ['批次码_check', piciNumberValue_check]
var Data = this.CreateData('11', '物料追溯_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data.rows
console.log(this.tableData2, 1233)
this.total = response.data.total
})
},
processTraceability(row) {
var param = []
param[0] = ['工艺计划流水号', row.工艺计划流水号]
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
this.dialogFormVisible = true
})
},
qualityTesting(row) {
this.batchNumber = row.批次编号
this.dateTime = row.检测时间
this.searchTable2()
this.searchTable3()
this.searchTable4()
this.dialogFormVisible1 = true
},
searchTable2() {
this.tableData20 = []
var param = []
param[0] = ['主轴批次号', this.batchNumber]
var Data = this.CreateData('11', '[检测项录入_检测项维护_查询]', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data)
for (let i = 0; i < response.data.length; i++) {
this.tableData20.push({
编号: response.data[i].编号,
检测项: response.data[i].检测项目,
允许值: response.data[i].允许值,
实测值: response.data[i].实测值,
checkNum1: response.data[i].判定状态1,
checkNum2: response.data[i].判定状态2
})
}
})
},
searchTable3() {
var param = []
param[0] = ['主轴批次号', this.batchNumber]
var Data = this.CreateData('11', '检测数据录入_产品查询_基础表_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.productIDValue = response.data[i].产品ID
this.turnSpeedValue = response.data[i].转速
this.productName1Value = response.data[i].产品名称
this.specificationModel = response.data[i].产品规格
}
} else {
this.productIDValue = ''
this.turnSpeedValue = ''
this.productName1Value = ''
this.specificationModel = ''
}
})
},
searchTable4() {
var param = []
var Data = this.CreateData('11', '基础表_检验信息维护表_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.siteFactory = response.data[i].厂址
this.Telephone = response.data[i].电话
this.webSite = response.data[i].网址
this.Fax = response.data[i].传真
this.assemblerPeople = response.data[i].装配人员
this.testPeople = response.data[i].检验人员
this.toExamine = response.data[i].审核人员
this.qualitDepartment = response.data[i].品管部门
}
} else {
this.siteFactory = ''
this.Telephone = ''
this.webSite = ''
this.Fax = ''
this.assemblerPeople = ''
this.testPeople = ''
this.toExamine = ''
this.qualitDepartment = ''
}
})
},
sortChange1(column) {
if (column.prop === '零件名称') {
this.orderName1 = 1
} else if (column.prop === '工序') {
this.orderName1 = 2
} else if (column.prop === '操作者') {
this.orderName1 = 3
} else if (column.prop === '加工设备') {
this.orderName1 = 4
} else if (column.prop === '工位号') {
this.orderName1 = 5
} else {
this.orderName1 = 0
}
if (column.order === 'ascending') {
this.order1 = 1
} else if (column.order === 'descending') { this.order1 = 2 } else {
this.order1 = ''
}
this.searchTable1()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable1()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable1()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>
<style scoped lang="scss">
/deep/ .el-checkbox__label{
padding-left: 5px;
}
/deep/ .el-table{
margin: 0;
}
/deep/ .qqqqwww{
border-right: 2px solid black!important;
border-bottom: 2px solid black!important;
border-top: 0px!important;
border-left: 1px solid black!important;
}
/deep/ .qqqqwww td{
border: 1px solid black!important;
/*border-left: 0px!important;*/
}
/deep/ .qqqqwww th.is-leaf{
border: 1px solid black!important;
border-top: 0px!important;
}
/deep/ .qqqqwww1{
border-right: 2px solid black!important;
border-bottom: 0px!important;
border-top: 0px!important;
border-left: 1px solid black!important;
}
/deep/ .qqqqwww1 td{
border: 1px solid black!important;
/*border-left: 0px!important;*/
}
/deep/ .qqqqwww1 th.is-leaf{
border: 1px solid black!important;
border-top: 0px!important;
}
/*/deep/ .el-table .cell{*/
/* padding: 0px!important;*/
/*}*/
/*/deep/ .el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell{*/
/* padding: 0px!important;*/
/*}*/
/deep/ .el-checkbox__input.is-disabled+span.el-checkbox__label{
color: #858689 !important;
}
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner{
border-color: black!important;
background-color: white;
}
/deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after{
border-color: black!important;
}
</style>
<!--<style scoped lang="scss">-->
<!--/deep/ .el-button&#45;&#45;text{-->
<!--color: #2ab911;-->
<!--}-->
<!--</style>-->
<style scoped>
.process{
position: relative;
text-align: center;
/*border: 1px solid red;*/
background: url('../../../assets/img/zhuzhou.png') repeat;
background-repeat:no-repeat;
background-size:100% 100%;-moz-background-size:100% 100%;
overflow: hidden;
}
</style>

View File

@@ -0,0 +1,945 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<el-tooltip :open-delay="700" effect="dark" style="float: left;margin-left: 1048px" content="查看库存信息" placement="top">
<el-button type="text" size="mini" @click="handleStock"><svg-icon icon-class="库存查询" style="float: right; width: 20px;height: 20px"/></el-button>
</el-tooltip>
</el-row>
<div style="float: left">
<el-table v-loading="loading" :data="tableData" highlight-current-row border show-summary stripe size="mini" style="width: 1068px;" height="222" @row-click="searchTable1">
<el-table-column width="180px" label="合同编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column width="100px" label="收货人" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.收货人员 }}
</template>
</el-table-column>
<el-table-column width="110px" label="签订日期" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column width="330px" label="客户名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column width="130px" label="合同交货期限" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.交货期限 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" icon="el-icon-close" size="mini" @click.native.stop="failPassTheAudit(scope.row)">不通过</el-button>
<el-button type="text" icon="el-icon-check" size="mini" @click.native.stop="passTheAudit(scope.row)">通过</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top: 10px" @mouseover="show=true" @mouseleave="show=false">
<el-table
v-loading="loading1"
:data="tableData1"
:header-cell-style="changeStyle"
show-summary
highlight-current-row
border
size="mini"
style="width: 1821px;margin-top: 10px"
height="430px"
@row-dblclick="changeState">
<el-table-column width="50px" label="序号" fixed type="index" align="center"/>
<el-table-column width="120px" fixed label="部件名称" align="center">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column width="60px" label="单位" fixed align="center">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column width="70px" label="数量" prop="数量" fixed align="center">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="80px" label="单价" prop="单价" fixed align="center">
<template slot-scope="scope">
{{ scope.row.单价 ? parseFloat(scope.row.单价).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="100px" label="金额" prop="金额" fixed align="center">
<template slot-scope="scope">
{{ scope.row.金额 ? parseFloat(scope.row.金额).toFixed(2) : '' }}
</template>
</el-table-column>
<el-table-column width="200px" label="产品详情" fixed align="center">
<template slot-scope="scope">
{{ scope.row.产品详情 }}
</template>
</el-table-column>
<el-table-column width="230px" label="轴承型号" align="center">
<template slot-scope="scope">
{{ scope.row.轴承位置文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('安装方向')" label="安装方向" align="center">
<template slot-scope="scope">
{{ scope.row.安装方向名称 }}
</template>
</el-table-column>
<el-table-column width="300px" label="电机型号/电机联接板" align="center">
<template slot-scope="scope">
{{ scope.row.电机位置文本 }}
</template>
</el-table-column>
<el-table-column width="150px" label="传动方式" align="center">
<template slot-scope="scope">
{{ scope.row.传动方式位置文本 }}
</template>
</el-table-column>
<el-table-column width="190px" label="主轴轮" align="center">
<template slot-scope="scope">
{{ scope.row.主轴轮名称 }}
</template>
</el-table-column>
<el-table-column width="190px" label="电机轮" align="center">
<template slot-scope="scope">
{{ scope.row.电机轮名称 }}
</template>
</el-table-column>
<el-table-column width="180px" label="传动带" align="center">
<template slot-scope="scope">
{{ scope.row.皮带轮名称 }}
</template>
</el-table-column>
<el-table-column width="180px" label="拉杆" align="center">
<template slot-scope="scope">
{{ scope.row.拉杆名称 }}
</template>
</el-table-column>
<el-table-column width="140px" label="其它" align="center">
<template slot-scope="scope">
{{ scope.row.其它 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('输出转速')" label="输出转速" align="center">
<template slot-scope="scope">
{{ scope.row.输出转速 }}
</template>
</el-table-column>
<el-table-column width="160px" label="中心内冷" align="center">
<template slot-scope="scope">
{{ scope.row.中心内冷名称 }}
</template>
</el-table-column>
<el-table-column width="160px" label="防护类型" align="center">
<template slot-scope="scope">
{{ scope.row.防护类型名称 }}
</template>
</el-table-column>
<el-table-column width="120px" label="电机型号" align="center">
<template slot-scope="scope">
{{ scope.row.滑台电机文本 }}
</template>
</el-table-column>
<el-table-column width="120px" label="电机联接板" align="center">
<template slot-scope="scope">
{{ scope.row.电机联接板文本 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('联轴器')" label="联轴器" align="center">
<template slot-scope="scope">
{{ scope.row.联轴器文本 }}
</template>
</el-table-column>
</el-table>
</div>
<span>订单备注</span>
<el-input v-model="remarks" readonly type="textarea" style="width:600px"/>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center width="770px">
<div style="width: 100%;overflow: hidden">
<el-input v-model="materialNameTypeValue" style="width:200px" placeholder="物料名称规格型号" size="small" clearable @keyup.enter.native="pageCurrent=1;searchTable10()"/>
<el-table
ref="table"
:data="tableData10"
:header-cell-style="{background: '#383E4B',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 721px"
height="440px"
@sort-change="sortChange">
<el-table-column width="140px" label="物料编号" align="center" show-overflow-tooltip sortable="物料编码" prop="物料编码">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="170px" label="物料名称" align="center" show-overflow-tooltip sortable="物料名称" prop="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="150px" label="图号型号" align="center">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="外库存" prop="预库存" align="center">
<template slot-scope="scope">
{{ scope.row.预库存 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="库存" prop="库存" align="center">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column label="单位" align="center">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
dialogFormVisible: false,
materialNameTypeValue: '',
spindleWheel: [], // 主轴轮数组
motorWheel: [], // 电机轮数组
pulley: [], // 皮带轮数组
pullRod: [], // 皮带轮数组
bearing: [], // 轴承型号数组
motorPower: [], // 电机功率数组
motorSpeed: [], // 电机转速数组
transmissionMode: [], // 传动方式数组
ConnectingPlate: [], // 联接板数组
slideType: [], // 滑台类型数组
motorConnectingPlate: [], // 电机联接板数组
CentralInternalCooling: [], // 中心内冷数组
TypeOfProtection: [], // 防护类型数组
motorModel: [], // 电机型号数组
motorModel1: [], // 滑台电机型号数组
coupling: [], // 联轴器数组
installationDirection: [], // 安装方向数组
level: [], // 级别数组
remarks: '',
orderValue: '',
product: [],
typeValue: '',
productValue: '', // 产品数值
motorModelLabel: '',
motorModelName: '',
motorModelId: '',
bearingLabel: '',
bearingName: '',
bearingId: '',
transmissionModeLabel: '',
transmissionModeName: '',
transmissionModeId: '',
ConnectingPlateLabel: '',
ConnectingPlateName: '',
ConnectingPlateId: '',
couplingLabel: '',
couplingName: '',
couplingId: '',
motorModelLabel1: '',
motorModelName1: '',
motorModelId1: '',
customerName: [],
customerNameValue: '',
dateRange: '',
PowerHead: [],
PowerHeadName: '',
show: false,
show1: false,
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
tableData10: [], // 产品信息表
tableData100: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
failPassTheAudit(row) {
var param = []
param[0] = ['项目流水号', row.项目流水号]
var Data = this.CreateData('12', '合同管理_订单审核_不通过', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审核不通过成功')
this.searchTable()
this.tableData1 = []
this.tableData100 = []
this.remarks = ''
} else {
this.$message.error('审核不通过失败')
}
})
},
passTheAudit(row) {
var param = []
param[0] = ['项目流水号', row.项目流水号]
var Data = this.CreateData('12', '合同管理_订单审核_通过', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('审核通过成功')
this.searchTable()
this.tableData1 = []
this.tableData100 = []
this.remarks = ''
} else {
this.$message.error('审核通过失败')
}
})
},
fetchData() {
this.getBasicData()
this.productList()
this.getTreeData1()
this.getTreeData2()
this.getTreeData3()
this.getTreeData4()
this.getTreeData5()
this.getTreeData6()
this.getCustomer()
},
getCustomer() {
var param = []
var Data = this.CreateData('11', '合同管理_客户信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
changeStyle({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 19 || columnIndex === 20 || columnIndex === 21 || columnIndex === 18) {
return 'background:#31384B;color:white'
} else {
return 'background:#2283D4;color:white'
}
},
exportTable() {},
handleStock() {
this.dialogFormVisible = true
},
searchTable10() {
let materialNameTypeValue_check
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['排序名称', this.orderName]
param[3] = ['排序方式', this.order]
var Data = this.CreateData('11', '仓储管理_通用库存_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData10 = response.data.rows
this.total = response.data.total
})
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable10()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable10()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable10()
},
getData1(row) {
this.motorModelLabel = this.treeToLabel(this.motorModel, row.电机位置)
this.motorModelId = row.电机位置[row.电机位置.length - 1]
const index = this.motorModelLabel.indexOf('/')
this.motorModelLabel = this.motorModelLabel.substring(index + 1, this.motorModelLabel.length)
},
getData3(row) {
this.bearingLabel = this.treeToLabel(this.bearing, row.轴承位置)
this.bearingId = row.轴承位置[row.轴承位置.length - 1]
const index = this.bearingLabel.indexOf('/')
this.bearingLabel = this.bearingLabel.substring(index + 1, this.bearingLabel.length)
},
getData4(row) {
this.motorModelLabel1 = this.treeToLabel(this.motorModel1, row.滑台电机位置)
this.motorModelId1 = row.滑台电机位置[row.滑台电机位置.length - 1]
const index = this.motorModelLabel1.indexOf('/')
this.motorModelLabel1 = this.motorModelLabel1.substring(index + 1, this.motorModelLabel1.length)
},
getData5(row) {
this.ConnectingPlateLabel = this.treeToLabel(this.ConnectingPlate, row.电机联接板)
this.ConnectingPlateId = row.电机联接板[row.电机联接板.length - 1]
const index = this.ConnectingPlateLabel.indexOf('/')
this.ConnectingPlateLabel = this.ConnectingPlateLabel.substring(index + 1, this.ConnectingPlateLabel.length)
},
getData6(row) {
this.couplingLabel = this.treeToLabel(this.coupling, row.联轴器)
this.couplingId = row.联轴器[row.联轴器.length - 1]
const index = this.couplingLabel.indexOf('/')
this.couplingLabel = this.couplingLabel.substring(index + 1, this.couplingLabel.length)
},
getData2(row, index) {
this.transmissionModeId = row.传动方式位置[row.传动方式位置.length - 1]
this.spindleWheel = []
this.motorWheel = []
this.pulley = []
this.tableData1[index].主轴轮 = ''
this.tableData1[index].电机轮 = ''
this.tableData1[index].皮带轮 = ''
var param4 = []
param4[0] = ['传动方式流水号', this.transmissionModeId]
var Data4 = this.CreateData('11', '传动方式_获取名称', param4)
this.ExecDatabase(Data4).then(response => {
this.transmissionModeLabel = response.data[0].传动方式
})
var param = []
param[0] = ['传动方式流水号', this.transmissionModeId]
var Data = this.CreateData('11', '传动方式_获取主轴轮', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.spindleWheel.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
var Data1 = this.CreateData('11', '传动方式_获取电机轮', param)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.motorWheel.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
var Data2 = this.CreateData('11', '传动方式_获取皮带', param)
this.ExecDatabase(Data2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pulley.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
},
changeState(row) {
this.motorModelLabel = row.电机位置文本
this.motorModelId = row.电机位置[row.电机位置.length - 1]
this.bearingLabel = row.轴承位置文本
this.bearingId = row.轴承位置[row.轴承位置.length - 1]
this.transmissionModeLabel = row.传动方式位置文本
this.transmissionModeId = row.传动方式位置[row.传动方式位置.length - 1]
this.motorModelLabel1 = row.滑台电机文本
this.ConnectingPlateLabel = row.电机联接板文本
this.couplingLabel = row.联轴器文本
this.spindleWheel = []
this.motorWheel = []
this.pulley = []
var param = []
param[0] = ['传动方式流水号', this.transmissionModeId]
var Data = this.CreateData('11', '传动方式_获取主轴轮', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.spindleWheel.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
var Data1 = this.CreateData('11', '传动方式_获取电机轮', param)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.motorWheel.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
var Data2 = this.CreateData('11', '传动方式_获取皮带', param)
this.ExecDatabase(Data2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pulley.push({
label: response.data[i].传动方式,
value: response.data[i].传动方式流水号
})
}
})
for (let i = 0; i < this.tableData1.length; i++) {
if (row.组件流水号 === this.tableData1[i].组件流水号) {
row.edit = !row.edit
} else {
this.tableData1[i].edit = false
}
}
},
getTreeData1() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '电机型号_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.motorModel = this.tree(data, 0)
})
},
getTreeData2() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '轴承型号_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.bearing = this.tree(data, 0)
})
},
getTreeData3() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '传动方式_查询节点_订单', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.transmissionMode = this.tree(data, 0)
})
},
getTreeData4() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '联接板_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.ConnectingPlate = this.tree(data, 0)
})
},
getTreeData5() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '联轴器_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.coupling = this.tree(data, 0)
})
},
getTreeData6() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '滑台电机_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.motorModel1 = this.tree(data, 0)
})
},
tree(data, pid) {
const result = []
let temp
for (let i = 0; i < data.length; i++) {
if (data[i].父节点 === pid) {
const obj = { label: data[i].节点名称, value: data[i].子节点 }
temp = this.tree(data, data[i].子节点)
if (temp.length > 0) {
obj.children = temp
}
result.push(obj)
}
}
return result
},
treeToLabel(data, arr) {
const result = []
const childrenTreeToLabel = (data, arr, result) => {
console.log(data, arr, 333333)
for (let i = 0; i < data.length; i++) {
if (arr[0] === data[i].value) {
result.push(data[i].label)
if (data[i].children && arr.length > 1) {
childrenTreeToLabel(data[i].children, arr.slice(1), result)
}
break
}
}
}
childrenTreeToLabel(data, arr, result)
return result.join('/')
},
getBasicData() {
var param = []
var Data = this.CreateData('11', '轴承型号_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.bearing.push({
label: response.data[i].轴承型号,
value: response.data[i].轴承型号流水号
})
}
})
var param1 = []
var Data1 = this.CreateData('11', '中心内冷_基础表_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.CentralInternalCooling.push({
label: response.data[i].中心内冷,
value: response.data[i].中心内冷流水号
})
}
})
var param2 = []
var Data2 = this.CreateData('11', '电机转速_基础表_查询数据', param2)
this.ExecDatabase(Data2).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.motorSpeed.push({
label: response.data[i].电机转速,
value: response.data[i].电机转速流水号
})
}
})
var param4 = []
var Data4 = this.CreateData('11', '防护类型_基础表_查询数据', param4)
this.ExecDatabase(Data4).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.TypeOfProtection.push({
label: response.data[i].防护类型,
value: response.data[i].防护类型流水号
})
}
})
var param5 = []
var Data5 = this.CreateData('11', '电机联接板_基础表_查询数据', param5)
this.ExecDatabase(Data5).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.motorConnectingPlate.push({
label: response.data[i].电机联接板,
value: response.data[i].电机联接板流水号
})
}
})
var param7 = []
var Data7 = this.CreateData('11', '拉杆_基础表_查询数据', param7)
this.ExecDatabase(Data7).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pullRod.push({
label: response.data[i].拉杆,
value: response.data[i].拉杆流水号
})
}
})
var param8 = []
var Data8 = this.CreateData('11', '安装方向_基础表_查询数据', param8)
this.ExecDatabase(Data8).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.installationDirection.push({
label: response.data[i].安装方向,
value: response.data[i].安装方向流水号
})
}
})
var param9 = []
var Data9 = this.CreateData('11', '级别_基础表_查询数据', param9)
this.ExecDatabase(Data9).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.level.push({
label: response.data[i].级别,
value: response.data[i].级别流水号
})
}
})
},
productList() {
var param = []
var Data = this.CreateData('11', '产品信息_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.product.push({
label: response.data[i].产品名称,
value: response.data[i].产品名称,
name: response.data[i].产品流水号
})
}
})
},
searchTable() {
var param = []
var Data = this.CreateData('11', '合同信息_提交订单_未审核_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
searchTable1(row) {
this.tableData100 = []
this.remarks = row.合同备注
this.orderValue = row.项目流水号
this.searchTable2()
},
searchTable2() {
this.loading1 = true
this.tableData100 = []
var param = []
param[0] = ['项目流水号', this.orderValue]
var Data = this.CreateData('11', '合同信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
console.warn('二查', response.data)
for (let i = 0; i < response.data.length; i++) {
this.tableData100.push({
组件流水号: response.data[i].组件流水号,
单价: response.data[i].单价,
金额: response.data[i].单价 * response.data[i].数量,
产品流水号: response.data[i].产品流水号,
是否滑台: response.data[i].是否滑台,
产品名称: response.data[i].产品名称,
产品详情: response.data[i].产品详情,
单位: response.data[i].单位,
数量: response.data[i].数量,
主轴轮: parseInt(response.data[i].主轴轮) ? parseInt(response.data[i].主轴轮) : '',
主轴轮名称: response.data[i].主轴轮名称,
电机轮: parseInt(response.data[i].电机轮) ? parseInt(response.data[i].电机轮) : '',
电机轮名称: response.data[i].电机轮名称,
皮带轮: parseInt(response.data[i].皮带轮) ? parseInt(response.data[i].皮带轮) : '',
皮带轮名称: response.data[i].皮带轮名称,
防护类型: parseInt(response.data[i].防护类型) ? parseInt(response.data[i].防护类型) : '',
防护类型名称: response.data[i].防护类型名称,
电机联接板: response.data[i].电机联接板 ? response.data[i].电机联接板.split(',').map(Number) : [],
电机联接板文本: response.data[i].电机联接板文本,
电机位置: response.data[i].电机位置 ? response.data[i].电机位置.split(',').map(Number) : [],
电机位置文本: response.data[i].电机位置文本,
轴承位置: response.data[i].轴承位置 ? response.data[i].轴承位置.split(',').map(Number) : [],
轴承位置文本: response.data[i].轴承位置文本,
传动方式位置: response.data[i].传动方式位置 ? response.data[i].传动方式位置.split(',').map(Number) : [],
传动方式位置文本: response.data[i].传动方式位置文本,
联轴器: response.data[i].联轴器 ? response.data[i].联轴器.split(',').map(Number) : [],
联轴器文本: response.data[i].联轴器文本,
滑台电机位置: response.data[i].滑台电机位置 ? response.data[i].滑台电机位置.split(',').map(Number) : [],
滑台电机文本: response.data[i].滑台电机文本,
安装方向: parseInt(response.data[i].安装方向) ? parseInt(response.data[i].安装方向) : '',
安装方向名称: response.data[i].安装方向名称,
中心内冷: parseInt(response.data[i].中心内冷) ? parseInt(response.data[i].中心内冷) : '',
中心内冷名称: response.data[i].中心内冷名称,
拉杆: parseInt(response.data[i].拉杆) ? parseInt(response.data[i].拉杆) : '',
拉杆名称: response.data[i].拉杆名称,
其它: response.data[i].其它,
原其它: response.data[i].其它,
输出转速: response.data[i].输出转速,
原输出转速: response.data[i].输出转速,
是否合同创建: response.data[i].是否合同创建,
原产品名称: response.data[i].产品名称,
原产品详情: response.data[i].产品详情,
原数量: response.data[i].数量,
原单位: response.data[i].单位,
edit: false
})
}
}).then(() => {
this.tableData1 = this.tableData100
this.loading1 = false
})
},
groupChange(row) {
var param = []
param[0] = ['组件流水号', row.组件流水号]
param[1] = ['轴承型号', row.轴承型号]
param[2] = ['主轴轮', row.主轴轮]
param[3] = ['电机轮', row.电机轮]
param[4] = ['皮带轮', row.皮带轮]
param[5] = ['防护类型', row.防护类型]
param[6] = ['电机联接板', row.电机联接板]
param[7] = ['电机位置', row.电机位置.join(',')]
param[8] = ['联轴器', row.联轴器]
param[9] = ['中心内冷', row.中心内冷]
param[10] = ['安装方向', row.安装方向]
param[11] = ['其它', row.其它]
param[12] = ['输出转速', row.输出转速]
param[13] = ['拉杆', row.拉杆]
var Data = this.CreateData('12', '订单信息_产品详细参数_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '0') {
this.$message.error('编辑失败')
}
})
},
// updateRemarks() {
// var param = []
// param[0] = ['订单流水号', this.orderValue]
// param[1] = ['订单备注', this.remarks]
// var Data = this.CreateData('12', '订单信息_编辑数据', param)
// this.ExecDatabase(Data).then(response => {
// if (response.data[0].result === '0') {
// this.$message.error('编辑失败')
// }
// })
// },
ReleaseOrder(row) {
// for (let i = 0; i < this.tableData1.length; i++) {
// if ((!this.tableData1[i].轴承型号 || !this.tableData1[i].电机功率 || !this.tableData1[i].级别 || !this.tableData1[i].电机转速 || !this.tableData1[i].安装方向 || !this.tableData1[i].传动方式) && this.tableData1[i].是否滑台 === 2) {
// this.$message.warning('参数不能为空')
// return
// }
// if ((!this.tableData1[i].滑台类型 || !this.tableData1[i].电机联接板 || !this.tableData1[i].电机型号 || !this.tableData1[i].联轴器) && this.tableData1[i].是否滑台 === 1) {
// this.$message.warning('参数不能为空')
// return
// }
// }
if (this.orderValue !== row.项目流水号) {
this.$message.warning('请查看部件内容是否与该合同一致!')
}
if ((row.审核期限 && row.通用装配期限 && row.采购期限 && row.精工期限 && row.合同类型 === 1) || (row.审核期限 && row.通用装配期限 && row.采购期限 && row.精工期限 && row.专机装配期限)) {
this.orderValue = row.项目流水号
var param = []
param[0] = ['项目流水号', this.orderValue]
param[1] = ['审核期限', row.审核期限]
param[2] = ['通用装配期限', row.通用装配期限]
param[3] = ['采购期限', row.采购期限]
param[4] = ['精工期限', row.精工期限]
param[5] = ['专机装配期限', row.专机装配期限]
param[6] = ['订单备注', this.remarks]
param[7] = ['下单人', this.id]
var Data = this.CreateData('12', '合同信息_提交订单', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('提交成功')
this.searchTable()
this.tableData1 = []
this.tableData100 = []
this.remarks = ''
} else {
this.$message.error('提交失败')
}
})
} else {
this.$message.warning('日期不能为空')
}
},
createProduct() {
var param = []
param[0] = ['项目流水号', this.orderValue]
var Data = this.CreateData('12', '订单信息_产品信息_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.searchTable2()
} else {
this.$message.error('添加失败')
}
})
},
editProduct(row) {
var param = []
param[0] = ['组件流水号', row.组件流水号]
param[1] = ['产品名称', row.产品名称]
param[2] = ['产品详情', row.产品详情]
param[3] = ['单位', row.单位]
param[4] = ['数量', row.数量]
if (Number(row.是否合同创建) === 0) {
param[5] = ['产品流水号', 0]
} else {
param[5] = ['产品流水号', row.产品流水号]
}
param[6] = ['轴承位置', row.轴承位置.join(',')]
param[7] = ['主轴轮', row.主轴轮]
param[8] = ['电机轮', row.电机轮]
param[9] = ['皮带轮', row.皮带轮]
param[10] = ['防护类型', row.防护类型]
param[11] = ['电机联接板', row.电机联接板.join(',')]
param[12] = ['电机位置', row.电机位置.join(',')]
param[13] = ['联轴器', row.联轴器.join(',')]
param[14] = ['中心内冷', row.中心内冷]
param[15] = ['安装方向', row.安装方向]
param[16] = ['其它', row.其它]
param[17] = ['输出转速', row.输出转速]
param[18] = ['电机位置文本', this.motorModelLabel]
param[19] = ['传动方式位置', row.传动方式位置.join(',')]
param[20] = ['传动方式位置文本', this.transmissionModeLabel]
param[21] = ['轴承位置文本', this.bearingLabel]
param[22] = ['滑台电机文本', this.motorModelLabel1]
param[23] = ['滑台电机位置', row.滑台电机位置.join(',')]
param[24] = ['电机联接板文本', this.ConnectingPlateLabel]
param[25] = ['联轴器文本', this.couplingLabel]
param[26] = ['拉杆', row.拉杆]
var Data = this.CreateData('12', '订单信息_产品详细参数_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable2()
} else {
this.$message.error('编辑失败')
}
})
row.edit = !row.edit
},
deleteProduct(row) {
var param = []
param[0] = ['组件流水号', row.组件流水号]
var Data = this.CreateData('12', 'PDM_组件名称_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable2()
} else {
this.$message.error('删除失败')
}
})
},
cancel(row) {
row.产品名称 = row.原产品名称
row.产品详情 = row.原产品详情
row.单位 = row.原单位
row.数量 = row.原数量
row.其它 = row.原其它
row.输出转速 = row.原输出转速
row.edit = false
}
}
}
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,682 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
remote
clearable
@change="pageCurrent = 1;pageSize = 30;searchData();getOrder()">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="orderValue"
:remote-method="getOrder"
style="width:200px"
placeholder="订单编号"
size="small"
remote
filterable
clearable
@change="pageCurrent = 1;pageSize = 30;searchData()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" plain icon="el-icon-search" size="small" style="margin: 15px 0 0 10px" @click="pageCurrent=1;pageSize=30;total=0;searchData()">查询</el-button>
</el-row>
<el-table v-loading="loading0" :data="tableData" :show-header="false" :row-style="{height:'70px'}" style="width: 1280px;margin-top: 20px" height="730" size="mini" border>
<el-table-column align="center" label="订单编号" width="170px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column align="center" width="200px" label="买方名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方 }}
</template>
</el-table-column>
<!--<el-table-column align="center" label="订单进度" width="750px">
<template slot-scope="scope">
<el-steps :space="140" :active="Number(scope.row.订单进度)" :align-center="true" direction="horizontal" finish-status="success">
<el-step title="订单下达">
<template slot="description">
{{ scope.row.创建日期 }}
</template>
</el-step>
<el-step title="技术确认">
<template slot="description">
{{ scope.row.确认日期 }}
</template>
</el-step>
<el-step v-if="Number(scope.row.订单类型)===2 || (Number(scope.row.订单类型)===3 && scope.row.订单编号.split('-')[0] ==='BHZZ')" title="自制">
<template slot="description">
{{ scope.row.自制日期 }}
</template>
</el-step>
<el-step v-if="Number(scope.row.订单类型)===3 && scope.row.订单编号.split('-')[0] ==='BHWG'" title="采购">
<template slot="description">
{{ scope.row.采购日期 }}
</template>
</el-step>
<el-step v-if="Number(scope.row.订单类型)===1 || Number(scope.row.订单类型)===2 || Number(scope.row.订单类型)===4" title="装配">
<template slot="description">
{{ scope.row.装配日期 }}
</template>
</el-step>
<el-step v-if="Number(scope.row.订单类型)===3 || Number(scope.row.订单类型)===4" title="入库">
<template slot="description">
{{ scope.row.入库日期 }}
</template>
</el-step>
<el-step v-if="Number(scope.row.订单类型)===1 || Number(scope.row.订单类型)===2" title="发货">
<template slot="description">
{{ scope.row.发货日期 }}
</template>
</el-step>
</el-steps>
</template>
</el-table-column>-->
<el-table-column align="center" label="订单进度" width="770px">
<template slot-scope="scope">
<template v-if="Number(scope.row.订单类型)===1">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="{'active': item.value === 1 && scope.row.订单进度 > index,'title': item.value === 1,'active1': item.value === 2 && scope.row.订单进度 > index,'title1': item.value === 2,'active2': item.value === 3 && scope.row.订单进度 > index,'title2': item.value === 3,'active3': item.value === 4 && scope.row.订单进度 > index,'title3': item.value === 4}">
<div style="margin-left: 40px;">{{ item.item }}<br>{{ item.date }}</div>
<div :class="{'triangle-active': item.value === 1 && scope.row.订单进度 > index, 'arrow-active': item.value === 1 && scope.row.订单进度 === index + 1,'triangle': item.value === 1, 'triangle-active1': item.value === 2 && scope.row.订单进度 > index, 'arrow-active1': item.value === 2 && scope.row.订单进度 === index + 1,'triangle1': item.value === 2, 'triangle-active2': item.value === 3 && scope.row.订单进度 > index, 'arrow-active2': item.value === 3 && scope.row.订单进度 === index + 1,'triangle2': item.value === 3, 'triangle-active3': item.value === 4 && scope.row.订单进度 > index, 'arrow-active3': item.value === 4 && scope.row.订单进度 === index + 1,'triangle3': item.value === 4}"/>
</div>
</div>
</template>
<template v-if="Number(scope.row.订单类型)===2">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="{'active': item.value === 1 && scope.row.订单进度 > index,'title': item.value === 1,'active1': item.value === 2 && scope.row.订单进度 > index,'title1': item.value === 2,'active2': item.value === 3 && scope.row.订单进度 > index,'title2': item.value === 3,'active3': item.value === 4 && scope.row.订单进度 > index,'title3': item.value === 4,'active4': item.value === 5 && scope.row.订单进度 > index,'title4': item.value === 5}">
<div style="margin-left: 40px;">{{ item.item }}<br>{{ item.date }}</div>
<div :class="{'triangle-active': item.value === 1 && scope.row.订单进度 > index, 'arrow-active': item.value === 1 && scope.row.订单进度 === index + 1,'triangle': item.value === 1, 'triangle-active1': item.value === 2 && scope.row.订单进度 > index, 'arrow-active1': item.value === 2 && scope.row.订单进度 === index + 1,'triangle1': item.value === 2, 'triangle-active2': item.value === 3 && scope.row.订单进度 > index, 'arrow-active2': item.value === 3 && scope.row.订单进度 === index + 1,'triangle2': item.value === 3, 'triangle-active3': item.value === 4 && scope.row.订单进度 > index, 'arrow-active3': item.value === 4 && scope.row.订单进度 === index + 1,'triangle3': item.value === 4, 'triangle-active4': item.value === 5 && scope.row.订单进度 > index, 'arrow-active4': item.value === 5 && scope.row.订单进度 === index + 1,'triangle4': item.value === 5}"/>
</div>
</div>
</template>
<template v-if="Number(scope.row.订单类型)===3 && scope.row.订单编号.split('-')[0] ==='BHWG'">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="{'active': item.value === 1 && scope.row.订单进度 > index,'title': item.value === 1,'active1': item.value === 2 && scope.row.订单进度 > index,'title1': item.value === 2,'active2': item.value === 3 && scope.row.订单进度 > index,'title2': item.value === 3,'active3': item.value === 4 && scope.row.订单进度 > index,'title3': item.value === 4}">
<div style="margin-left: 40px;">{{ item.item }}<br>{{ item.date }}</div>
<div :class="{'triangle-active': item.value === 1 && scope.row.订单进度 > index, 'arrow-active': item.value === 1 && scope.row.订单进度 === index + 1,'triangle': item.value === 1, 'triangle-active1': item.value === 2 && scope.row.订单进度 > index, 'arrow-active1': item.value === 2 && scope.row.订单进度 === index + 1,'triangle1': item.value === 2, 'triangle-active2': item.value === 3 && scope.row.订单进度 > index, 'arrow-active2': item.value === 3 && scope.row.订单进度 === index + 1,'triangle2': item.value === 3, 'triangle-active3': item.value === 4 && scope.row.订单进度 > index, 'arrow-active3': item.value === 4 && scope.row.订单进度 === index + 1,'triangle3': item.value === 4}"/>
</div>
</div>
</template>
<template v-if="Number(scope.row.订单类型)===3 && scope.row.订单编号.split('-')[0] ==='BHZZ'">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="{'active': item.value === 1 && scope.row.订单进度 > index,'title': item.value === 1,'active1': item.value === 2 && scope.row.订单进度 > index,'title1': item.value === 2,'active2': item.value === 3 && scope.row.订单进度 > index,'title2': item.value === 3,'active3': item.value === 4 && scope.row.订单进度 > index,'title3': item.value === 4}">
<div style="margin-left: 40px;">{{ item.item }}<br>{{ item.date }}</div>
<div :class="{'triangle-active': item.value === 1 && scope.row.订单进度 > index, 'arrow-active': item.value === 1 && scope.row.订单进度 === index + 1,'triangle': item.value === 1, 'triangle-active1': item.value === 2 && scope.row.订单进度 > index, 'arrow-active1': item.value === 2 && scope.row.订单进度 === index + 1,'triangle1': item.value === 2, 'triangle-active2': item.value === 3 && scope.row.订单进度 > index, 'arrow-active2': item.value === 3 && scope.row.订单进度 === index + 1,'triangle2': item.value === 3, 'triangle-active3': item.value === 4 && scope.row.订单进度 > index, 'arrow-active3': item.value === 4 && scope.row.订单进度 === index + 1,'triangle3': item.value === 4}"/>
</div>
</div>
</template>
<template v-if="Number(scope.row.订单类型)===4">
<div class="steps-container">
<div v-for="(item, index) in scope.row.names" :key="index" :class="{'active': item.value === 1 && scope.row.订单进度 > index,'title': item.value === 1,'active1': item.value === 2 && scope.row.订单进度 > index,'title1': item.value === 2,'active2': item.value === 3 && scope.row.订单进度 > index,'title2': item.value === 3,'active3': item.value === 4 && scope.row.订单进度 > index,'title3': item.value === 4}">
<div style="margin-left: 40px;">{{ item.item }}<br>{{ item.date }}</div>
<div :class="{'triangle-active': item.value === 1 && scope.row.订单进度 > index, 'arrow-active': item.value === 1 && scope.row.订单进度 === index + 1,'triangle': item.value === 1, 'triangle-active1': item.value === 2 && scope.row.订单进度 > index, 'arrow-active1': item.value === 2 && scope.row.订单进度 === index + 1,'triangle1': item.value === 2, 'triangle-active2': item.value === 3 && scope.row.订单进度 > index, 'arrow-active2': item.value === 3 && scope.row.订单进度 === index + 1,'triangle2': item.value === 3, 'triangle-active3': item.value === 4 && scope.row.订单进度 > index, 'arrow-active3': item.value === 4 && scope.row.订单进度 === index + 1,'triangle3': item.value === 4}"/>
</div>
</div>
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="details(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center style="min-height: 300px" width="900px">
<div id="WGBLD" style="width: 830px;margin: 0 auto">
<div style="margin: 0 0 10px 300px">
<h3>浙江景耀数控科技有限公司</h3>
</div>
<div style="margin: 0 0 0 370px">
<h4>模块订单</h4>
</div>
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr style="height: 40px">
<td colspan="4" style="text-align: center;width: 20%">下单人员</td>
<td colspan="5" style="text-align: center;width: 40%">{{ people }}</td>
<td colspan="4" style="text-align: center;width: 20%">订单号</td>
<td colspan="4" style="text-align: center;width: 20%">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 10%">收货人</td>
<td colspan="2" style="text-align: center;width: 10%">王总</td>
<td colspan="2" style="text-align: center;width: 16%">下单日期</td>
<td colspan="3" style="text-align: center;width: 24%">{{ date1 }}</td>
<td colspan="4" style="text-align: center;width: 20%">交货日期</td>
<td colspan="4" style="text-align: center;width: 20%">{{ date2 }}</td>
</tr>
<tr id="tablehead11" style="height: 35px">
<td colspan="5" style="text-align: center;width: 40%">产品名称</td>
<td colspan="2" style="text-align: center;width: 10%">数量</td>
<td colspan="10" style="text-align: center;width: 50%">客户要求我方付运费</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="5" style="text-align: center;width: 40%">{{ list.产品名称 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.数量 }}</td>
<td colspan="10" style="text-align: center;width: 50%">{{ list.配置 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="17" style="text-align: center;width: 40%">配件明细表</td>
</tr>
<tr id="tablehead12" style="height: 35px">
<td colspan="2" rowspan="2" style="text-align: center;width: 10%">轴承型号</td>
<td colspan="4" rowspan="1" style="text-align: center;width: 20%">电机选配</td>
<td colspan="2" rowspan="2" style="text-align: center;width: 10%">安装方向</td>
<td colspan="9" rowspan="1" style="text-align: center;width: 60%">传动方式</td>
</tr>
<tr>
<td colspan="2" rowspan="1" style="text-align: center;width: 10%">功率</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 10%">转速</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 10%">三角带及带轮型号</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 10%">同步带及带轮型号</td>
<td colspan="2" rowspan="1" style="text-align: center;width: 10%">多楔带及带轮型号</td>
<td colspan="3" rowspan="1" style="text-align: center;width: 15%">齿轮传动及齿轮型号</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="2" style="text-align: center;width: 10%">{{ list.轴承型号 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.功率 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.转速 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.安装方向 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.三角带及带轮型号 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.同步带及带轮型号 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.多楔带及带轮型号 }}</td>
<td colspan="3" style="text-align: center;width: 15%">{{ list.齿轮传动及齿轮型号 }}</td>
</tr>
<tfoot>
<tr style="height: 40px">
<td colspan="2" align="center">备注 </td>
<td colspan="15" align="center">{{ TotalAmount }}</td>
</tr>
</tfoot>
</table>
<div style="margin-top: 20px">审核1___________ 审核2___________ 跟单___________</div>
<div style="margin-top: 20px">装配人员________ 检验人员________ 装箱人员_______ 发货人员___________</div>
<div style="margin-top: 20px;margin-left: 400px">完成时间______ ____月_____日</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
returns: [{
产品名称: 'MT3#-1',
数量: 2,
配置: '配1.1KW4级电机转速700电机后置配好拉杆',
轴承型号: '标配',
功率: '1.1KW4级',
转速: '700',
安装方向: '后置',
三角带及带轮型号: '',
同步带及带轮型号: '电机轮22齿主轴轮40齿',
多楔带及带轮型号: '',
齿轮传动及齿轮型号: ''
}],
people: '杨帆',
contract: 'MK20210417001',
date1: '2021.01.09',
date2: '2021.01.19',
TotalAmount: '',
dialogFormVisible: false,
date: '2021-02-03',
dialogVisible: false,
loading0: false,
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
orderValue: '', // 订单编号
orderArray: [], // 订单编号数组
num: null,
pageCurrent: 1,
pageSize: 30,
tableData7: [],
tableData6: [],
tableData: [],
state: null,
total: null,
title: '',
values: 2,
typeOne: ['订单下达', '技术确认', '装配', '发货'],
typeTwo: ['订单下达', '技术确认', '生产', '装配', '发货'],
typeThree1: ['订单下达', '技术确认', '自制', '入库'],
typeThree2: ['订单下达', '技术确认', '采购', '入库'],
typeFour: ['订单下达', '技术确认', '装配', '入库'],
names: [{
item: '订单下达',
date: '2021-04-28',
value: 1
}, {
item: '技术确认',
date: '2021-04-29',
value: 2
}, {
item: '装配',
date: '2021-04-30',
value: 3
}, {
item: '发货',
date: '',
value: 4
}],
List: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'token',
'id' // 人员编号
])
},
created() {
this.fetchData()
this.searchData()
},
methods: {
details(row) {
this.dialogFormVisible = true
},
fetchData() {
this.getCustomer('')
this.getOrder('')
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getOrder() {
this.orderArray = []
let customerNameValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['买方名称', this.customerNameValue]
param[2] = ['订单编号', this.orderValue]
var Data = this.CreateData('11', '订单信息_列表_通过客户_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderArray.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
searchData() {
let customerNameValue_check, orderValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['订单编号_check', orderValue_check]
param[3] = ['订单流水号', this.orderValue]
this.tableData = []
var Data = this.CreateData('11', '订单信息_订单进度_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.rows.length; i++) {
const Names = []
if (Number(response.data.rows[i].订单类型) === 1) {
for (let j = 0; j < 4; j++) {
Names.push({
item: this.typeOne[j],
date: j === 0 ? response.data.rows[i].创建日期 : (j === 1 ? response.data.rows[i].确认日期 : (j === 2 ? response.data.rows[i].装配日期 : (j === 3 ? response.data.rows[i].发货日期 : ''))),
value: j + 1
})
}
} else if (Number(response.data.rows[i].订单类型) === 2) {
for (let j = 0; j < 5; j++) {
Names.push({
item: this.typeTwo[j],
date: j === 0 ? response.data.rows[i].创建日期 : (j === 1 ? response.data.rows[i].确认日期 : (j === 2 ? response.data.rows[i].自制日期 : (j === 3 ? response.data.rows[i].装配日期 : (j === 4 ? response.data.rows[i].发货日期 : '')))),
value: j + 1
})
}
} else if (Number(response.data.rows[i].订单类型) === 3 && response.data.rows[i].订单编号.split('-')[0] === 'BHZZ') {
for (let j = 0; j < 4; j++) {
Names.push({
item: this.typeThree1[j],
date: j === 0 ? response.data.rows[i].创建日期 : (j === 1 ? response.data.rows[i].确认日期 : (j === 2 ? response.data.rows[i].自制日期 : (j === 3 ? response.data.rows[i].入库日期 : ''))),
value: j + 1
})
}
} else if (Number(response.data.rows[i].订单类型) === 3 && response.data.rows[i].订单编号.split('-')[0] === 'BHWG') {
for (let j = 0; j < 4; j++) {
Names.push({
item: this.typeThree2[j],
date: j === 0 ? response.data.rows[i].创建日期 : (j === 1 ? response.data.rows[i].确认日期 : (j === 2 ? response.data.rows[i].采购日期 : (j === 3 ? response.data.rows[i].入库日期 : ''))),
value: j + 1
})
}
} else if (Number(response.data.rows[i].订单类型) === 4) {
for (let j = 0; j < 4; j++) {
Names.push({
item: this.typeFour[j],
date: j === 0 ? response.data.rows[i].创建日期 : (j === 1 ? response.data.rows[i].确认日期 : (j === 2 ? response.data.rows[i].装配日期 : (j === 3 ? response.data.rows[i].入库日期 : ''))),
value: j + 1
})
}
}
this.tableData.push({
订单编号: response.data.rows[i].订单编号,
买方: response.data.rows[i].买方,
订单类型: response.data.rows[i].订单类型,
订单进度: response.data.rows[i].订单进度,
names: Names
})
}
this.total = response.data.total
})
},
handleSizeChange(val) {
this.pageSize = val
this.searchData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchData()
}
}
}
</script>
<style scoped>
>>.el-step.is-simple .el-step__head {
width: auto;
font-size: 0;
margin-top: 9px;
padding-right: 0px;
}
>>.el-step__head.is-process {
color: #303133;
border-color: #303133;
}
>>.el-step__head.is-wait {
color: #C0C4CC;
border-color: #C0C4CC;
}
.el-card{
margin-bottom: 15px;
}
.el-date-editor{
width:150px
}
span{
margin: 10px 0 10px 10px;
}
.el-card{
margin: 0px;
}
.el-steps--simple {
padding: 0;
}
</style>
<style scoped lang="scss">
/deep/ .el-table__row{
height: 94px !important;
}
/* 去掉中间数据的分割线 */
/deep/ .el-table__row>td{
border: none;
}
/* 去掉上面的线 */
/deep/ .el-table th.is-leaf{
border: none;
}
/* 去掉最下面的那一条线 */
/deep/ .el-table::before {
height: 0px;
}
/deep/ .el-table--border {
border: none;
}
</style>
<!--<template>-->
<!--<div class="steps-container">-->
<!--<div v-for="(item, index) in names" :key="index" :class="{'active': item === 1,'title': item === 1,'active1': item === 2,'title1': item === 2,'active2': item === 3,'title2': item === 3,'active3': item === 4,'title3': item === 4}">-->
<!--<div style="margin-left: 20px">{{ item }}</div>-->
<!--<div>{{ item }}</div>-->
<!--<div :class="{'triangle-active': item === 1, 'arrow-active': item === 2,'triangle': item === 1, 'triangle-active1': item === 2, 'arrow-active1': item === 3,'triangle1': item === 2, 'triangle-active2': item === 3, 'arrow-active2': item === 4,'triangle2': item === 3, 'triangle-active3': item === 4, 'arrow-active3': item === 5,'triangle3': item === 4}"/>-->
<!--</div>-->
<!--</div>-->
<!--</template>-->
<!--<script>-->
<!--export default {-->
<!--name: 'Step',-->
<!--data() {-->
<!--return {-->
<!--names: [1, 2, 3, 4]-->
<!--}-->
<!--}-->
<!--}-->
<!--</script>-->
<style scoped lang="stylus">
.steps-container
display flex
overflow hidden
.title
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active
background #E9F0FA
color:black
.title1
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active1
background #B7D7F0
color:black
.title2
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active2
background #6EABE1
color:black
.title3
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active3
background #2682D5
color:black
.title4
width 140px
height 85px
display flex
justify-content center
align-items center
background #F2F2F2
font-size 14px
font-weight 500
color #969191
position relative
.active4
background #1E6EB7
color:black
.triangle
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff;
.triangle::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active
border-color transparent transparent transparent #ffffff
.triangle-active::after
border-color transparent transparent transparent #E9F0FA
.triangle1
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff;
.triangle1::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active1
border-color transparent transparent transparent #ffffff
.triangle-active1::after
border-color transparent transparent transparent #B7D7F0
.triangle2
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff;
.triangle2::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active2
border-color transparent transparent transparent #ffffff
.triangle-active2::after
border-color transparent transparent transparent #6EABE1
.triangle3
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff;
.triangle3::after
content ''
position absolute
left -43px
top -40px
border-width 40px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active3
border-color transparent transparent transparent #ffffff
.triangle-active3::after
border-color transparent transparent transparent #2682D5
.triangle4
position absolute
right -85px
z-index 10
top -1px
width 0
height 0
border-width 43px
border-style solid
border-color transparent transparent transparent #ffffff;
.triangle4::after
content ''
position absolute
left -43px
top -42px
border-width 42px
border-style solid
border-color transparent transparent transparent #F2F2F2
.arrow-active4
border-color transparent transparent transparent #ffffff
.triangle-active4::after
border-color transparent transparent transparent #1E6EB7
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,467 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="customerNameValue"
:remote-method="getCustomer"
style="width:200px"
placeholder="买方名称"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="orderValue"
:remote-method="getOrder"
style="width:200px"
placeholder="订单编号"
size="small"
filterable
clearable
remote
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="font-size: 13px;color: black">下单日期</span>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 100;searchTable()"/>
<span style="font-size: 13px;color: black">完成期限</span>
<el-date-picker
v-model="dateRange1"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="pageCurrent = 1;pageSize = 100;searchTable()"/>
<el-select
v-model="orderStateValue"
style="width:100px;margin-left: 10px"
placeholder="订单状态"
size="small"
filterable
clearable
@change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in orderState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
icon="el-icon-search"
type="primary"
plain
size="small"
style="margin-left: 10px"
@click="pageCurrent = 1;pageSize = 100;searchTable()">查询
</el-button>
</div>
<el-col style="margin-top: 10px;width: 731px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
border
stripe
size="small"
style="width: 731px"
height="740px"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('状态')" label="订单状态" align="center" prop="订单状态">
<template slot-scope="scope">
{{ scope.row.订单状态 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" label="收货人" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.收货人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('买方名称')" label="买方" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.买方 }}
</template>
</el-table-column>
<el-table-column width="93px" label="完成期限" align="center">
<template slot-scope="scope">
{{ scope.row.交货日期 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期')" label="下单日期" align="center">
<template slot-scope="scope">
{{ scope.row.创建日期 }}
</template>
</el-table-column>
<el-table-column label="下单人" align="center">
<template slot-scope="scope">
{{ scope.row.创建人 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-col>
<el-col style="margin-top: 10px;margin-left: 30px;width: 801px">
<div style="color: black;margin-top: 5px;font-size: 20px">&nbsp;&nbsp;&nbsp;&nbsp;{{ 订单编号 }}</div>
<div style="margin: 10px 0 0 20px;height: 650px;overflow: auto">
<el-tree
:data="departmentData"
:props="defaultProps"
:indent="50"
:expand-on-click-node="false"
:render-content="renderContent"
node-key="订单流水号"
class="selectTree"
@node-click="onClick"/>
</div>
</el-col>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="工序加工情况" width="831px">
<div style="width: 100%;display: inline-block">
<el-table
:data="tableData1"
:header-cell-style="{background: '#383E4B',color: 'white'}"
height="328px"
highlight-current-row
border>
<el-table-column :width="setColumnWidth('序号')" align="center" label="序号" type="index"/>
<el-table-column :width="setColumnWidth('工序')" align="center" label="工序" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="订单数" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="完成数" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('姓名')" align="center" label="加工人" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.加工人 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('加工设备')" align="center" label="加工设备" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.加工设备 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" align="center" label="加工开始" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.加工开始 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" align="center" label="加工完成" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.加工完成 }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
orderValue: '', // 订单编号
orderArray: [], // 订单编号数组
dateRange: '', // 下单日期
dateRange1: '', // 完成期限
orderStateValue: '', // 订单状态
orderState: [], // 合同状态数组
loading: false, // 数据加载
dialogFormVisible: false,
total: 0, // 分页总数
tableData: [], // 订单信息表
tableData1: [], // 产品信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
订单编号: '',
defaultProps: {
children: 'children',
label: 'label'
},
departmentData: [] // 树状数据
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
this.searchTable()
},
methods: {
fetchData() {
this.getCustomer()
this.getOrder('')
this.getOrderState()
},
getCustomer(query) {
this.customerName = []
var param = []
param[0] = ['客户名称', query]
var Data = this.CreateData('11', '合同管理_客户信息_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.customerName.push({
label: response.data[i].客户名称,
value: response.data[i].客户流水号
})
}
})
},
getOrder(query) {
this.orderArray = []
var param = []
param[0] = ['订单编号', query]
var Data = this.CreateData('11', '订单信息_列表_查询数据_bak', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderArray.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getOrderState() {
var param = []
var Data = this.CreateData('11', '订单状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderState.push({
label: response.data[i].订单状态,
value: response.data[i].订单状态流水号
})
}
})
},
searchTable() {
this.departmentData = []
this.订单编号 = ''
let customerNameValue_check, orderValue_check, dateRange_check, dateRange1_check, orderStateValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.dateRange1 ? dateRange1_check = 1 : (dateRange1_check = 0, this.dateRange1 = '')
if (this.orderStateValue === 0) {
orderStateValue_check = 1
} else if (this.orderStateValue) {
orderStateValue_check = 1
} else {
orderStateValue_check = 0
}
var param = []
param[0] = ['买方名称_check', customerNameValue_check]
param[1] = ['客户流水号', this.customerNameValue]
param[2] = ['订单编号_check', orderValue_check]
param[3] = ['订单流水号', this.orderValue]
param[4] = ['下单日期_check', dateRange_check]
param[5] = ['开始时间', this.dateRange[0]]
param[6] = ['结束时间', this.dateRange[1]]
param[7] = ['订单状态_check', orderStateValue_check]
param[8] = ['订单状态', this.orderStateValue]
param[9] = ['完成期限_check', dateRange1_check]
param[10] = ['完成期限开始时间', this.dateRange1[0]]
param[11] = ['完成期限结束时间', this.dateRange1[1]]
var Data = this.CreateData('11', '订单信息_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
})
},
searchTable1(row) {
this.订单编号 = row.订单编号
this.option = []
var param = []
param[0] = ['订单流水号', row.订单流水号]
var Data = this.CreateData('11', '车间生产管理工艺_组件状态查询_查询所有组', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.option.push({
isLeaf: false,
label: response.data[i].产品名称 + '\xa0\xa0\xa0数量:' + response.data[i].数量 + (response.data[i].是否滑台 === 1 || response.data[i].是否滑台 === 2 ? '\xa0\xa0\xa0装配完成:' + response.data[i].完成数量 : '\xa0\xa0\xa0采购到货:' + (response.data[i].外购件入库率 ? response.data[i].外购件入库率 : '') + '\xa0\xa0\xa0加工完成:' + (response.data[i].自制件入库率 ? response.data[i].自制件入库率 : '')) + '\xa0\xa0\xa0' + response.data[i].组件完成状态,
value: response.data[i].组件流水号,
组件完成状态: response.data[i].组件完成状态,
father: true,
children: []
})
}
}).then(() => {
this.option.map(firstLevel => {
var param1 = []
param1[0] = ['组件流水号', firstLevel.value]
var Data1 = this.CreateData('11', '车间生产管理工艺_车间组件完成情况_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
firstLevel.children = []
for (let j = 0; j < response.data.length; j++) {
firstLevel.children.push({
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + '.........' + (response.data[j].批次数量 ? response.data[j].批次数量 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0库存' + response.data[j].累计库存 + (response.data[j].零件类型 === 1 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0自制' + response.data[j].状态 : (response.data[j].零件类型 === 2 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购' + response.data[j].采购状态 : '')),
value: response.data[j].工艺计划流水号,
考核状态: response.data[j].考核状态,
采购状态: response.data[j].采购状态,
零件类型: response.data[j].零件类型,
father: false
})
}
})
})
}).then(() => {
this.departmentData = this.option
})
},
onClick(num) {
this.tableData1 = []
console.log(num, 12344)
if (num.value > 0 && num.father === false) {
this.dialogFormVisible = true
if (num.零件类型 === 1) {
var param = []
param[0] = ['工艺计划流水号', num.value]
var Data = this.CreateData('11', '车间生产管理工艺_追溯加工_查询工序', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
}
}
},
renderContent(h, { node, data, store }) {
if (node.data.father === false) {
if (node.data.零件类型 === 1) { // 自制
if (parseInt(node.data.考核状态) > 2) {
return (<span class='treeNotesComplate'>{node.label}</span>)
} else {
return (<span class='treeNotesUnComplate'>{node.label}</span>)
}
} else { // 外购
if (node.data.采购状态 === '已到') {
return (<span class='treeNotesComplate'>{node.label}</span>)
} else {
return (<span class='treeNotesUnComplate'>{node.label}</span>)
}
}
} else {
if (node.data.组件完成状态 === '完成') {
return (<span class='treeNotesComplate'>{node.label}</span>)
} else {
return (<span class='treeNotesUnComplate'>{node.label}</span>)
}
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>> .el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>> .el-dialog__header {
padding: 20px 20px 0px;
}
>>> .el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>> .el-form-item {
margin-bottom: 13px;
}
</style>
<style lang="scss">
.selectTree {
.el-tree-node__content > .el-tree-node__expand-icon {
display: inline !important;
}
.el-tree-node:focus > .el-tree-node__content {
background-color: #ccc !important;
}
}
.treeNotesComplate {
color: black;
font-size: 17px;
background-color: #9bd7fc !important;
}
.treeNotesUnComplate {
color: black;
font-size: 17px;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,148 @@
<template>
<div>
<el-card>
<el-date-picker
v-model="selectionTimeValue"
size="small"
type="daterange"
align="center"
style="width: 240px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<div id="myChart6" style="width: 1500px;height: 800px;text-align: center"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
TitlesDrawings: '',
yName: '',
legend: [],
value4: '',
selectionTimeValue: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
watch: {
salesVolume() {
this.getProductItemValue1()
},
selectionTimeValue() {
this.getProductItemValue1()
}
},
created() {},
methods: {
getProductItemValue1() {
if (this.selectionTimeValue) {
var param1 = []
param1[0] = ['开始时间', this.selectionTimeValue[0]]
param1[1] = ['结束时间', this.selectionTimeValue[1]]
var Data1 = this.CreateData('11', 'jy_设备利用率_工位查询', param1)
this.ExecDatabase(Data1).then(response => {
this.legend = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.legend.push(response.data[i].工位号)
}
}
}).then(() => {
this.saleData = []
var param = []
param[0] = ['开始时间', this.selectionTimeValue[0]]
param[1] = ['结束时间', this.selectionTimeValue[1]]
var Data = this.CreateData('11', 'jy_设备利用率_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let j = 0; j < this.legend.length; j++) {
this.xdata = []
this.ydata = []
for (let i = 0; i < response.data.length; i++) {
this.xdata.push(response.data[i].时间)
if (!this.downdate) {
this.downdate = 0
}
this.ydata.push(response.data[i][this.legend[j]])
}
var s_temp = {
name: this.legend[j],
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: this.ydata
}
this.saleData.push(s_temp)
}
}
}).then(() => {
this.drawLine1()
})
})
} else {
this.$message.warning('请先选择日期')
}
},
drawLine1() {
this.myChart6 = echarts.init(document.getElementById('myChart6'))
// 绘制图表
this.myChart6.clear()
this.myChart6.setOption({
title: {
left: 'center',
text: '设备利用率'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: this.legend,
x: 'center',
y: 'bottom'
},
grid: {
left: '3%',
right: '4%',
bottom: '5%',
containLabel: true
},
yAxis: {
name: '有效工作时长',
type: 'value'
},
xAxis: {
type: 'category',
data: this.xdata
},
series: this.saleData
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,382 @@
<template>
<div>
<el-card>
<el-tabs v-model="PartType" type="border-card">
<el-tab-pane label="销售趋势分析图" name="销售趋势分析图">
<el-radio v-model="salesVolume" label="1">销售额</el-radio>
<el-radio v-model="salesVolume" label="2">销售量</el-radio>
<el-date-picker
v-model="selectionTimeValue"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"/>
<el-select v-model="selectionProductValue" style="width: 150px" size="small" multiple filterable placeholder="选择产品" @change="getProductItemValue1">
<el-option
v-for="item in selectionProduct"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 40px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart2" style="width: 1500px;height: 800px;text-align: center"/>
</el-tab-pane>
<el-tab-pane label="表格数据" name="表格数据">
<el-date-picker
v-model="selectionTimeValue1"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"
@change="searchTable()"/>
<el-input v-model="productName" size="small" style="width: 200px;" placeholder="产品名称" clearable @keyup.enter.native="searchTable()"/>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 20px" @click="exportExcel()">导出</el-button>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 821px" height="763px">
<el-table-column :width="setColumnWidth('序号')" label="序号" align="center" type="index"/>
<el-table-column label="产品名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('销售量')" label="销售量" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.销售量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('销售额')" label="占比" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.销售量占比 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('销售额')" label="销售额" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.销售额 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('销售额')" label="占比" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.销售额占比 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
:pager-count="5"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
PartType: '销售趋势分析图',
loading: false,
pageCurrent: 1,
pageSize: 20,
total: 0,
tableData: [],
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()])
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date()
const start = new Date(new Date().getFullYear(), 0)
picker.$emit('pick', [start, end])
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 12)
picker.$emit('pick', [start, end])
}
}, {
text: '最近两年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 24)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 36)
picker.$emit('pick', [start, end])
}
}]
},
saleData: [],
legend: [],
salesVolume: '2',
selectionProduct: [],
selectionProductValue: '',
selectionProductValue_check: 0,
TitlesDrawings: '',
yName: '',
salesVolume_check: 0,
productName: '',
selectionTimeValue1: '',
selectionTimeValue: '',
selectionTimeValue_check: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
watch: {
salesVolume() {
this.changeTitlesDrawings()
this.getProductItemValue1()
},
selectionTimeValue() {
this.getProductItemValue1()
}
},
created() {
this.changeTitlesDrawings()
this.getProduct()
},
methods: {
searchTable() {
this.loading = true
let product_check
this.productName ? product_check = 1 : product_check = 0
var param = []
param[0] = ['开始时间', this.selectionTimeValue1[0]]
param[1] = ['结束时间', this.selectionTimeValue1[1]]
param[2] = ['产品_check', product_check]
param[3] = ['产品', this.productName]
var Data = this.CreateData('11', 'jy_销售趋势分析_表格查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data.rows
this.total = response.data.total
this.loading = false
})
},
exportExcel() {
if (this.tableData.length !== 0) {
let product_check
this.productName ? product_check = 1 : product_check = 0
var param = []
param[0] = ['开始时间', this.selectionTimeValue1[0]]
param[1] = ['结束时间', this.selectionTimeValue1[1]]
param[2] = ['产品_check', product_check]
param[3] = ['产品', this.productName]
var Data = this.CreateData('2001', 'jy_销售趋势分析_表格数据_导出', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
changeTitlesDrawings() {
if (this.salesVolume === '2') {
// 这里写的是 当按钮选择与不选择时 表格的 表头以及表格y轴名称的变化
this.TitlesDrawings = '销售量趋势分析图'
this.yName = '销售量'
} else {
this.TitlesDrawings = '销售额趋势分析图'
this.yName = '销售额'
}
},
getProduct() {
var param = []
var Data = this.CreateData('11', '数据分析_产品信息_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectionProduct.push({
label: response.data[i].产品名称,
value: response.data[i].产品流水号
})
}
})
},
getProductItemValue1() {
if (this.selectionTimeValue) {
if (this.salesVolume === '2') { this.salesVolume_check = 0 } else { this.salesVolume_check = 1 }
if (this.selectionProductValue && this.selectionProductValue.length > 0) {
this.selectionProductValue_check = 1
} else {
this.selectionProductValue_check = 0
}
this.selectionTimeValue ? this.selectionTimeValue_check = 1 : (this.selectionTimeValue_check = 0, this.selectionTimeValue = '')
var param1 = []
param1[0] = ['开始时间', this.selectionTimeValue[0]]
param1[1] = ['结束时间', this.selectionTimeValue[1]]
param1[2] = ['产品_check', this.selectionProductValue_check]
param1[3] = ['产品', this.selectionProductValue]
var Data1 = this.CreateData('11', 'jy_销售趋势分析_产品名称_查询', param1)
this.ExecDatabase(Data1).then(response => {
this.legend = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.legend.push(response.data[i].产品名称)
}
}
}).then(() => {
this.saleData = []
var param = []
param[0] = ['销售额_check', this.salesVolume_check]
param[1] = ['时间_check', this.selectionTimeValue_check]
param[2] = ['开始时间', this.selectionTimeValue[0]]
param[3] = ['结束时间', this.selectionTimeValue[1]]
param[4] = ['产品_check', this.selectionProductValue_check]
param[5] = ['产品', this.selectionProductValue]
var Data = this.CreateData('11', 'jy_销售趋势分析_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let j = 0; j < this.legend.length; j++) {
this.xdata = []
this.ydata = []
for (let i = 0; i < response.data.length; i++) {
this.xdata.push(response.data[i].签订日期月)
if (!this.downdate) { this.downdate = 0 }
this.ydata.push(response.data[i][this.legend[j]])
}
var s_temp = {
name: this.legend[j],
type: 'line',
symbol: 'none',
markLine: {
// markline表示是柱形图之外的折线图 它的数据和柱形图是一样的都来子this.ydata
lineStyle: {
normal: {
type: 'dashed'
}
}
},
data: this.ydata
}
this.saleData.push(s_temp)
}
}
}).then(() => {
this.drawLine1()
})
})
} else {
this.$message.warning('请先选择日期')
}
},
drawLine1() {
this.myChart2 = echarts.init(document.getElementById('myChart2'))
// 绘制图表
this.myChart2.clear()
const _this = this
this.myChart2.setOption({
tooltip: {
trigger: 'axis'
},
xAxis: [{
axisLabel: {
interval: 0,
rotate: 0,
formatter: function(value) {
return value.split(' ').join('\n')
}
},
name: '日期',
type: 'category',
data: this.xdata
}],
yAxis: [{
name: this.yName,
type: 'value',
max: function(value) {
return _this.update > value.max ? (1.2 * _this.update).toFixed(2) : (1.2 * value.max).toFixed(2)
// 这里写的是y轴的最大值为提取数据中最大值的1.2倍
}
}],
dataZoom: [{
type: 'inside',
start: 0,
end: 100,
filterMode: 'none'
}, {
show: true,
type: 'slider',
top: '85%',
xAxisIndex: [0],
zoomLock: false,
start: 0,
end: 20
}],
series: this.saleData,
grid: {
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
legend: {
data: this.legend,
x: 'center',
y: 'bottom',
icon: 'roundRect', // 图标设置为圆角矩形
itemHeight: 3,
itemWidth: 25
}
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,257 @@
<template>
<div>
<el-card>
<el-radio v-model="salesVolume" label="1">销售额</el-radio>
<el-radio v-model="salesVolume" label="2">销售量</el-radio>
<el-date-picker
v-show="salesVolume === '2'"
v-model="selectionTimeValue"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"/>
<el-date-picker
v-show="salesVolume === '1'"
v-model="year1"
value-format="yyyy"
align="right"
size="small"
type="year"
style="width: 150px"
placeholder="开始年份"
@change="getProductItemValue1"/>
<el-date-picker
v-show="salesVolume === '1'"
v-model="year2"
value-format="yyyy"
align="right"
size="small"
type="year"
style="width: 150px"
placeholder="结束年份"
@change="getProductItemValue1"/>
<span style="margin-left: 240px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart5" style="width: 1500px;height: 800px;text-align: center"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()])
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date()
const start = new Date(new Date().getFullYear(), 0)
picker.$emit('pick', [start, end])
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 12)
picker.$emit('pick', [start, end])
}
}, {
text: '最近两年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 24)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 36)
picker.$emit('pick', [start, end])
}
}]
},
year1: '',
year2: '',
salesVolume: '1',
TitlesDrawings: '',
yName: '',
salesVolume_check: 0,
selectionTimeValue: '',
selectionTimeValue_check: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
watch: {
salesVolume() {
this.changeTitlesDrawings()
},
selectionTimeValue() {
this.getProductItemValue1()
}
},
created() {
this.changeTitlesDrawings()
},
methods: {
changeTitlesDrawings() {
if (this.salesVolume === '1') {
// 这里写的是 当按钮选择与不选择时 表格的 表头以及表格y轴名称的变化
this.TitlesDrawings = '动力头滑台销售对比图'
this.yName = ['通用销售额', '专机销售额']
} else {
this.TitlesDrawings = '动力头滑台销售对比图'
this.yName = ['滑台', '动力头']
}
},
getProductItemValue1() {
if (this.salesVolume === false && !(this.year1 && this.year2)) {
console.log(this.year1, this.year2)
return
}
if (this.salesVolume === '2' && !(this.selectionTimeValue)) {
return
}
if (this.salesVolume === '1') { this.salesVolume_check = 0 } else { this.salesVolume_check = 1 }
var param = []
param[0] = ['@是否产品_check', this.salesVolume_check]
if (this.salesVolume === '1') {
param[1] = ['开始时间', this.year1]
param[2] = ['结束时间', this.year2]
} else {
param[1] = ['开始时间', this.selectionTimeValue[0]]
param[2] = ['结束时间', this.selectionTimeValue[1]]
}
var Data = this.CreateData('11', 'jy_产品类别分析_查询', param)
this.ExecDatabase(Data).then(response => {
this.xdata = []
this.y1data = []
this.y2data = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
if (this.salesVolume === '1') {
this.xdata.push(response.data[i].签订日期年)
this.y1data.push(response.data[i].通用销售额)
this.y2data.push(response.data[i].专机销售额)
} else {
this.xdata.push(response.data[i].签订日期月)
this.y1data.push(response.data[i].滑台)
this.y2data.push(response.data[i].动力头)
}
if (!this.downdate) { this.downdate = 0 }
}
}
}).then(() => {
this.drawLine1()
})
},
drawLine1() {
this.myChart5 = echarts.init(document.getElementById('myChart5'))
// 绘制图表
this.myChart5.clear()
this.myChart5.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {
data: this.yName,
x: 'center',
y: 'bottom'
},
grid: {
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
yAxis: {
type: 'value'
},
xAxis: {
type: 'category',
data: this.xdata
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100,
filterMode: 'none'
}, {
show: true,
type: 'slider',
top: '85%',
xAxisIndex: [0],
zoomLock: true,
start: 0,
end: 20
}],
series: [
{
name: '滑台',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: this.y1data
},
{
name: '动力头',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: this.y2data
}
]
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,186 @@
<template>
<div>
<el-card>
<el-cascader ref="cascader" :options="product" :show-all-levels="false" placeholder="产品名称" clearable size="small" @clear="clearData" @change="getData"/>
<el-date-picker
v-model="dateRange"
size="small"
type="daterange"
align="center"
style="width: 260px;"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="getProductItemValue1()"/>
<span style="margin-left: 200px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart1" style="width: 1500px;height: 820px;text-align: center"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
dateRange: '',
TitlesDrawings: '',
product: [],
productValue: '',
yName: '',
selectionProductValue: '',
selectionProduct: []
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
created() {
this.getTreeData()
this.changeTitlesDrawings()
},
methods: {
getTreeData() {
var param = []
param[0] = ['子节点', 0]
var Data = this.CreateData('11', '产品关系_查询节点', param)
this.ExecDatabase(Data).then(response => {
const data = response.data
this.product = this.tree(data, 0)
})
},
tree(data, pid) {
const result = []
let temp
for (let i = 0; i < data.length; i++) {
if (data[i].父节点 === pid) {
const obj = { label: data[i].节点名称, value: data[i].子节点 }
temp = this.tree(data, data[i].子节点)
if (temp.length > 0) {
obj.children = temp
}
result.push(obj)
}
}
return result
},
getData(val) {
this.productValue = val[val.length - 1]
this.getProductItemValue1()
},
changeTitlesDrawings() {
this.TitlesDrawings = '产品定价分析图'
this.yName = '销\n售\n额'
},
getProduct() {
var param = []
var Data = this.CreateData('11', '数据分析_产品信息_基础表_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectionProduct.push({
label: response.data[i].产品名称,
value: response.data[i].产品流水号
})
}
})
},
getProductItemValue1() {
if (this.productValue) {
let dateRange_check
console.log(this.dateRange, 123)
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
console.log(dateRange_check, 234)
var param = []
param[0] = ['选择产品', this.productValue]
param[1] = ['时间_check', dateRange_check]
param[2] = ['开始时间', this.dateRange[0]]
param[3] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', 'jy_产品定价分析_查询', param)
this.ExecDatabase(Data).then(response => {
this.xdata = []
this.y1data = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.xdata.push(response.data[i].单价)
if (!this.downdate) { this.downdate = 0 }
this.y1data.push(response.data[i].销售额)
}
}
}).then(response => {
this.drawLine1()
})
} else {
this.$message.warning('请先选择产品')
}
},
drawLine1() {
this.myChart1 = echarts.init(document.getElementById('myChart1'))
// 绘制图表
this.myChart1.clear()
const _this = this
this.myChart1.setOption({
xAxis: [{
axisLabel: {
interval: 0,
rotate: 0,
formatter: function(value) {
return value.split(' ').join('\n')
}
},
name: '单价',
type: 'category',
data: this.xdata,
nameLocation: 'middle',
nameTextStyle: {
padding: [20, 0, 0, 0]
}
}],
yAxis: [{
name: this.yName,
type: 'value',
nameTextStyle: {
padding: [10, 135, -180, 20]
},
max: function(value) {
return _this.update > value.max ? (1.2 * _this.update).toFixed(2) : (1.2 * value.max).toFixed(2)
// 这里写的是y轴的最大值为提取数据中最大值的1.2倍
}
}],
series: [{
markLine: {
// markline表示是柱形图之外的折线图 它的数据和柱形图是一样的都来子this.ydata
lineStyle: {
normal: {
type: 'dashed'
}
}
},
label: {
show: true
},
data: this.y1data,
type: 'line'
}],
grid: {
left: '3%',
right: '5%',
bottom: '8%',
containLabel: true
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,198 @@
<template>
<div>
<el-card>
<el-radio v-model="salesVolume" label="1">销售额</el-radio>
<el-radio v-model="salesVolume" label="2">销售量</el-radio>
<el-date-picker
v-model="selectionTimeValue"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"/>
<span style="margin-left: 200px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart4" style="width: 1500px;height: 800px;text-align: center"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()])
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date()
const start = new Date(new Date().getFullYear(), 0)
picker.$emit('pick', [start, end])
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 12)
picker.$emit('pick', [start, end])
}
}, {
text: '最近两年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 24)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 36)
picker.$emit('pick', [start, end])
}
}]
},
salesVolume: '2',
TitlesDrawings: '',
salesVolume_check: 0,
selectStateValue: '',
selectionTimeValue: '',
selectionTimeValue_check: 0,
productionName: [],
production: [],
selectionTime: [{
value: '1',
label: '前三个月'
}, {
value: '2',
label: '前六个月'
}, {
value: '3',
label: '前12个月'
}, {
value: '4',
label: '前二年'
}, {
value: '5',
label: '前三年'
}, {
value: '6',
label: '前四年'
}, {
value: '7',
label: '前五年'
}],
Warehouse: '',
warehouse: [{
value: '1',
label: '一号仓库'
}, {
value: '2',
label: '二号仓库'
}]
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
watch: {
salesVolume() {
this.getProductItemValue2()
this.changeTitlesDrawings()
},
selectionTimeValue() {
this.getProductItemValue2()
}
},
created() {
this.changeTitlesDrawings()
},
methods: {
changeTitlesDrawings() {
if (this.salesVolume === '2') {
// 这里写的是 当按钮选择与不选择时 表格的 表头以及表格y轴名称的变化
this.TitlesDrawings = '各产品销售数量占比'
} else {
this.TitlesDrawings = '各产品销售额占比'
}
},
getProductItemValue2() {
if (this.selectionTimeValue) {
if (this.salesVolume === '2') { this.salesVolume_check = 0 } else { this.salesVolume_check = 1 }
var param = []
param[0] = ['销售额_check', this.salesVolume_check]
param[1] = ['开始时间', this.selectionTimeValue[0]]
param[2] = ['结束时间', this.selectionTimeValue[1]]
var Data = this.CreateData('11', 'jy_产品占比分析_查询', param)
this.ExecDatabase(Data).then(response => {
this.production = []
this.productionName = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.productionName.push(response.data[i].产品名称)
this.production.push({ value: response.data[i].数值, name: response.data[i].产品名称 })
}
}
}).then(() => {
this.drawLine2()
})
}
},
drawLine2() {
this.myChart4 = echarts.init(document.getElementById('myChart4'))
this.myChart4.clear()
this.myChart4.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
top: 1,
left: 1,
data: this.productionName
},
series: [
{
name: '产品名称',
type: 'pie',
radius: '50%',
data: this.production
}
]
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,284 @@
<template>
<div>
<el-card>
<el-radio v-model="salesVolume" label="1">销售额</el-radio>
<el-radio v-model="salesVolume" label="2">销售量</el-radio>
<el-select v-model="selectStateValue" style="width: 150px" size="small" multiple placeholder="选择省份" @change="getProductItemValue1">
<el-option
v-for="item in selectState"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-date-picker
v-model="selectionTimeValue"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"/>
<span style="margin-left: 50px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart3" style="width: 1500px;height: 800px;text-align: center"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as echarts from 'echarts'
export default {
data() {
return {
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()])
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date()
const start = new Date(new Date().getFullYear(), 0)
picker.$emit('pick', [start, end])
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 12)
picker.$emit('pick', [start, end])
}
}, {
text: '最近两年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 24)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 36)
picker.$emit('pick', [start, end])
}
}]
},
salesVolume: '2',
TitlesDrawings: '',
yName: '',
salesVolume_check: 0,
selectStateValue: '',
selectStateValue_check: 0,
selectState: [],
legend: [],
saleData: [],
selectionTimeValue: '',
selectionTimeValue_check: 0
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
watch: {
salesVolume() {
this.changeTitlesDrawings()
this.getProductItemValue1()
},
selectionTimeValue() {
this.getProductItemValue1()
}
},
created() {
this.changeTitlesDrawings()
this.getProvince()
},
methods: {
getProvince() {
var param = []
var Data = this.CreateData('11', '省份信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectState.push({
label: response.data[i].省份,
value: response.data[i].省份流水号
})
}
})
},
changeTitlesDrawings() {
if (this.salesVolume === '2') {
// 这里写的是 当按钮选择与不选择时 表格的 表头以及表格y轴名称的变化
this.TitlesDrawings = '各省销售量趋势图'
this.yName = '销售量'
} else {
this.TitlesDrawings = '各省销售额趋势图'
this.yName = '销售额'
}
},
getProductItemValue1() {
if (this.selectionTimeValue) {
if (this.salesVolume === '2') {
this.salesVolume_check = 0
} else {
this.salesVolume_check = 1
}
console.log(this.selectStateValue, 2222)
if (this.selectStateValue && this.selectStateValue.length > 0) {
this.selectStateValue_check = 1
} else {
this.selectStateValue_check = 0
}
this.selectionTimeValue ? this.selectionTimeValue_check = 1 : (this.selectionTimeValue_check = 0, this.selectionTimeValue = '')
var param1 = []
param1[0] = ['省份_check', this.selectStateValue_check]
param1[1] = ['省份', this.selectStateValue]
param1[2] = ['开始时间', this.selectionTimeValue[0]]
param1[3] = ['结束时间', this.selectionTimeValue[1]]
var Data1 = this.CreateData('11', 'jy_区域销量分析_省份_查询', param1)
this.ExecDatabase(Data1).then(response => {
this.legend = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.legend.push(response.data[i].省份)
}
}
}).then(() => {
this.saleData = []
var param = []
param[0] = ['销售额_check', this.salesVolume_check]
param[1] = ['省份_check', this.selectStateValue_check]
param[2] = ['时间_check', this.selectionTimeValue_check]
param[3] = ['省份', this.selectStateValue]
param[4] = ['开始时间', this.selectionTimeValue[0]]
param[5] = ['结束时间', this.selectionTimeValue[1]]
var Data = this.CreateData('11', 'jy_区域销量分析_查询', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length > 0) {
for (let j = 0; j < this.legend.length; j++) {
this.xdata = []
this.ydata = []
for (let i = 0; i < response.data.length; i++) {
this.xdata.push(response.data[i].签订日期月)
if (!this.downdate) {
this.downdate = 0
}
this.ydata.push(response.data[i][this.legend[j]])
}
var s_temp = {
name: this.legend[j],
type: 'line',
symbol: 'none',
markLine: {
// markline表示是柱形图之外的折线图 它的数据和柱形图是一样的都来子this.ydata
lineStyle: {
normal: {
type: 'dashed'
}
}
},
data: this.ydata
}
this.saleData.push(s_temp)
}
}
}).then(() => {
this.drawLine1()
})
})
} else {
this.$message.warning('请先选择日期')
}
},
drawLine1() {
this.myChart3 = echarts.init(document.getElementById('myChart3'))
// 绘制图表
this.myChart3.clear()
const _this = this
this.myChart3.setOption({
tooltip: {
trigger: 'axis'
},
xAxis: [{
axisLabel: {
interval: 0,
rotate: 0,
formatter: function(value) {
return value.split(' ').join('\n')
}
},
name: '日期',
type: 'category',
data: this.xdata
}],
yAxis: [{
name: this.yName,
type: 'value',
max: function(value) {
return _this.update > value.max ? 1.2 * _this.update : 1.2 * value.max
// 这里写的是y轴的最大值为提取数据中最大值的1.2倍
}
}],
dataZoom: [{
type: 'inside',
start: 0,
end: 100,
xAxisIndex: [0],
filterMode: 'none'
}, {
show: true,
type: 'slider',
top: '85%',
// orient: 'horizontal',
// backgroundColor: 'red',
// xAxisIndex: [0],
zoomLock: true,
start: 0,
end: 20
}],
series: this.saleData,
grid: {
left: '3%',
right: '6%',
bottom: '20%',
containLabel: true
},
legend: {
data: this.legend,
x: 'center',
y: 'bottom',
icon: 'roundRect',
itemHeight: 3,
itemWidth: 25
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,157 @@
<template>
<div>
<el-card>
<el-date-picker
v-model="selectionTimeValue"
:picker-options="pickerOptions"
value-format="yyyy-MM"
type="monthrange"
align="right"
size="small"
style="width: 260px"
unlink-panels
range-separator="~"
start-placeholder="开始月份"
end-placeholder="结束月份"
@change="getProductItemValue1"/>
<span style="margin-left: 340px;font-size: 20px;font-weight: bold">{{ TitlesDrawings }}</span>
<div id="myChart7" style="width: 1500px; height: 800px; margin-bottom: 20px; margin-top: 20px"/>
</el-card>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
data() {
return {
pickerOptions: {
shortcuts: [{
text: '本月',
onClick(picker) {
picker.$emit('pick', [new Date(), new Date()])
}
}, {
text: '今年至今',
onClick(picker) {
const end = new Date()
const start = new Date(new Date().getFullYear(), 0)
picker.$emit('pick', [start, end])
}
}, {
text: '最近六个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 6)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 12)
picker.$emit('pick', [start, end])
}
}, {
text: '最近两年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 24)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三年',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setMonth(start.getMonth() - 36)
picker.$emit('pick', [start, end])
}
}]
},
TitlesDrawings: '精工车间月度工时统计趋势图',
selectionTimeValue: ''
}
},
methods: {
getProductItemValue1() {
if (this.selectionTimeValue) {
var param = []
param[0] = ['开始时间', this.selectionTimeValue[0]]
param[1] = ['结束时间', this.selectionTimeValue[1]]
var Data = this.CreateData('11', 'jy_车间月度工时统计_查询', param)
this.ExecDatabase(Data).then(response => {
this.xdata = []
this.y1data = []
this.y2data = []
this.y3data = []
if (response.data.length > 0) {
for (let i = 0; i < response.data.length; i++) {
this.xdata.push(response.data[i].日期)
this.y1data.push(response.data[i].精工车间)
this.y2data.push(response.data[i].通用装配)
this.y3data.push(response.data[i].专机装配)
if (!this.downdate) { this.downdate = 0 }
}
}
}).then(() => {
this.drawLine()
})
} else {
this.$message.warning('请先选择时间')
}
},
drawLine() {
var chartDom = document.getElementById('myChart7')
var myChart7 = echarts.init(chartDom)
var option
option = {
color: ['rgb(169, 202, 232)', '#f40', 'rgb(100, 20, 232)'],
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: this.xdata
},
yAxis: {
type: 'value'
},
series: [{
symbol: 'none',
name: '精工车间',
type: 'line',
itemStyle: {
normal: {
label: {
show: true
},
lineStyle: {
width: 2,
color: 'rgb(169,202,232)'
}
}
},
data: this.y1data
}
],
legend: {
symbol: 'none',
data: ['精工车间'],
x: 'center',
y: 'bottom'
}
}
option && myChart7.setOption(option)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,50 @@
<template>
<div>
<el-card>
<ProductPricing ref="fresh"/>
<OrderTrend ref="fresh"/>
<RegionalSales ref="fresh"/>
<ProportionOfProducts ref="fresh"/>
<ProductCategory ref="fresh"/>
<WorkingHoursStatistics ref="fresh"/>
</el-card>
</div>
</template>
<script>
import ProductPricing from '@/views/SalesManagement/StatisticalAnalysis/ProductPricing'
import OrderTrend from '@/views/SalesManagement/StatisticalAnalysis/OrderTrend'
import RegionalSales from '@/views/SalesManagement/StatisticalAnalysis/RegionalSales'
import ProportionOfProducts from '@/views/SalesManagement/StatisticalAnalysis/ProportionOfProducts'
import ProductCategory from '@/views/SalesManagement/StatisticalAnalysis/ProductCategory'
import EquipmentUtilization from '@/views/SalesManagement/StatisticalAnalysis/EquipmentUtilization'
import WorkingHoursStatistics from '@/views/SalesManagement/StatisticalAnalysis/WorkingHoursStatistics'
import { mapGetters } from 'vuex'
export default {
components: {
'ProductPricing': ProductPricing,
'OrderTrend': OrderTrend,
'RegionalSales': RegionalSales,
'ProportionOfProducts': ProportionOfProducts,
'ProductCategory': ProductCategory,
'EquipmentUtilization': EquipmentUtilization,
'WorkingHoursStatistics': WorkingHoursStatistics
},
data() {
return {}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'id'
])
},
methods: {}
}
</script>
<style scoped>
</style>