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

View File

@@ -0,0 +1,248 @@
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select v-model="customerNameValue" style="width:200px" placeholder="买方名称" size="small" filterable clearable>
<el-option
v-for="item in customerName"
: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="结束日期"/>
<el-select v-model="contractStateValue" style="width:100px;margin-left: 10px" placeholder="合同状态" size="small" filterable clearable>
<el-option
v-for="item in contractState"
: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>
<el-button type="success" plain icon="el-icon-download" size="small" @click="exportExcel()">导出</el-button>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 100%" height="750" @sort-change="sortChange">
<el-table-column label="状态" align="center" prop="状态" sortable="custom" width="80px">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.合同编号 }}
</template>
</el-table-column>
<el-table-column label="买方名称" align="center" width="150px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
<el-table-column label="合同金额(元)" align="center" prop="合同金额" width="140px">
<template slot-scope="scope">
{{ scope.row.合同金额 }}
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" width="130px">
<template slot-scope="scope">
{{ scope.row.付款方式 }}
</template>
</el-table-column>
<el-table-column label="交货日期" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.交货日期 }}
</template>
</el-table-column>
<el-table-column label="合同备注" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.合同备注 }}
</template>
</el-table-column>
<el-table-column label="经手人" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.经手人 }}
</template>
</el-table-column>
<el-table-column label="签订日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.签订日期 }}
</template>
</el-table-column>
<el-table-column label="提交日期" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.提交日期 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="查看合同订单" placement="top">
<el-button type="text" icon="el-icon-search" size="mini" style="margin-right: 10px" @click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="打回合同" placement="top">
<el-button type="text" icon="el-icon-right" size="mini" style="margin-right: 10px" @click="deleteProduct(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="删除合同" placement="top">
<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteProduct(scope.row)"/>
</el-tooltip>
</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-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
contractState: [
{
value: 2,
label: '未提交'
}, {
value: 1,
label: '提交'
}
], // 合同状态数组
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.fetchData()
},
methods: {
fetchData() {
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].客户流水号
})
}
})
},
/* exportExcel() {
if (this.tableData.length !== 0) {
let check, check1, check2, check3
this.dateRange ? check3 = 1 : (check3 = 0, this.dateRange = '')
this.supplierNameValue ? check = 1 : check = 0
this.partNumber ? check1 = 1 : check1 = 0
if (this.MaterialsValue !== '' && this.MaterialsValue !== null) {
check2 = 1
} else {
check2 = 0
}
var param = []
param[0] = ['供应商流水号_check', check]
param[1] = ['供应商流水号', this.supplierNameValue]
param[2] = ['零件图号_check', check1]
param[3] = ['零件图号', this.partNumber]
param[4] = ['备料状态_check', check2]
param[5] = ['备料状态', this.MaterialsValue]
param[6] = ['下单时间_check', check3]
if (check3 === 0) {
param[7] = ['开始时间', '']
param[8] = ['结束时间', '']
} else {
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
}
param[9] = ['排序名称', this.ordername]
param[10] = ['排序方式', this.order]
param[11] = ['角色编号', this.token]
param[12] = ['人员编号', this.id]
var Data = this.CreateData('2001', '报表_备料管理_外购备料_综合查询数据', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},*/
searchTable() {
let customerNameValue_check, dateRange_check, contractStateValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
console.log(this.contractStateValue, 123)
this.contractStateValue ? contractStateValue_check = 1 : contractStateValue_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', contractStateValue_check]
param[6] = ['合同状态', this.contractStateValue]
param[7] = ['排序名称', this.orderName]
param[8] = ['排序方式', this.order]
var Data = this.CreateData('11', 'PDM_项目名称_全部_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = 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.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,548 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<!--{{ $t('m.music') }}-->
<el-input v-model="materialName" style="width: 150px " size="small" clearable placeholder="物料名称"/>
<el-input v-model="specificationsModel" style="width: 150px " size="small" clearable placeholder="图号或型号"/>
<el-input v-model="LocationName" style="width: 100px " size="small" clearable placeholder="库位"/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="pageCurrent=1;searchTable()">查询</el-button>
<el-button type="distribution" size="small" @click="addMaterial()">增加物料存货</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="Pronters()">批量打印</el-button>
<!--<el-button type="distribution" size="small" @click="addProduct()">增加通用存货</el-button>-->
</div>
<div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1421px"
height="740px"
@selection-change="handleSelectionChange"
@sort-change="sortChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="140px" label="物料编码" align="center" sortable="物料码" prop="物料码">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="165px" label="物料名称" align="center" sortable="物料名称" prop="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="160px" 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="140px" label="库存数" align="center" sortable="库存" prop="库存">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input-number v-model="scope.row.库存" :min="0" style="width:100%" clearable size="mini" />
</template>
<span v-else>{{ scope.row.库存 ? Number(scope.row.库存).toFixed(2) : 0 }}</span>
</template>
</el-table-column>
<el-table-column width="90" label="库位" align="center" sortable="货位名称" prop="货位名称">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column 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.编辑人 }}
</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="120px" label="打印条码数" align="center">
<template slot-scope="scope">
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
</template>
</el-table-column>
<el-table-column widht="120px" label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
</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="dialogFormVisible1" title="增加物料" center style="min-height: 300px;" width="690px">
<el-row style="margin-bottom: 10px">
<span>名称</span>
<el-input v-model="materialName1" placeholder="名称" style="width: 200px" size="small" clearable/>
<span>图号或型号</span>
<el-input v-model="materialSpec" placeholder="图号或型号" style="width: 200px" size="small" clearable/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="pageCurrent1=1;pageSize1=10;total1=0;searchMaterial()">查询</el-button>
</el-row>
<el-table :data="tableData1" :header-cell-style="{background: '#383E4B',color: 'white'}" size="mini" style="width: 97%;max-height: 300px;margin-top:15px" height="400px" border highlight-current-row @row-click="selectNewMaterial">
<el-table-column align="center" label="名称">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号或型号">
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
:pager-count="5"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<div>
<!-- <el-select v-model="Location" size="small" style="width: 150px" clearable placeholder="请选择库位">-->
<!-- <el-option-->
<!-- v-for="item in storageLocation"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<el-input-number v-model="Warehousing" clearable size="small" style="width:150px" placeholder="请输入入库数"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible1=false">取消</el-button>
<el-button type="primary" size="small" @click="submitMaterialChange">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="增加产品" center width="390px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="产品名称:" prop="产品名称">
<el-select v-model="form.产品名称" size="small" style="width: 200px" clearable filterable placeholder="请选择产品名称">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="库位:" prop="库位">
<el-select v-model="form.库位" size="small" style="width: 200px" clearable filterable placeholder="请选择库位">
<el-option
v-for="item in storageLocation"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="入库数:" prop="入库数">
<el-input-number v-model="form.入库数" :min="1" clearable size="small" style="width:200px" placeholder="请输入入库数"/>
</el-form-item>
</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="submitProduct('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { ExecDatabase } from '@/main'
import { wsuri } from '@/utils/request'
import { mapGetters } from 'vuex'
export default {
data() {
return {
dialogFormVisible: false,
dialogFormVisible1: false,
title: '',
materialName: '',
materialSpec: '',
materialValue: '',
specificationsModel: '',
storageLocation: [],
Warehousing: '',
Location: '',
LocationName: '',
form: {
产品名称: '',
库位: '',
入库数: ''
},
materialName1: '',
productName: [],
editorialStaff: [],
multipleSelection: [],
rules: {
入库数: [{ required: true, message: '请输入入库数' }],
产品名称: [{ required: true, message: '请选择产品名称' }]
// 库位: [{ required: true, message: '请选择库位' }]
},
loading: false, // 数据加载
total: 0, // 分页总数
total1: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
pageSize1: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.initWebpack()
this.searchTable()
this.getProduct()
this.getLocateName()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
Pronter(row) {
let sendMessage
sendMessage = 'TOCS??JY_Warehouse?PDA~'
sendMessage = sendMessage + row.打印条码数 + this.getWord(row.打印条码数, row.物料名称, row.批次编号, row.货位名称)
this.websock.send(sendMessage)
},
Pronters() {
if (this.multipleSelection.length !== 0) {
let sendMessage, word, number
sendMessage = 'TOCS??JY_Warehouse?PDA~'
word = ''
number = 0
for (let i = 0; i < this.multipleSelection.length; i++) {
word = word + this.getWord(this.multipleSelection[i].打印条码数, this.multipleSelection[i].物料名称, this.multipleSelection[i].批次编号, this.multipleSelection[i].货位名称)
number = number + Number(this.multipleSelection[i].打印条码数)
}
sendMessage = sendMessage + number + word
this.websock.send(sendMessage)
} else {
this.$message.warning('请选择要打印的物料')
}
},
getWord(number, name, val, location) {
let word
word = ''
for (let i = 0; i < number; i++) {
word = word + '~JY_Batch|BarCode^Code0^' + val + '|TEXT^TEXT0^' + location + '|TEXT^TEXT1^' + name + '|TEXT^TEXT2^' + val
}
return word
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// // 数据接收
// websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
// },
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
sortChange(column) {
if (column.prop === '物料码') {
this.orderName = 1
} else if (column.prop === '物料名称') {
this.orderName = 2
} else if (column.prop === '图号或型号') {
this.orderName = 3
} else if (column.prop === '库存') {
this.orderName = 4
} else if (column.prop === '货位名称') {
this.orderName = 5
} else if (column.prop === '批次') {
this.orderName = 6
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
getProduct() {
var param = []
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].产品流水号
})
}
})
},
getLocateName() {
var param = []
var Data = this.CreateData('11', '仓储管理_库位_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.storageLocation.push({
label: response.data[i].货位名称,
value: response.data[i].货位流水号
})
}
})
},
searchTable() {
this.loading = true
this.tableData = []
let materialName_check, specificationsModel_check, LocationName_check
this.materialName ? materialName_check = 1 : materialName_check = 0
this.specificationsModel ? specificationsModel_check = 1 : specificationsModel_check = 0
this.LocationName ? LocationName_check = 1 : LocationName_check = 0
var param = []
param[0] = ['物料名称_check', materialName_check]
param[1] = ['物料名称', this.materialName]
param[2] = ['图号或型号_check', specificationsModel_check]
param[3] = ['图号或型号', this.specificationsModel]
param[4] = ['库位_check', LocationName_check]
param[5] = ['库位', this.LocationName]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param, this.pageSize, this.pageCurrent)
ExecDatabase(Data).then(response => {
// console.log(response.data)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.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].编辑时间,
库存_before: response.data.rows[i].库存,
打印条码数: 1,
edit: false
})
}
}
this.total = response.data.total
this.loading = false
})
},
addMaterial() {
this.tableData1 = []
this.materialValue = ''
this.materialName1 = ''
this.materialSpec = ''
this.Location = ''
this.Warehousing = ''
this.dialogFormVisible1 = true
},
addProduct() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form = {}
this.dialogFormVisible = true
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
searchMaterial() {
this.materialValue = ''
let materialName_check, materialSpec_check
this.materialName1 ? materialName_check = 1 : materialName_check = 0
this.materialSpec ? materialSpec_check = 1 : materialSpec_check = 0
var param = []
param[0] = ['名称_check', materialName_check]
param[1] = ['名称', this.materialName1]
param[2] = ['代号_check', materialSpec_check]
param[3] = ['代号', this.materialSpec]
var Data = this.CreateData('11', '物料信息_查询', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
console.log(response.data.rows)
})
},
selectNewMaterial(row) {
this.materialValue = row.物料流水号
this.Location = row.货位流水号
},
submitMaterialChange() {
if (this.materialValue) {
if (this.Warehousing) {
var param = []
param[0] = ['物料流水号', this.materialValue]
param[1] = ['货位流水号', this.Location]
var Data = this.CreateData('11', '仓储管理_库存盘点_物料货位数量_增加数据_验证是否存在', param)
this.ExecDatabase(Data).then(response => {
console.log(response.data, 22222)
if (Number(response.data[0].条数) > 0) {
this.$message.warning('增加物料已存在列表中')
} else {
var param = []
param[0] = ['物料流水号', this.materialValue]
param[1] = ['货位流水号', this.Location]
param[2] = ['货位存量', this.Warehousing]
param[3] = ['操作者', this.id]
var Data = this.CreateData('12', '仓储管理_库存盘点_物料货位数量_增加数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.dialogFormVisible1 = false
this.searchTable()
} else {
this.$message.error('增加失败')
}
})
}
})
} else {
this.$message.warning('请输入货位存量')
}
// else {
// this.$message.warning('请选择库位')
// }
} else {
this.$message.warning('请选择物料')
}
},
submitProduct(formName) {
var param = []
param[0] = ['产品流水号', this.form.产品名称]
param[1] = ['库位', this.form.库位]
var Data = this.CreateData('11', '仓储管理_库存盘点_产品货位数量_增加数据_验证是否存在', param)
this.ExecDatabase(Data).then(response => {
if (Number(response.data[0].条数) > 0) {
this.$message.warning('增加通用产品已存在列表中')
} else {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['产品流水号', this.form.产品名称]
param[1] = ['库位', this.form.库位]
param[2] = ['入库数', this.form.入库数]
param[3] = ['操作者', 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.dialogFormVisible = false
} else {
this.$message.error('添加失败')
}
})
}
})
}
})
},
confirmEdit(row) {
var param = []
param[0] = ['物料与货位流水号', row.物料与货位流水号]
param[1] = ['原数量', row.库存_before]
param[2] = ['更改后数量', row.库存]
param[3] = ['操作者', this.id]
param[4] = ['类型', 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('编辑失败')
}
})
},
// 取消编辑
cancelEdit(index, row) {
row.edit = false
row.库存 = row.库存_before
this.$message('取消修改')
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchMaterial()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchMaterial()
}
}
}
</script>

View File

@@ -0,0 +1,536 @@
<template>
<div class="app-container">
<el-card style="height: 850px;padding: 0 0 0 10px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input
v-model="materialNameTypeValue"
style="width:200px"
placeholder="物料名称"
size="small"
clearable
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-input
v-model="materialTypeValue"
style="width:200px"
placeholder="图号型号"
size="small"
clearable
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-select
v-model="materialType"
style="width:200px;"
placeholder="类型"
size="small"
filterable
clearable
@change="searchTable()">
<el-option
v-for="item in typeArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="locationWarehouseValue"
style="width:200px"
placeholder="库位"
size="small"
clearable
@keyup.enter.native="pageCurrent=1;searchTable()"/>
<el-button
type="primary"
plain
icon="el-icon-search"
size="small"
style="margin-left: 15px"
@click="pageCurrent=1;searchTable()">查询
</el-button>
<el-button type="success" plain icon="el-icon-search" size="small" style="margin-left: 15px" @click="upDate()">
更新
</el-button>
<el-button
v-show="Number(token)===7 || Number(token)===8 || Number(token)===2 || Number(token)===21"
type="success"
plain
icon="el-icon-download"
size="small"
style="margin-left: 580px"
@click="exportExcel()">导出
</el-button>
</div>
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table1"
:data="tableData1"
:reserve-selection="true"
:row-key="row => row.物料流水号"
highlight-current-row
show-summary
border
size="small"
style="width:1622px"
height="740px"
@cell-click="handleEdit"
@sort-change="sortChange">
<el-table-column type="expand" width="1">
<template slot-scope="scope">
<el-table
v-loading="loading"
ref="table"
:data="tableData9"
highlight-current-row
border
stripe
style="width:812px"
height="258px"
size="small">
<el-table-column label="物料编号" align="center" prop="物料码">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="170px" label="物料名称" align="center" prop="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="150px" label="图号/型号" align="center" prop="图号" show-overflow-tooltip>
<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 width="100px" label="/入库数" align="center" 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>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[5, 10, 20, 30, 40, 100]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges1"
@current-change="handleCurrentChanges1"/>
</div>
</template>
</el-table-column>
<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="库位" sortable="库位" prop="库位" align="center">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="库存" sortable="库存" prop="库存" 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.加工中 }}-->
<span v-text="scope.row.加工中 < 0 ? 0 : 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 v-if="Number(token) === 2" :width="setColumnWidth('数量')" label="毛坯补货" align="center">
<template slot-scope="scope">
{{ scope.row.补货毛坯 }}
</template>
</el-table-column>
<el-table-column v-if="Number(token) === 2" :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="待入库" prop="预库存" align="center">
<template slot-scope="scope">
{{ scope.row.预库存 }}
</template>
</el-table-column>
<el-table-column
v-if="Number(token)===7 || Number(token)===8 || Number(token)===2"
width="120px"
label="最低库存"
align="center"
sortable="最低库存"
prop="最低库存">
<template slot-scope="scope">
{{ scope.row.最低库存 }}
</template>
</el-table-column>
<el-table-column
v-if="Number(token)===7 || Number(token)===8 || Number(token)===2"
width="180px"
label="操作"
align="center">
<template slot-scope="scope">
<el-button
type="text"
icon="el-icon-edit"
size="mini"
style="margin-right: 10px"
@click="openStock(scope.row)">最低库存
</el-button>
<el-popover placement="right" width="500" trigger="click">
<el-table
:data="gridData"
:header-cell-style="{background: '#19466E',color: 'white'}"
border
highlight-current-row
size="mini"
show-summary>
<el-table-column width="50" align="center" type="index" label="批次"/>
<el-table-column min-width="100" align="center" label="批次编号">
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="批次库存" prop="货位存量">
<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>
<el-button
slot="reference"
type="text"
icon="el-icon-search"
size="mini"
@click="showDelivery(scope.row)">批次
</el-button>
</el-popover>
</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-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="最低库存" center width="300px">
<el-form ref="form" :model="form">
<el-form-item prop="最低库存">
<el-input-number
v-model="form.最低库存"
:min="0"
:step="1"
size="small"
clearable
style="width:200px;margin-left: 25px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff()">取 消</el-button>
<el-button type="primary" @click="submitStock()">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
materialSerialNumber: '',
locationWarehouseValue: '', // 库位
gridData: [],
materialNameTypeValue: '',
materialTypeValue: '',
materialType: '',
typeValue: '', // 类型
typeNameValue: '',
typeArray: [{
value: '采购件',
label: '采购件'
}, {
value: '自制件',
label: '自制件'
}],
stockValue: '', // 累计库存流水号
minimumStock: '', // 最低库存
loading: false, // 数据加载
loading1: false, // 数据加载
dialogFormVisible: false,
form: {
最低库存: ''
},
total: 0, // 分页总数
total1: 0, // 分页总数
tableData1: [], // 合同信息表
tableData9: [],
pageCurrent: 1, // 分页当前页
pageSize: 30, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
pageSize1: 30, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
watch: {
'$route': {
handler(route) {
this.typeNameValue = this.$route.query.类型
console.log(this.typeNameValue, this.$route.query.类型)
this.searchTable()
},
immediate: true
}
},
updated() {
this.$nextTick(() => {
this.$refs['table1'].doLayout()
})
},
created() {
this.searchTable()
},
methods: {
upDate() {
var param = []
var Data = this.CreateData('12', '物料管理_补货中更新', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('更新成功')
} else {
this.$message.error('更新失败')
}
})
},
handleSizeChanges1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable2()
},
handleCurrentChanges1(val) {
this.pageCurrent1 = val
this.searchTable2()
},
searchTable2() {
var param = []
param[0] = ['物料流水号', this.materialSerialNumber]
var Data = this.CreateData('11', '库存查询_物料出入库记录_查询', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
console.log('response.data', response.data)
this.tableData9 = response.data.rows
this.total1 = response.data.total
})
},
handleEdit(row, column) {
if (column.label === '物料编号') {
this.materialSerialNumber = row.物料流水号
this.tableData9 = []
this.searchTable2()
const $table = this.$refs.table1
this.tableData1.map(item => {
if (row.物料流水号 !== item.物料流水号) {
$table.toggleRowExpansion(item, false)
}
})
$table.toggleRowExpansion(row)
}
},
searchTable() {
let materialNameTypeValue_check, locationWarehouseValue_check, materialTypeValue_check, materialType_check
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
this.materialTypeValue ? materialTypeValue_check = 1 : materialTypeValue_check = 0
this.materialType ? materialType_check = 1 : materialType_check = 0
this.locationWarehouseValue ? locationWarehouseValue_check = 1 : locationWarehouseValue_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['图号_check', materialTypeValue_check]
param[3] = ['图号', this.materialTypeValue]
param[4] = ['库位_check', locationWarehouseValue_check]
param[5] = ['库位', this.locationWarehouseValue]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', this.order]
param[8] = ['类型_check', materialType_check]
param[9] = ['类型', this.materialType]
var Data = this.CreateData('11', '仓储管理_库存查询_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total = response.data.total
})
},
exportExcel() {
if (this.tableData1.length !== 0) {
let materialNameTypeValue_check, locationWarehouseValue_check
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
this.locationWarehouseValue ? locationWarehouseValue_check = 1 : locationWarehouseValue_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['库位_check', locationWarehouseValue_check]
param[3] = ['库位', this.locationWarehouseValue]
param[4] = ['排序名称', this.orderName]
param[5] = ['排序方式', this.order]
var Data = this.CreateData('2001', '报表_仓储管理_通用库存_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
sortChange(column) {
if (column.prop === '物料编码') {
this.orderName = 1
} else if (column.prop === '物料名称') {
this.orderName = 2
} else if (column.prop === '库位') {
this.orderName = 3
} else if (column.prop === '库存') {
this.orderName = 4
} else if (column.prop === '最低库存') {
this.orderName = 5
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
openStock(row) {
this.typeValue = row.类型流水号
this.stockValue = row.累计库存流水号
this.form.最低库存 = Number(row.最低库存)
this.dialogFormVisible = true
},
callOff() {
this.dialogFormVisible = false
},
showDelivery(row) {
var param = []
param[0] = ['物料流水号', row.物料流水号]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param)
this.ExecDatabase(Data).then(response => {
this.gridData = response.data
})
},
submitStock() {
if (this.form.最低库存 !== '' && this.form.最低库存 !== undefined) {
var param = []
param[0] = ['累计库存流水号', this.stockValue]
param[1] = ['类型流水号', this.typeValue]
param[2] = ['最低库存', this.form.最低库存]
var Data = this.CreateData('12', '最低库存_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable()
this.dialogFormVisible = false
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
}
})
} else {
this.$message.warning('不能为空')
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-card__body {
padding: 0px !important;
}
</style>

View File

@@ -0,0 +1,159 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<el-input v-model="production" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="物料名称/编号/规格/型号" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable()"/>
<span style="font-size: 17px;color: black ; margin-left: 24px">时间</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=20;searchTable()"/>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 40px" @click="exportExcel()">导出</el-button>
</div>
<div style="margin-top: 10px">
<el-table v-loading="loading" ref="table" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 971px" height="740px">
<el-table-column width="70px" label="序号" type="index" align="center"/>
<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="140px" label="图号/型号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
<el-table-column width="47px" 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="90px" 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 label="修改时间" align="center">
<template slot-scope="scope">
{{ 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 {
dateRange: '', // 提交日期
production: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
methods: {
// 导出表 8.10
exportExcel() {
if (this.tableData.length !== 0) {
let dateRange_check, production_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('2001', '报表_仓储管理_盘点记录_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
searchTable() {
let dateRange_check, production_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[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
})
},
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="LocationName" style="width: 200px " size="small" clearable placeholder="库位"/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button>
<el-button type="distribution" size="small" @click="addLocation()">增加库位</el-button>
<el-button v-show="true" type="success" plain size="small" @click="Pronters()">批量打印</el-button>
</div>
<div>
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 411px"
height="740px"
@row-dblclick="changeState"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
<el-table-column label="库位" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.货位名称" style="width:100%" clearable size="mini" />
</template>
<span v-else>{{ scope.row.货位名称 }}</span>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('操作')" label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-else type="text" size="mini" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
</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 width="390px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="库位:" prop="库位">
<el-input v-model="form.库位" clearable size="small" style="width:200px" placeholder="请输入库位"/>
</el-form-item>
</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="submitLocation('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { ExecDatabase } from '@/main'
import { mapGetters } from 'vuex'
import { wsuri } from '@/utils/request'
export default {
data() {
return {
dialogFormVisible: false,
Location: '',
LocationName: '',
form: {
库位: ''
},
multipleSelection: [],
materialName1: '',
productName: [],
editorialStaff: [],
rules: {
库位: [{ required: true, message: '请输入库位' }]
},
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
// this.searchData()
this.searchTable()
this.initWebpack()
},
methods: {
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
// searchData() {
// let LocationName_check
// this.LocationName ? LocationName_check = 1 : LocationName_check = 0
// var param = []
// param[0] = ['库位_check', LocationName_check]
// param[1] = ['库位', this.LocationName]
// var Data = this.CreateData('11', '仓储管理_库位_查询_打印用', param)
// ExecDatabase(Data).then(response => {
// this.tableData1 = response.data
// console.log(this.tableData1, 123)
// })
// },
handleSelectionChange(val) {
this.multipleSelection = val
},
Pronters() {
if (this.multipleSelection.length === 0) {
this.$message.warning('请勾选要打印的库位码!')
}
let sendMessage, word, number
sendMessage = 'TOCS??JY_Warehouse?PDA~'
word = ''
number = 0
for (let i = 0; i < this.multipleSelection.length; i++) {
word = word + this.getWord(1, this.multipleSelection[i].货位名称, this.multipleSelection[i].货位名称)
number = number + 1
}
sendMessage = sendMessage + number + word
this.websock.send(sendMessage)
},
getWord(number, name, val) {
let word
word = ''
for (let i = 0; i < number; i++) {
word = word + '~JY_Location|QR_Code^Code0^' + val + '|TEXT^TEXT0^' + name
}
return word
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// 数据接收
websocketonmessage(msg) {
this.partNumberP = msg.data.split('|')[3]
this.partNumber = this.partNumberP.slice(1)
this.getscantable(this.partNumber)
},
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
searchTable() {
this.loading = true
this.tableData = []
let LocationName_check
this.LocationName ? LocationName_check = 1 : LocationName_check = 0
var param = []
param[0] = ['库位_check', LocationName_check]
param[1] = ['库位', this.LocationName]
var Data = this.CreateData('11', '仓储管理_库位_查询', param, this.pageSize, this.pageCurrent)
ExecDatabase(Data).then(response => {
// console.log(response.data)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({
// 表示将从数据库中查询到的数据,分别对应填充到表格中
货位流水号: response.data.rows[i].货位流水号,
货位名称: response.data.rows[i].货位名称,
货位名称_before: response.data.rows[i].货位名称,
edit: false
})
}
}
this.total = response.data.total
this.loading = false
})
},
addLocation() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form.库位 = ''
this.dialogFormVisible = true
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
changeState(row) {
row.edit = !row.edit
},
submitLocation(formName) {
var param = []
param[0] = ['库位', this.form.库位]
var Data = this.CreateData('11', '仓储管理_库位_验证是否存在', param)
this.ExecDatabase(Data).then(response => {
if (Number(response.data[0].条数) > 0) {
this.$message.warning('增加的库位已存在列表中')
} else {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['库位', 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.error('添加失败')
}
})
}
})
}
})
},
confirmEdit(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.searchTable()
} else {
this.$message.error('编辑失败')
}
})
},
// 取消编辑
cancelEdit(index, row) {
row.edit = false
row.货位名称 = row.货位名称_before
this.$message('取消修改')
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,246 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="MaterialName" style="width: 200px " size="small" clearable placeholder="物料名称/规格"/>
<el-input v-model="DrawingNo" style="width: 200px " size="small" clearable placeholder="图号/型号"/>
<el-input v-model="locationWarehouseValue" style="width:200px" placeholder="库位" size="small" clearable/>
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button>
<!--<el-button type="distribution" size="small" @click="addLocation()">增加库位</el-button>-->
</div>
<div>
<el-table v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 911px" height="740px" @row-dblclick="changeState">
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
<el-table-column label="物料编号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料编号 }}
</template>
</el-table-column>
<el-table-column label="物料名称" width="170px" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" width="170px" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column label="库位" width="160px" align="center">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-select v-model="scope.row.货位流水号" size="small" style="width: 100%" filterable clearable placeholder="请选择库位">
<el-option
v-for="item in storageLocation"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<span v-else>{{ scope.row.货位名称 }}</span>
</template>
</el-table-column>
<el-table-column width="180px" label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="mini" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" class="cancel-btn" size="mini" type="text" @click="cancelEdit(scope.$index, scope.row)">取消</el-button>
<el-button v-if="!scope.row.edit" type="text" icon="el-icon-edit" size="mini" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
</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 width="390px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="库位:" prop="库位">
<el-input v-model="form.库位" clearable size="small" style="width:200px" placeholder="请输入库位"/>
</el-form-item>
</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="submitLocation('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { ExecDatabase } from '@/main'
import { mapGetters } from 'vuex'
export default {
data() {
return {
locationWarehouseValue: '', // 库位
dialogFormVisible: false,
storageLocation: [],
MaterialName: '',
DrawingNo: '',
LocationName: '',
form: {
库位: ''
},
materialName1: '',
productName: [],
editorialStaff: [],
rules: {
库位: [{ required: true, message: '请输入库位' }]
},
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData10: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.getLocateName()
this.searchTable()
},
methods: {
getLocateName() {
var param = []
param[0] = ['库位_check', 0]
param[1] = ['库位', '']
var Data = this.CreateData('11', '仓储管理_库位_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.storageLocation.push({
label: response.data[i].货位名称,
value: response.data[i].货位流水号
})
}
})
},
searchTable() {
this.loading = true
this.tableData10 = []
let MaterialName_check, DrawingNo_check, locationWarehouseValue_check
this.MaterialName ? MaterialName_check = 1 : MaterialName_check = 0
this.DrawingNo ? DrawingNo_check = 1 : DrawingNo_check = 0
this.locationWarehouseValue ? locationWarehouseValue_check = 1 : locationWarehouseValue_check = 0
var param = []
param[0] = ['物料名称_check', MaterialName_check]
param[1] = ['物料名称', this.MaterialName]
param[2] = ['图号或型号_check', DrawingNo_check]
param[3] = ['图号或型号', this.DrawingNo]
param[4] = ['库位_check', locationWarehouseValue_check]
param[5] = ['库位', this.locationWarehouseValue]
var Data = this.CreateData('11', '仓储管理_物料库位_查询数据', param, this.pageSize, this.pageCurrent)
ExecDatabase(Data).then(response => {
// console.log(response.data)
if (response.data.rows.length !== 0) {
for (let i = 0; i < response.data.rows.length; i++) {
this.tableData10.push({
// 表示将从数据库中查询到的数据,分别对应填充到表格中
货位流水号: Number(response.data.rows[i].货位流水号),
货位名称: response.data.rows[i].货位名称,
物料流水号: response.data.rows[i].物料流水号,
物料名称: response.data.rows[i].名称,
图号或型号: response.data.rows[i].代号,
物料编号: response.data.rows[i].物料编码,
货位名称_before: response.data.rows[i].货位名称,
edit: false
})
}
}
this.total = response.data.total
this.loading = false
}).then(() => {
this.tableData = this.tableData10
})
},
addLocation() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form.库位 = ''
this.dialogFormVisible = true
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
changeState(row) {
row.edit = !row.edit
},
submitLocation(formName) {
var param = []
param[0] = ['库位', this.form.库位]
var Data = this.CreateData('11', '仓储管理_库位_验证是否存在', param)
this.ExecDatabase(Data).then(response => {
if (Number(response.data[0].条数) > 0) {
this.$message.warning('增加的库位已存在列表中')
} else {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['库位', 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.error('添加失败')
}
})
}
})
}
})
},
confirmEdit(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.searchTable()
} else {
this.$message.error('编辑失败')
}
})
},
// 取消编辑
cancelEdit(index, row) {
row.edit = false
row.货位名称 = row.货位名称_before
this.$message('取消修改')
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,233 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<el-input v-model="production" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="物料名称/编号/规格/型号" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable();searchNumber()"/>
<span style="font-size: 17px;color: black ; margin-left: 24px">时间</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=20;searchTable();searchNumber()"/>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 40px" @click="exportExcel()">导出</el-button>
</div>
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:summary-method="getSummaries"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1061px"
height="740px">
<el-table-column width="70px" label="序号" type="index" align="center"/>
<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="140px" label="图号/型号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
<el-table-column width="47px" label="单位" align="center">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column width="110px" label="出库数" align="center" prop="出库数">
<template slot-scope="scope">
{{ scope.row.出库数 }}
</template>
</el-table-column>
<el-table-column width="110px" label="入库数" align="center" prop="入库数">
<template slot-scope="scope">
{{ scope.row.入库数 }}
</template>
</el-table-column>
<el-table-column width="110px" label="库存数" align="center" prop="库存数">
<template slot-scope="scope">
{{ scope.row.库存数 }}
</template>
</el-table-column>
<el-table-column 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>
</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 {
dateRange: '', // 提交日期
production: '',
loading: false, // 数据加载
stockInQuantity: 0, // 入库数
outboundQuantity: 0, // 出库数
inventoryNumber: 0, // 库存数
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
methods: {
// 导出表 8.10
exportExcel() {
if (this.tableData.length !== 0) {
let dateRange_check, production_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('2001', '报表_仓储管理_物料记录_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
searchTable() {
if (this.dateRange) {
let dateRange_check, production_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
// var param = []
// param[0] = ['物料名称_check', production_check]
// param[1] = ['物料名称', this.production]
// param[2] = ['时间_check', dateRange_check]
// param[3] = ['开始时间', this.dateRange[0]]
// param[4] = ['结束时间', this.dateRange[1]]
// param[5] = ['PageCurrent', this.pageCurrent]
// param[6] = ['PageSize', this.pageSize]
// param[7] = ['PageCount', '1111', 'int', '1']
// param[8] = ['ItemCount', '1111', 'int', '1']
// var Data = this.CreateData('11', '仓储管理_物料记录_查询_统计', param)
// this.ExecDatabase(Data).then(response => {
// console.log(response, 6666)
// this.tableData = response.data.result
// this.total = parseInt(response.data.output[0].ItemCount)
// })
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '仓储管理_物料记录_查询新', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log(response, 6666)
this.tableData = response.data.rows
this.total = response.data.total
})
} else {
this.$message.warning('时间不能为空')
}
},
searchNumber() {
let dateRange_check, production_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['时间_check', dateRange_check]
param[3] = ['开始时间', this.dateRange[0]]
param[4] = ['结束时间', this.dateRange[1]]
var Data = this.CreateData('11', '仓储管理_物料记录_查询', param)
this.ExecDatabase(Data).then(response => {
this.stockInQuantity = response.data[0].入库数
this.outboundQuantity = response.data[0].出库数
this.inventoryNumber = response.data[0].库存数
})
},
getSummaries(param) {
const { columns } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 5) {
sums[index] = this.outboundQuantity.toFixed(2)
} else if (index === 6) {
sums[index] = this.stockInQuantity.toFixed(2)
} else if (index === 7) {
sums[index] = this.inventoryNumber.toFixed(2)
}
})
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,954 @@
<template>
<div class="app-container">
<el-card style="height: 1850px;padding: 0">
<el-tabs v-model="PartType" type="border-card">
<el-tab-pane label="生产领料" name="生产领料">
<el-row>
<!--<div style="margin-left: 589px">
<el-button type="distribution" size="small" icon="el-icon-shopping-cart-2" plain @click="materialOut">出库</el-button>
&lt;!&ndash; <el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 760px" @click="exportExcel()">导出</el-button>&ndash;&gt;
</div>-->
<div style="margin-left: 10px">
<el-input v-model="PickingListName" placeholder="领料单号/领料人" style="width: 170px" size="small" clearable/>
<el-button type="primary" size="small" icon="el-icon-search" plain @click="searchTable">查询</el-button>
<el-button type="success" size="small" icon="el-icon-printer" plain @click="exportTable">打印</el-button>
</div>
<el-col style="margin-left: 7px;width: 551px">
<!-- <el-card>-->
<div style="margin-top: 10px;">
<el-table
v-loading="loading"
:data="ProductionPick"
:row-class-name="tableRowClassName"
highlight-current-row
border
size="mini"
style="margin-top: 10px"
height="750"
@row-click="searchTable1">
<el-table-column :width="setColumnWidth('领料单号')" label="领料单号" align="center" show-overflow-tooltip prop="">
<template slot-scope="scope">
{{ scope.row.领料单号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('领料人')" label="领料人" align="center" show-overflow-tooltip 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" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 30px;width: 1011px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
size="mini"
style="width: 1081px;margin-top: 10px"
height="750">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column label="物料名称" align="center" prop="物料名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="130px" label="图号/型号" align="center" prop="图号/型号">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column width="70px" 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="120px" label="本次领用" align="center" prop="本次领用">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.本次领用"
:min="0"
:max="Number(scope.row.申请数)-Number(scope.row.已领数) > Number(scope.row.库存数) ? Number(scope.row.库存数) : Number(scope.row.申请数)-Number(scope.row.已领数)"
size="mini"
style="width:100%"/>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="申请数" align="center" show-overflow-tooltip 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 prop="库存数">
<template slot-scope="scope">
{{ scope.row.库存数 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" label="批次" align="center" show-overflow-tooltip prop="批次">
<template slot-scope="scope">
{{ scope.row.批次 }}
</template>
</el-table-column>
<el-table-column width="136px" label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-popover placement="right" width="535" trigger="click">
<el-table :data="gridData" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号">
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column min-width="140x" label="本次领用" align="center">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.本次领用"
:min="0"
:max="maxNumber > Number(scope.row.货位存量) ? Number(scope.row.货位存量) : maxNumber"
size="mini"
style="width:100%"/>
</template>
</el-table-column>
<el-table-column width="66px" label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-button :disabled="scope.row.本次领用 === 0 || exWarehouse1" type="text" size="mini" @click="confirmDelivery(scope.row)">确认</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent3"
:total="total3"
:page-size="pageSize3"
layout="total, prev, pager, next"
@current-change="handleCurrentChanges3"/>
</div>
<el-button slot="reference" :disabled="scope.row.库存数 === 0 || Number(scope.row.申请数) <= Number(scope.row.已领数) || exWarehouse" type="text" size="mini" @click="showDelivery(scope.row, scope.$index)">
出库
</el-button>
</el-popover>
<el-button :disabled="Number(scope.row.已领数) > 0 || !orderNumber" type="text" size="mini" style="margin-left: 20px" @click="handleReturn(scope.row)">退回</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD" style="width: 840px;margin: 0 auto">
<div style="width: 180px;margin: 0 auto 20px">
<!-- 调整这一个即可解决 打印出来表头布局中的问题-->
<h3>浙江景耀数控出库单</h3>
</div>
<div style="margin: 0 0 10px">
<span style="margin-left: 10px;font-size: 14px">领料单号{{ PickingNo }}</span>
<span style="float: right; font-size: 14px;margin-right: 10px">订单号{{ orderNumberFloat }}</span>
</div>
<div style="margin: 0 0 10px">
<span style="margin-left: 10px;font-size: 14px">领料人{{ pickPeople }}</span>
<span style="float: right; font-size: 14px;margin-right: 10px">产品部件{{ productName }}</span>
</div>
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">物料名称</td>
<td colspan="3" style="text-align: center;width: 22%;font-size: 14px">规格型号</td>
<td colspan="1" style="text-align: center;width: 12%;font-size: 14px">库位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">申请数</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">已领数</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">库存数</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">批次</td>
</tr>
<tr v-for="(list, index) in tableData" :key="index" style="height: 35px">
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">{{ list.物料名称 }}</td>
<td colspan="3" style="text-align: center;width: 22%;font-size: 14px">{{ list.图号或型号 }}</td>
<td colspan="1" style="text-align: center;width: 12%;font-size: 14px">{{ list.货位名称 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.申请数 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.已领数 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.库存数 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.批次 }}</td>
</tr>
<!--<tr style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">合计</td>
<td colspan="17" style="text-align: center;width: 85%">
<div>
<span style="float: right;margin-right: 24%;font-size: 14px">{{ Number(totalAmount) }}</span>
</div>
</td>
</tr>-->
</table>
</div>
</el-card>
</div>
</el-card>
</el-tab-pane>
<el-tab-pane label="耗材" name="耗材">
<el-row>
<el-col style="margin-left: 7px;width: 971px">
<div class="grid-content bg-purple">
<el-input v-model="ConsumableSelect" style="width: 200px" size="small" placeholder="物料名称/规格/型号" clearable @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable2()"/>
<el-table v-loading="loading" ref="table1" :data="Consumables" highlight-current-row show-summary border size="mini" style="margin-top: 10px" height="710">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column min-width="160px" label="物料名称" show-overflow-tooltip align="center" prop="">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="160px" 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 prop="库存">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column width="260px" label="备注" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column width="171px" label="操作" align="center">
<template slot-scope="scope">
<el-popover placement="right" width="880px" trigger="click">
<el-table :data="gridData1" :header-cell-style="{background: '#19466E',color: 'white'}" border highlight-current-row size="mini" show-summary>
<el-table-column width="50px" align="center" type="index" label="序号"/>
<el-table-column width="150px" align="center" label="批次编号">
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column width="100px" align="center" label="批次库存" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column width="140x" label="本次领用" align="center">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.本次领用"
:min="0"
:max="Number(scope.row.货位存量)"
size="mini"
style="width:100%"/>
</template>
</el-table-column>
<el-table-column width="140x" label="领用人" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.领用人" style="width:100%" placeholder="领用人" size="small" filterable clearable>
<el-option
v-for="item in takenPerson"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column width="140x" label="备注" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.备注"
size="mini"
style="width:100%"/>
</template>
</el-table-column>
<el-table-column width="70px" label="操作" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-button :disabled="scope.row.本次领用 === 0 || exWarehouse3" type="text" size="mini" @click="Delivery(scope.row)">确认</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent4"
:total="total4"
:page-size="pageSize4"
layout="total, prev, pager, next"
@current-change="handleCurrentChanges4"/>
</div>
<el-button slot="reference" :disabled="scope.row.库存数 === 0 || exWarehouse2" type="text" size="mini" @click="showDelivery1(scope.row)">
出库
</el-button>
</el-popover>
<el-button type="text" size="mini" style="margin-left: 10px" @click="showRemark(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>
</div>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="备注" center width="440px">
<el-form label-position="center" label-width="110px" class="demo-ruleForm">
<el-form-item label="备注" prop="备注">
<el-input v-model="remark" style="width:200px" placeholder="备注" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible2=false">取消</el-button>
<el-button type="distribution" size="small" @click="submitA()">确定</el-button>
</div>
</el-dialog>
<!-- <el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="物料出库" center width="440px">-->
<!-- <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="物料名称">-->
<!-- <el-input-->
<!-- v-model="materialName"-->
<!-- size="small"-->
<!-- readonly-->
<!-- style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="领用数量" prop="领用数量">-->
<!-- <el-input-number-->
<!-- v-model="form.领用数量"-->
<!-- :min="1"-->
<!-- :max="stock"-->
<!-- size="small"-->
<!-- style="width:200px"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="领用人" prop="领用人">-->
<!-- <el-select v-model="form.领用人" style="width:200px" placeholder="领用人" size="small" filterable clearable>-->
<!-- <el-option-->
<!-- v-for="item in takenPerson"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<!-- </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>-->
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import $ from 'jquery'
export default {
data() {
return {
returns: [],
exWarehouse: false,
exWarehouse1: false,
exWarehouse2: false,
exWarehouse3: false,
pageCount: 5,
total3: 0, // 分页总数
pageCurrent3: 1, // 分页当前页
pageSize3: 5, // 分页每页显示条数
total4: 0, // 分页总数
pageCurrent4: 1, // 分页当前页
pageSize4: 5, // 分页每页显示条数
PartType: '生产领料',
customerNameValue: '', // 买方名称
customerName: [], // 买方名称数组
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
materialName: '', // 物料名称
materialTool: '', // 图号
pickPeople: '', // 领料人
orderNumberFloat: '', // 订单号
productName: '', // 产品
PickingNo: '', // 领料单号
unit: '', // 单位
Location: '', // 库位
takenPerson: [], // 领用人
type: '',
number: '',
gridData: [],
gridData1: [],
maxNumber: 0,
outIndex: '',
pickMx: '',
processValue: '',
purchaseValue: '',
productValue: '',
groupValue: '',
pickValue: '',
temporaryValue: '',
PickingListName: '',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
remark: '',
form: {
领用数量: '',
领用人: ''
},
rules: {
领用数量: [{ required: true, message: '请输入领用数量', trigger: 'blur' }],
领用人: [{ required: true, message: '请选择领用人', trigger: 'change' }]
},
materialNumber: '',
input: '',
stock: '',
orderNumber: '',
pickingList: '',
isGroup: '',
pickingPeople: '',
materialNumber1: '',
multipleSelection: [],
multipleSelection_variable: [],
loading: false, // 数据加载
loading1: false, // 数据加载
total: 0, // 分页总数
ProductionPick: [], // 生产领料
tableData: [],
Consumables: [], // 耗材
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
ConsumableSelect: '', // 耗材搜索
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
})
},
created() {
this.getCustomer()
this.searchTable()
this.searchTable2()
},
methods: {
showRemark(row) {
this.materialNumber1 = row.物料流水号
this.remark = row.备注
this.dialogFormVisible2 = true
},
submitA() {
var param = []
param[0] = ['物料流水号', this.materialNumber1]
param[1] = ['备注', this.remark]
var Data = this.CreateData('12', '仓储管理_物料备注_修改', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.dialogFormVisible2 = false
this.searchTable2()
} else {
this.$message.error('退回失败')
}
})
},
exportTable() {
if (this.pickingList) {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
} else {
this.$message.warning('请选择要打印的领料单')
}
},
getCustomer() {
var param = []
var Data = this.CreateData('11', '人员信息_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.takenPerson.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
// getData() {
// if (this.PartType === '生产领料') {
// this.searchTable()
// } else if (this.PartType === '耗材') {
// this.searchTable2()
// }
// },
searchTable() {
let check
this.PickingListName ? check = 1 : check = 0
var param = []
param[0] = ['领料单号_check', check]
param[1] = ['领料单号', this.PickingListName]
var Data = this.CreateData('11', '装配管理_未领完领料单_查询', param)
this.ExecDatabase(Data).then(response => {
this.ProductionPick = response.data
})
},
searchTable1(row) {
this.pickingPeople = row.领料人流水号
this.pickingList = row.领料单流水号
this.isGroup = row.是否部件
this.orderNumber = row.订单流水号
this.PickingNo = row.领料单号
this.pickPeople = row.领料人
this.orderNumberFloat = row.订单号
this.productName = row.产品名称
var param = []
param[0] = ['领料单流水号', row.领料单流水号]
var Data = this.CreateData('11', '装配管理_领料单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
handleReturn(row) {
this.$confirm('是否退回物料?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['领料单流水号', this.pickingList]
param[1] = ['领料单明细流水号', row.领料单明细流水号]
param[2] = ['组件流水号', row.组件流水号]
param[3] = ['标准件和外购件流水号', row.标准件和外购件流水号]
param[4] = ['基本件流水号', row.基本件流水号]
param[5] = ['物料流水号', row.物料流水号]
param[6] = ['人员编号', this.id]
var Data = this.CreateData('12', '仓储管理_领料明细_退回', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('退回成功')
var param = []
param[0] = ['领料单流水号', this.pickingList]
var Data = this.CreateData('11', '装配管理_领料单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
} else {
this.$message.error('退回失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
showDelivery(row, index) {
this.maxNumber = row.本次领用
this.outIndex = index
this.pickMx = row.领料单明细流水号
this.processValue = row.基本件流水号
this.purchaseValue = row.标准件和外购件流水号
this.productValue = row.产品流水号
this.groupValue = row.组件流水号
this.pickValue = row.领料流水号
this.temporaryValue = row.临时流水号
this.materialSerialNumber = row.物料流水号
var param = []
param[0] = ['物料流水号', row.物料流水号]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param, this.pageSize3, this.pageCurrent3)
this.ExecDatabase(Data).then(response => {
if (response.data.total === 1) {
this.exWarehouse = true
this.confirmDelivery1(response.data.rows)
console.log(response.data.rows, 2222)
} else {
this.gridData = response.data.rows
this.total3 = response.data.total
}
})
},
confirmDelivery1(row) {
this.exWarehouse1 = true
var param = []
param[0] = ['物料流水号', row[0].物料流水号]
param[1] = ['出库数量', this.maxNumber]
param[2] = ['基本件流水号', this.processValue]
param[3] = ['标准件和外购件流水号', this.purchaseValue]
param[4] = ['领料单明细流水号', this.pickMx]
param[5] = ['产品流水号', this.productValue]
param[6] = ['组件流水号', this.groupValue]
param[7] = ['领料流水号', this.pickValue]
param[8] = ['临时流水号', this.temporaryValue]
param[9] = ['出库人流水号', this.id]
param[10] = ['领料人流水号', this.pickingPeople]
param[11] = ['领料单流水号', this.pickingList]
param[12] = ['是否部件', this.isGroup]
param[13] = ['物料与货位流水号', row[0].物料与货位流水号]
var Data = this.CreateData('12', '仓储管理_物料出库_新', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.exWarehouse = false
this.exWarehouse1 = false
this.tableData = []
var param = []
param[0] = ['领料单流水号', this.pickingList]
var Data = this.CreateData('11', '装配管理_领料单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
if (response.data.length === 0) {
this.searchTable()
} else {
this.maxNumber = this.tableData[this.outIndex].本次领用
}
})
} else {
this.$message.error('出库失败')
this.exWarehouse = false
this.exWarehouse1 = false
}
})
},
confirmDelivery(row) {
this.exWarehouse1 = true
var param = []
param[0] = ['物料流水号', row.物料流水号]
param[1] = ['出库数量', row.本次领用]
param[2] = ['基本件流水号', this.processValue]
param[3] = ['标准件和外购件流水号', this.purchaseValue]
param[4] = ['领料单明细流水号', this.pickMx]
param[5] = ['产品流水号', this.productValue]
param[6] = ['组件流水号', this.groupValue]
param[7] = ['领料流水号', this.pickValue]
param[8] = ['临时流水号', this.temporaryValue]
param[9] = ['出库人流水号', this.id]
param[10] = ['领料人流水号', this.pickingPeople]
param[11] = ['领料单流水号', this.pickingList]
param[12] = ['是否部件', this.isGroup]
param[13] = ['物料与货位流水号', row.物料与货位流水号]
var Data = this.CreateData('12', '仓储管理_物料出库_新', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.exWarehouse = false
this.exWarehouse1 = false
this.tableData = []
var param = []
param[0] = ['领料单流水号', this.pickingList]
var Data = this.CreateData('11', '装配管理_领料单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
if (response.data.length === 0) {
this.searchTable()
} else {
this.maxNumber = this.tableData[this.outIndex].本次领用
}
})
} else {
this.$message.error('出库失败')
this.exWarehouse = false
this.exWarehouse1 = false
}
})
},
selectable(row) {
return row.本次领用 > 0
},
handleSelectionChange(val) {
this.multipleSelection = val
},
/* materialOut() {
if (this.multipleSelection.length !== 0) {
const materialGroup = []
const numberGroup = []
const partGroup = []
const pickNumberGroup = []
const temporaryGroup = []
const purchaseGroup = []
const productGroup = []
const pickGroup = []
const groupGroup = []
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
materialGroup[i] = this.multipleSelection_variable[i].物料流水号
numberGroup[i] = this.multipleSelection_variable[i].本次领用
partGroup[i] = this.multipleSelection_variable[i].基本件流水号
pickNumberGroup[i] = this.multipleSelection_variable[i].领料流水号
temporaryGroup[i] = this.multipleSelection_variable[i].临时流水号
purchaseGroup[i] = this.multipleSelection_variable[i].标准件和外购件流水号
productGroup[i] = this.multipleSelection_variable[i].产品流水号
pickGroup[i] = this.multipleSelection_variable[i].领料单明细流水号
groupGroup[i] = this.multipleSelection_variable[i].组件流水号
}
var param = []
param[0] = ['物料流水号组', materialGroup]
param[1] = ['出库数量组', numberGroup]
param[2] = ['基本件流水号组', partGroup]
param[3] = ['标准件和外购件流水号组', purchaseGroup]
param[4] = ['领料单明细流水号组', pickGroup]
param[5] = ['产品流水号组', productGroup]
param[6] = ['组件流水号组', groupGroup]
param[7] = ['领料流水号组', pickNumberGroup]
param[8] = ['临时流水号组', temporaryGroup]
param[9] = ['出库人流水号', this.id]
param[10] = ['领料人流水号', this.pickingPeople]
param[11] = ['领料单流水号', this.pickingList]
param[12] = ['是否部件', this.isGroup]
var Data = this.CreateData('12', '仓储管理_出库', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.searchTable()
this.tableData = []
var param = []
param[0] = ['领料单流水号', this.pickingList]
var Data = this.CreateData('11', '装配管理_领料单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
} else {
this.$message.error('出库失败')
}
})
} else {
this.$message.warning('请选择物料')
}
},*/
searchTable2() {
let check
this.ConsumableSelect ? check = 1 : check = 0
var param = []
param[0] = ['物料名称_check', check]
param[1] = ['物料名称', this.ConsumableSelect]
var Data = this.CreateData('11', '仓储管理_耗材出库_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.Consumables = []
this.Consumables = response.data.rows
this.total = response.data.total
})
},
// 加底色
tableRowClassName1({ row, rowIndex }) {
if (row.申请数 === row.已领数) {
return 'gray'
} else if (Number(row.申请数) - Number(row.已领数) > Number(row.库存数)) {
return 'red'
}
},
Delivery(row) {
this.exWarehouse3 = true
// if (this.$refs['form'] !== undefined) {
// this.$refs['form'].resetFields()
// }
// this.materialName = row.物料名称
// this.form.领用数量 = ''
// this.form.领用人 = ''
// this.number = row.累计库存流水号
// this.type = row.类型流水号
// this.stock = Number(row.库存)
// this.dialogFormVisible = true
if (row.领用人 === null || row.领用人 === '' || row.领用人 === undefined) {
this.$message.error('请选择领用人!!')
this.exWarehouse3 = false
} else if (row.本次领用 === 0) {
this.$message.error('本次领用数不能为空!!')
this.exWarehouse3 = false
} else {
var param = []
param[0] = ['累计库存流水号', this.number]
param[1] = ['类型流水号', this.type]
param[2] = ['领用数量', row.本次领用]
param[3] = ['领料人流水号', row.领用人]
param[4] = ['出库人流水号', this.id]
param[5] = ['物料与货位流水号', row.物料与货位流水号]
param[6] = ['备注', row.备注]
var Data = this.CreateData('12', '仓储管理_耗材出库', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.exWarehouse3 = false
var param = []
param[0] = ['物料流水号', row.物料流水号]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param, this.pageSize3, this.pageCurrent3)
this.ExecDatabase(Data).then(response => {
this.gridData1 = response.data.rows
this.total3 = response.data.total
})
this.searchTable2()
} else {
this.$message.success('出库失败')
this.exWarehouse3 = false
}
})
}
},
// submit(formName) {
// this.$refs[formName].validate((valid) => {
// if (valid) {
// var param = []
// param[0] = ['累计库存流水号', this.number]
// param[1] = ['类型流水号', this.type]
// param[2] = ['领用数量', this.form.领用数量]
// param[3] = ['领料人流水号', this.form.领用人]
// param[4] = ['出库人流水号', this.id]
// param[5] = ['物料与货位流水号', row.物料与货位流水号]
// var Data = this.CreateData('12', '仓储管理_耗材出库', param)
// this.ExecDatabase(Data).then(response => {
// if (response.data[0].result === '1') {
// this.$message.success('出库成功')
// this.searchTable2()
// this.dialogFormVisible = false
// } else {
// this.$message.success('出库失败')
// }
// })
// }
// })
// },
callOff(formName) {
this.form = {}
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.是否部件) === 1) {
return 'is-group'
} else if (row.库存状态 === 1) {
return 'red'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable2()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable2()
},
handleCurrentChanges3(val) {
this.pageCurrent3 = val
this.searchTable3()
},
handleCurrentChanges4(val) {
this.pageCurrent4 = val
var param = []
param[0] = ['物料流水号', this.materialNumber]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param, this.pageSize4, this.pageCurrent4)
this.ExecDatabase(Data).then(response => {
this.gridData1 = response.data.rows
this.total4 = response.data.total
})
},
searchTable3() {
var param = []
param[0] = ['物料流水号', this.materialSerialNumber]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param, this.pageSize3, this.pageCurrent3)
this.ExecDatabase(Data).then(response => {
this.gridData = response.data.rows
this.total3 = response.data.total
})
},
showDelivery1(row) {
this.exWarehouse2 = true
this.number = row.累计库存流水号
this.type = row.类型流水号
this.materialNumber = row.物料流水号
var param = []
param[0] = ['物料流水号', row.物料流水号]
var Data = this.CreateData('11', '装配管理_领料单明细_批次查询', param, this.pageSize4, this.pageCurrent4)
this.ExecDatabase(Data).then(response => {
this.exWarehouse2 = false
this.gridData1 = response.data.rows
this.total4 = response.data.total
})
}
}
}
</script>
<style scoped lang="scss">
/deep/ .el-card__body{
padding: 0px!important;
}
/deep/ .el-table .gray {
background: #bbbbc1 !important;
}
/deep/ .el-table .red {
background: #e88383 !important;
}
</style>
<style>
.el-table .is-group {
background: #FFF582!important;
}
</style>

View File

@@ -0,0 +1,547 @@
<!--外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家-->
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select v-model="selectTheOutsourcingManufacturersValue" style="width:150px;" placeholder="外协厂家" size="small" filterable clearable @change="pageCurrent = 1;pageSize = 100;searchTable()">
<el-option
v-for="item in selectTheOutsourcingManufacturers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partsName" style="width:150px" placeholder="名称/图号" size="small" clearable @keyup.enter.native="pageCurrent = 1;pageSize = 100;searchTable()"/>
<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-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="warning" plain icon="el-icon-plus" size="small" @click="editType('form')">记录</el-button>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 950px" height="750">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column width="150px" 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="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-button type="text" icon="el-icon-edit" size="mini" @click="handleEdit(scope.row)"/>
<el-button type="text" icon="el-icon-top" size="mini" @click="uploadPicture(scope.row)">照片</el-button>
<el-button size="mini" type="text" icon="el-icon-picture-outline" @click="handlePicture(scope.row)"/>
<el-button type="text" icon="el-icon-delete" size="mini" @click="handleDelete(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>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="title" center width="660px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="100px" class="demo-ruleForm">
<el-form-item v-if="title === '增加记录'" label="模具名称" prop="模具名称" style="display: inline-block;">
<el-input v-model="form.模具名称" style="width:180px;display: inline-block" placeholder="双击选择" size="small" readonly @dblclick.native="getMaterial"/>
</el-form-item>
<el-form-item v-if="title === '增加记录'" label="图号或型号" prop="图号或型号" style="display: inline-block;margin-left: 10px">
<el-input v-model="form.图号或型号" style="width:180px;display: inline-block" placeholder="图号或型号" size="small" readonly/>
</el-form-item>
<el-form-item label="外协厂家" prop="外协厂家" style="display: inline-block">
<el-select v-model="form.外协厂家" style="width:180px;display: inline-block" placeholder="外协厂家" size="small" filterable clearable>
<el-option
v-for="item in selectTheOutsourcingManufacturers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="数量" prop="数量" style="display: inline-block;margin-left: -4px">
<el-input-number v-model="form.数量" style="width:180px;display: inline-block;margin-left: 14px" placeholder="数量" size="small" clearable/>
</el-form-item>
<el-form-item label="外协时间" prop="外协时间" style="display: inline-block">
<el-date-picker
v-model="form.外协时间"
size="small"
align="center"
style="width: 180px;display: inline-block"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
<el-form-item label="送回时间" prop="送回时间" style="display: inline-block;;margin-left: 10px">
<el-date-picker
v-model="form.送回时间"
size="small"
align="center"
style="width: 180px;display: inline-block"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="title === '增加记录'" @click="callOff('form')">取消</el-button>
<el-button v-if="title === '增加记录'" type="primary" @click="submit('form')">确定</el-button>
<el-button v-if="title === '编辑记录'" @click="callOff('form')">取消</el-button>
<el-button v-if="title === '编辑记录'" type="primary" @click="submitUpdate('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible5" width="673px">
<el-row style="margin-bottom: 10px">
<span>名称</span>
<el-input v-model="materialName" placeholder="名称" style="width: 170px" size="small" clearable/>
<span>图号/型号</span>
<el-input v-model="materialSpec" placeholder="图号/型号" style="width: 170px" size="small" clearable/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left:10px" @click="pageCurrent1=1;pageSize1=10;total1=0;searchMaterial()">查询</el-button>
</el-row>
<el-table
:data="tableData1"
:header-cell-style="{background: '#383E4B',color: 'white'}"
highlight-current-row
border
stripe
size="small"
style="width: 621px"
height="510px"
@row-dblclick="selectMaterial">
<el-table-column align="center" label="名称">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="图号/型号">
<template slot-scope="scope">
{{ scope.row.代号 }}
</template>
</el-table-column>
<el-table-column align="center" label="库存">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column align="center" label="材料">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
:pager-count="5"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</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>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="图片" center style="" width="600px">
<div v-for="(url, key) in urls" :key="key" style="margin-bottom: 25px">
<!-- <div class="action">-->
<!-- <a class="delete" @click="deleteFileData1(url.id)">删除</a>-->
<!-- </div>-->
<el-button type="danger" size="mini" style="float: right;margin-bottom: 5px;margin-right: 10px" @click="deleteFileData1(url.id)">删除</el-button>
<el-image :key="url.url" :src="url.url" :preview-src-list="urls1" lazy style="width: 500px; height: 500px"/>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { url } from '@/utils/request'
export default {
data() {
return {
Data: {},
urls: [],
urls1: [],
limit: 1000,
upload: url,
purchaseContractSerialNumber: '',
selectTheOutsourcingManufacturersValue: '',
selectTheOutsourcingManufacturers: [],
partsName: '',
dateRange: '',
form: {
模具名称: '',
图号或型号: '',
外协厂家: '',
数量: '',
外协时间: '',
送回时间: '',
物料流水号: ''
},
rules: {
模具名称: [{ required: true, message: '请输入模具名称', trigger: 'change' }],
图号或型号: [{ required: true, message: '请输入图号或型号', trigger: 'blur' }],
外协厂家: [{ required: true, message: '请选择外协厂家', trigger: 'change' }],
数量: [{ required: true, message: '请输入数量', trigger: 'blur' }]
},
moldValue: '',
title: '',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible5: false,
materialName: '',
materialSpec: '',
loading: false, // 数据加载
total: 0, // 分页总数
total1: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageCurrent1: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
pageSize1: 100 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
this.getSelectTheOutsourcingManufacturers()
},
methods: {
getMaterial() {
this.dialogFormVisible5 = true
},
warningExceed() {
this.$message.error('仅可上传五张照片')
},
uploadSuccess(res) { // 上传成功回调
this.$message.success('上传成功')
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
},
submit2() {
var param = []
param[0] = ['模具记录流水号', this.moldValue]
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.moldValue = row.模具记录流水号
},
handlePicture(row) {
this.dialogFormVisible1 = true
this.purchaseContractSerialNumber = row.模具记录流水号
this.urls = []
this.urls1 = []
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({
url: 'data:image/png;base64,' + response.data[i].文件内容,
id: response.data[i].id
})
this.urls1.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
},
deleteFileData1(id) {
// console.log(id, '图片iad')
var param = []
param[0] = ['id', id]
var Data = this.CreateData('12', '仓储管理_模具_图片_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('图片删除成功')
this.urls = []
this.urls1 = []
var param1 = []
param1[0] = ['模具记录流水号', this.purchaseContractSerialNumber]
var Data1 = this.CreateData('11', '仓储管理_模具_图片_查询数据', param1)
this.ExecDatabase(Data1).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].文件内容 !== null) {
this.urls.push({
url: 'data:image/png;base64,' + response.data[i].文件内容,
id: response.data[i].id
})
this.urls1.push('data:image/png;base64,' + response.data[i].文件内容)
}
}
})
} else {
this.$message.error('删除失败')
}
})
},
selectMaterial(row) {
this.form.模具名称 = row.名称
this.form.图号或型号 = row.代号
this.form.物料流水号 = row.物料流水号
this.dialogFormVisible5 = false
},
getSelectTheOutsourcingManufacturers() {
var param = []
var Data = this.CreateData('11', '外协厂家_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectTheOutsourcingManufacturers.push({
label: response.data[i].外协厂家简称,
value: response.data[i].外协厂家流水号
})
}
})
},
editType(formName) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form.模具名称 = ''
this.form.图号或型号 = ''
this.form.物料流水号 = ''
this.title = '增加记录'
this.dialogFormVisible = true
},
// 增加删除
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 增加确定
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['物料流水号', this.form.物料流水号]
param[1] = ['外协厂家', this.form.外协厂家]
param[2] = ['外协时间', this.form.外协时间]
param[3] = ['送回时间', this.form.送回时间]
param[4] = ['数量', this.form.数量]
var Data = this.CreateData('12', '仓储管理_模具记录_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 删除
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('删除成功')
if (this.tableData && this.tableData.length === 1 && this.pageList > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageList--
}
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable() {
let selectTheOutsourcingManufacturersValue_check, dateRange_check, partsName_check
this.selectTheOutsourcingManufacturersValue ? selectTheOutsourcingManufacturersValue_check = 1 : selectTheOutsourcingManufacturersValue_check = 0
this.partsName ? partsName_check = 1 : partsName_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['外协厂家流水号_check', selectTheOutsourcingManufacturersValue_check]
param[1] = ['外协厂家流水号', this.selectTheOutsourcingManufacturersValue]
param[2] = ['物料名称_check', partsName_check]
param[3] = ['物料名称', this.partsName]
param[4] = ['外协时间_check', dateRange_check]
param[5] = ['开始时间', this.dateRange[0]]
param[6] = ['结束时间', this.dateRange[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
})
},
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.form.外协时间 = row.外协时间
this.form.送回时间 = row.送回时间
this.form.外协厂家 = Number(row.外协厂家流水号)
this.moldValue = row.模具记录流水号
this.dialogFormVisible = true
},
submitUpdate(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['数量', this.form.数量]
param[1] = ['外协厂家', this.form.外协厂家]
param[2] = ['外协时间', this.form.外协时间]
param[3] = ['送回时间', this.form.送回时间]
param[4] = ['模具记录流水号', this.moldValue]
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.error('编辑失败')
}
})
}
})
},
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.searchTable()
},
searchMaterial() {
let materialName_check, materialSpec_check
this.materialName ? materialName_check = 1 : materialName_check = 0
this.materialSpec ? materialSpec_check = 1 : materialSpec_check = 0
var param = []
param[0] = ['名称_check', materialName_check]
param[1] = ['名称', this.materialName]
param[2] = ['代号_check', materialSpec_check]
param[3] = ['代号', this.materialSpec]
var Data = this.CreateData('11', '物料信息_查询新', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchMaterial()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchMaterial()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,267 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<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="pageSize=100;pageCurrent=1;searchTable()"/>
<el-select v-model="orderValue" style="width:200px" placeholder="补货单号" size="small" filterable clearable @change="pageSize=100;pageCurrent=1;searchTable()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partName" style="width:220px" placeholder="零件名称" size="small" clearable @keyup.enter.native="pageSize=100;pageCurrent=1;searchTable()"/>
<el-input v-model="drawingNo" style="width:150px" placeholder="图号" size="small" clearable @keyup.enter.native="pageSize=100;pageCurrent=1;searchTable()"/>
</div>
<el-col style="width: 1309px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 1309px;margin-top: 10px"
height="750"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center" prop="序号"/>
<el-table-column width="75px" label="状态" align="center" prop="状态" sortable="状态">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column width="150px" label="补货单号" align="center" prop="补货单" sortable="补货单">
<template slot-scope="scope">
{{ scope.row.补货单号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" prop="名称" sortable="名称">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column width="130px" label="图号" align="center" prop="图号" sortable="图号">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column width="89px" label="补货数" align="center" prop="补货数" sortable="补货数">
<template slot-scope="scope">
{{ scope.row.补货数 }}
</template>
</el-table-column>
<el-table-column width="101px" label="补货时间" align="center" prop="补货时间" sortable="补货时间">
<template slot-scope="scope">
{{ scope.row.补货日期 }}
</template>
</el-table-column>
<el-table-column width="101px" label="补货期限" align="center" prop="补货期限" sortable="补货期限">
<template slot-scope="scope">
{{ scope.row.补货期限 }}
</template>
</el-table-column>
<el-table-column width="69px" label="补货人" align="center">
<template slot-scope="scope">
{{ scope.row.补货人 }}
</template>
</el-table-column>
<el-table-column width="99px" label="完成数量" align="center" prop="完成数" sortable="完成数">
<template slot-scope="scope">
{{ scope.row.完成数 }}
</template>
</el-table-column>
<el-table-column width="99px" label="入库数量" align="center" prop="入库数" sortable="入库数">
<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="69px" label="操作" align="center">
<template slot-scope="scope">
<el-button :disabled="Number(scope.row.入库数) !== 0 || Number(token)!==2" type="text" icon="el-icon-delete" size="small" @click="handleDelete(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-card>-->
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
orderArray: [],
orderValue: '',
partName: '', // 零件名称
drawingNo: '', // 图号
replenishmentManValue: '', // 补货人
dateRange: '', // 提交日期
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.searchTable()
this.getOrder()
},
methods: {
getOrder() {
this.orderArray = []
var param = []
var Data = this.CreateData('11', '仓库管理_报缺补货单_查询', 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].订单流水号
})
}
})
},
searchTable() {
this.loading = true
let dateRange_check, partName_check, drawingNo_check, orderValue_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.partName ? partName_check = 1 : partName_check = 0
this.drawingNo ? drawingNo_check = 1 : drawingNo_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
var param = []
param[0] = ['开始时间', this.dateRange[0]]
param[1] = ['图号', this.drawingNo]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['补货日期_check', dateRange_check]
param[4] = ['名称_check', partName_check]
param[5] = ['名称', this.partName]
param[6] = ['图号_check', drawingNo_check]
param[7] = ['订单流水号', this.orderValue]
param[8] = ['补货单号_check', orderValue_check]
param[9] = ['排序名称', this.orderName]
param[10] = ['排序方式', this.order]
var Data = this.CreateData('11', '仓储管理_补货件查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log('补货件查询', response.data)
this.tableData = response.data.rows
this.total = response.data.total
this.loading = false
})
},
sortChange(column) {
if (column.prop === '状态') {
this.orderName = 1
} else if (column.prop === '补货单') {
this.orderName = 2
} else if (column.prop === '名称') {
this.orderName = 3
} else if (column.prop === '图号') {
this.orderName = 4
} else if (column.prop === '补货数') {
this.orderName = 5
} else if (column.prop === '补货时间') {
this.orderName = 6
} else if (column.prop === '完成数') {
this.orderName = 7
} else if (column.prop === '补货期限') {
this.orderName = 8
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
handleDelete(row) {
// this.$message.success('执行删除操作')
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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.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,295 @@
<!--外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家-->
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="outManufacturerNameValue" style="width:150px" size="small" clearable placeholder="外协厂家名称"/>
<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="warning" plain icon="el-icon-plus" size="small" @click="editType('form')">外协厂家</el-button>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 100%" height="750" @sort-change="sortChange">
<el-table-column type="index" label="序号" align="center" width="50"/>
<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" 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">
<el-button type="text" icon="el-icon-edit" size="mini" style="margin-right: 10px" @click="handleEdit(scope.row)"/>
<el-button type="text" icon="el-icon-delete" size="mini" @click="handleDelete(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>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="title" center width="660px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="100px" class="demo-ruleForm">
<el-form-item label="厂家名称" prop="厂家名称" style="display: inline-block;">
<el-input v-model="form.厂家名称" style="width:180px;display: inline-block" placeholder="厂家名称" size="small" clearable/>
</el-form-item>
<el-form-item label="厂家简称" prop="厂家简称" style="display: inline-block;margin-left: 10px">
<el-input v-model="form.厂家简称" style="width:180px;display: inline-block" placeholder="厂家简称" size="small" clearable/>
</el-form-item>
<el-form-item label="地址" prop="地址" style="display: inline-block;margin-left: -30px">
<el-input v-model="form.地址" style="width:180px;display: inline-block;margin-left: 30px" placeholder="地址" size="small" clearable/>
</el-form-item>
<el-form-item label="联系人" prop="联系人" style="display: inline-block;margin-left: -4px">
<el-input v-model="form.联系人" style="width:180px;display: inline-block;margin-left: 14px" placeholder="联系人" size="small" clearable/>
</el-form-item>
<el-form-item label="电话" prop="电话" style="display: inline-block;margin-left: -30px">
<el-input v-model="form.电话" style="width:180px;display: inline-block;margin-left: 30px" placeholder="电话" size="small" clearable/>
</el-form-item>
<el-form-item label="备注" prop="备注" style="display: inline-block;margin-left: -20px">
<el-input v-model="form.备注" style="width:180px;display: inline-block;margin-left: 30px" placeholder="备注" size="small" clearable/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="!buttonChange" @click="callOff('form')">取消</el-button>
<el-button v-if="!buttonChange" type="primary" @click="submit('form')">确定</el-button>
<el-button v-if="buttonChange" @click="callOff('form')">取消</el-button>
<el-button v-if="buttonChange" type="primary" @click="submitUpdate('form')">确定</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
buttonChange: '',
form: {
厂家名称: '',
厂家简称: '',
地址: '',
联系人: '',
电话: '',
备注: ''
},
rules: {
厂家名称: [{ required: true, message: '请输入厂家名称', trigger: 'blur' }],
厂家简称: [{ required: true, message: '请输入厂家简称', trigger: 'blur' }]
},
title: '',
dialogFormVisible: false,
outManufacturerNameValue: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
},
methods: {
// fetchData() {
// this.getCustomer()
// },
editType(formName) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.buttonChange = false
this.title = '增加外协厂家'
this.dialogFormVisible = true
},
// 增加删除
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 增加确定
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
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.备注]
console.log(param)
var Data = this.CreateData('11', '技术中心_外协厂家_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === 1) {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 删除
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('删除成功')
if (this.tableData && this.tableData.length === 1 && this.pageList > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageList--
}
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable() {
let outManufacturerNameValue_check
this.outManufacturerNameValue ? outManufacturerNameValue_check = 1 : outManufacturerNameValue_check = 0
var param = []
param[0] = ['外协厂家名称_check', outManufacturerNameValue_check]
param[1] = ['外协厂家名称', this.outManufacturerNameValue]
var Data = this.CreateData('11', '技术中心_技术确认_外协厂家_查询数据', 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.tableData.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].备注,
edit: false
})
}
}
this.tableData = response.data.rows
this.total = response.data.total
})
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑'
this.buttonChange = true
this.form.厂家名称 = row.外协厂家名称
this.form.厂家简称 = row.外协厂家简称
this.外协厂家流水号 = row.外协厂家流水号
this.form.地址 = row.地址
// this.form.材料 = Number(row.材料流水号) === 3 ? null : Number(row.材料流水号)
this.form.联系人 = row.联系人
this.form.电话 = row.电话
this.form.备注 = row.备注
this.dialogFormVisible = true
},
submitUpdate(formName, row) {
console.log('李显', this.外协厂家流水号)
this.$refs[formName].validate((valid) => {
if (valid) {
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.外协厂家流水号]
param[6] = ['备注', 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.error('编辑失败')
}
})
}
})
},
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.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,656 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<el-col style="width: 1351px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input
v-model="partsName"
clearable
placeholder="工件名称/图号"
size="small"
style="width:150px"
@keyup.enter.native="searchTable()"/>
<el-input
v-model="processName"
clearable
placeholder="工序"
size="small"
style="width:100px;margin-left: 10px"
@keyup.enter.native="searchTable()"/>
<el-button
icon="el-icon-plus"
size="small"
style="margin-left: 50px"
type="distribution"
@click="openOrder()">调拨
</el-button>
<el-button
icon="el-icon-bottom"
plain
size="small"
style="margin-left: 10px"
type="success"
@click="selectIn()">选入
</el-button>
</div>
<div>
<el-table
v-loading="loading"
:data="tableData"
border
height="300px"
highlight-current-row
show-summary
size="small"
stripe
style="width: 1311px"
@selection-change="handleSelectionChange">
<el-table-column :selectable="selectable" align="center" type="selection" width="50px"/>
<el-table-column align="center" label="订单编号" width="141px">
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column align="center" label="产品名称" width="150px">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column align="center" 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 align="center" label="序号" show-overflow-tooltip width="63px">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工序" show-overflow-tooltip width="63px">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column align="center" label="单位" width="51px">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column align="center" label="外协数量" prop="外协数量" width="75px">
<template slot-scope="scope">
{{ scope.row.外协数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="已外协数" prop="已外协数" width="75px">
<template slot-scope="scope">
{{ scope.row.已外协数 }}
</template>
</el-table-column>
<el-table-column align="center" label="需外协数" prop="数量" width="143px">
<template slot-scope="scope">
<!-- {{ scope.row.外协数量 }}-->
<el-input-number
v-model="scope.row.需外协数"
:max="Number(scope.row.最大值)"
:min="0"
size="mini"
style="margin: 0;width: 100%"/>
</template>
</el-table-column>
<el-table-column align="center" label="备料库存数" prop="累计库存" width="90px">
<template slot-scope="scope">
{{ scope.row.累计库存 }}
</template>
</el-table-column>
<el-table-column align="center" label="已领备料数" prop="已领数量" width="90px">
<template slot-scope="scope">
{{ scope.row.已领数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="任务生成" width="85px">
<template slot-scope="scope">
{{ scope.row.下达日期 }}
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
<el-row>
<el-col style="width: 501px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
border
height="350"
highlight-current-row
size="mini"
stripe
style="width: 501px;margin-top: 10px"
@row-click="searchTable2">
<el-table-column align="center" label="调拨单号" prop="" show-overflow-tooltip width="120px">
<template slot-scope="scope">
{{ scope.row.调拨单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="外协厂家" show-overflow-tooltip width="120px">
<template slot-scope="scope">
{{ scope.row.外协厂家 }}
</template>
</el-table-column>
<el-table-column align="center" label="调拨备注" show-overflow-tooltip width="120px">
<template slot-scope="scope">
{{ scope.row.调拨备注 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('日期时间')" align="center" label="操作">
<template slot-scope="scope">
<el-tooltip :open-delay="700" content="提交" effect="dark" placement="top">
<el-button icon="el-icon-check" size="mini" type="text" @click.native.stop="Submit(scope.row)">
提交
</el-button>
</el-tooltip>
<el-tooltip :open-delay="700" content="上传图片" effect="dark" placement="top">
<el-button
icon="el-icon-picture-outline"
size="mini"
style="margin-right: 5px"
type="text"
@click.native.stop="uploadPicture(scope.row)">上传
</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
<el-col style="margin-left: 10px;width: 821px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
:data="tableData2"
:header-cell-style="{background: '#19466E',color: 'white'}"
border
height="350"
highlight-current-row
show-summary
size="mini"
stripe
style="width: 801px;margin-top: 10px;margin-bottom: 500px">
<el-table-column align="center" label="工件名称" prop="">
<template slot-scope="scope">
{{ scope.row.工件名称 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('图号')" align="center" label="图号" prop="">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('工序')" align="center" label="工序" prop="">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column align="center" label="数量" prop="调拨数量" width="75px">
<template slot-scope="scope">
<!-- <el-input-number v-model="scope.row.调拨数量" :max="Number(scope.row.调拨数量)" :min="1" size="mini" style="margin: 0;width: 100%"/>-->
{{ scope.row.调拨数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单位')" align="center" label="单位" prop="">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" placeholder="请输入调拨备注" @change="addNotes(scope.row)"/>
<!-- {{ scope.row.单位 }}-->
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="85px">
<template slot-scope="scope">
<el-tooltip :open-delay="700" content="操作" effect="dark" placement="top">
<el-button
icon="el-icon-top"
size="mini"
style="margin-right: 10px"
type="text"
@click="handleDelete(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<!-- </el-card>-->
</el-col>
</el-row>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center title="调拨单" width="320px">
<el-form ref="form" :model="form" :rules="rules" class="demo-ruleForm" label-position="center" label-width="80px">
<el-form-item label="外协厂家" prop="外协厂家">
<el-select
v-model="form.外协厂家"
clearable
filterable
placeholder="外协厂家"
size="small"
style="width:150px;">
<el-option
v-for="item in selectTheOutsourcingManufacturers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="调拨备注" prop="调拨备注">
<el-input v-model="form.调拨备注" clearable placeholder="备注" size="small" style="width:150px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button size="small" type="distribution" @click="submitOrder('form')">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center title="上传图片" width="320px">
<el-upload
id="invoiceScan"
ref="upload"
:action="upload"
:auto-upload="false"
:before-upload="beforeUpload"
:data="Data"
:limit="limit"
:multiple="true"
:on-exceed="warningExceed"
:on-success="uploadSuccess"
list-type="picture-card"
style="margin-left: 60px">
<i class="el-icon-plus"/>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible1=false">取消</el-button>
<el-button size="small" type="distribution" @click="submit2('form')">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { url } from '@/utils/request'
export default {
data() {
return {
PartType: '外协调拨',
selectTheOutsourcingManufacturersValue: '', // 选择外协厂家
selectTheOutsourcingManufacturers: [], // 选择外协厂家数组
transferNotesValue: '', // 调拨备注
transferNotes: [], // 调拨备注数组
selectTheDialListValue: '', // 选择调拨单
selectTheDialList: [], // 选择调拨单数组
listValue: '',
partsName: '',
processName: '',
orderValue: '',
upload: url,
limit: 5,
Data: {},
form: {
外协厂家: '',
调拨备注: ''
},
rules: {
外协厂家: [{ required: true, message: '请选择外协厂家', trigger: 'change' }]
},
multipleSelection: [],
multipleSelection_variable: [],
multipleSelection1: [],
multipleSelection_variable1: [],
dialogFormVisible: false,
dialogFormVisible1: false,
loading: false, // 数据加载
tableData: [],
tableData1: [],
tableData2: [],
tableData3: []
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
this.getSelectTheOutsourcingManufacturers()
this.searchOrder()
},
methods: {
addNotes(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.searchTable()
var param = []
param[0] = ['外协调拨单流水号', this.orderValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
} else {
this.$message.error('备注编辑失败')
}
})
},
getSelectTheOutsourcingManufacturers() {
var param = []
var Data = this.CreateData('11', '外协厂家_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.selectTheOutsourcingManufacturers.push({
label: response.data[i].外协厂家简称,
value: response.data[i].外协厂家流水号
})
}
})
},
getTransferNotes() {
this.transferNotes = []
this.selectTheDialListValue = ''
if (this.selectTheOutsourcingManufacturersValue) {
var param = []
param[0] = ['外协厂家流水号', this.selectTheOutsourcingManufacturersValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单列表_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.transferNotes.push({
label: response.data[i].调拨单号,
value: response.data[i].外协调拨单流水号
})
}
})
}
},
getData() {
if (this.PartType === '外协调拨') {
this.searchTable()
} else if (this.PartType === '外协到货') {
this.searchTable1()
}
},
selectable(row) {
return row.需外协数 > 0 && row.需外协数 !== undefined
},
submitInStorage() {
if (this.multipleSelection1.length !== 0) {
const numberGroup = []
const partGroup = []
this.multipleSelection_variable1 = this.multipleSelection1
this.multipleSelection1 = []
for (let i = 0; i < this.multipleSelection_variable1.length; i++) {
numberGroup[i] = this.multipleSelection_variable1[i].到货数量
partGroup[i] = this.multipleSelection_variable1[i].外协调拨单明细流水号
}
var param = []
param[0] = ['外协调拨单明细流水号组', partGroup]
param[1] = ['到货数量组', numberGroup]
var Data = this.CreateData('12', '仓储管理_外协调拨明细_到货', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('入库成功')
this.searchTable1()
} else {
this.$message.error('入库失败')
}
})
} else {
this.$message.warning('请选择工件')
}
},
searchTable() {
let partsName_check, processName_check
this.partsName ? partsName_check = 1 : partsName_check = 0
this.processName ? processName_check = 1 : processName_check = 0
var param = []
param[0] = ['工件名称_check', partsName_check]
param[1] = ['工件名称', this.partsName]
param[2] = ['工序_check', processName_check]
param[3] = ['工序', this.processName]
var Data = this.CreateData('11', '仓储管理_未外协零件_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data
})
},
openOrder() {
this.form = {}
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.dialogFormVisible = true
},
searchOrder() {
var param = []
var Data = this.CreateData('11', '仓储管理_未提交外协调拨单_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
submitOrder(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['外协厂家流水号', this.form.外协厂家]
param[1] = ['调拨备注', this.form.调拨备注]
param[2] = ['操作者', this.id]
var Data = this.CreateData('12', '仓储管理_外协调拨_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.searchOrder()
this.dialogFormVisible = false
} else {
this.$message.error('添加失败')
}
})
}
})
},
callOff(formName) {
this.form = {}
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
searchTable2(row) {
this.orderValue = row.外协调拨单流水号
var param = []
param[0] = ['外协调拨单流水号', row.外协调拨单流水号]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
handleSelectionChange1(val) {
this.multipleSelection1 = val
},
selectIn() {
if (this.multipleSelection.length !== 0) {
if (!this.orderValue) {
this.$message.warning('请选中调拨单')
return
}
const processGroup = []
const numberGroup = []
const partGroup = []
const taskGroup = []
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
processGroup[i] = this.multipleSelection_variable[i].工序流水号
numberGroup[i] = this.multipleSelection_variable[i].需外协数
partGroup[i] = this.multipleSelection_variable[i].工艺计划流水号
taskGroup[i] = this.multipleSelection_variable[i].工艺任务流水号
}
var param = []
param[0] = ['工序流水号组', processGroup]
param[1] = ['数量组', numberGroup]
param[2] = ['工艺计划流水号组', partGroup]
param[3] = ['外协调拨单流水号', this.orderValue]
param[4] = ['工艺任务流水号组', taskGroup]
param[5] = ['人员编号', this.id]
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.orderValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
console.log('调拨单明细', this.tableData2)
})
} else {
this.$message.success('选入失败')
}
})
} else {
this.$message.warning('请选择工件')
}
},
handleDelete(row) {
var param = []
param[0] = ['外协调拨单明细流水号', row.外协调拨单明细流水号]
var Data = this.CreateData('12', '仓储管理_外协调拨明细_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable()
var param = []
param[0] = ['外协调拨单流水号', this.orderValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
this.$message.success('移出成功')
} else {
this.$message.error('移出失败')
}
})
},
Submit(row) {
if (this.orderValue !== row.外协调拨单流水号) {
this.$message.warning('请提交当前选中的调拨单')
return
}
if (this.tableData2.length > 0) {
this.$confirm('是否提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const processGroup = []
const numberGroup = []
for (let i = 0; i < this.tableData2.length; i++) {
processGroup[i] = this.tableData2[i].工序流水号
numberGroup[i] = this.tableData2[i].调拨数量
}
if (this.tableData2.length === numberGroup.length) {
var param = []
param[0] = ['外协调拨单流水号', row.外协调拨单流水号]
param[1] = ['已经外协数组', numberGroup]
param[2] = ['工序流水号组', processGroup]
var Data = this.CreateData('12', '仓储管理_外协调拨_提交新', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('提交成功')
this.searchOrder()
this.searchTable()
this.tableData2 = []
} else {
this.$message.error('提交失败')
}
})
} else {
this.$message.warning('数据提取不完整,请重新提交!')
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消提交'
})
})
} else {
this.$message.warning('调拨单不能为空')
}
},
uploadPicture(row) {
this.dialogFormVisible1 = true
this.listValue = row.外协调拨单流水号
},
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.dialogFormVisible1 = false
this.$nextTick(() => {
this.searchOrder()
})
},
uploadSuccess(res) { // 上传成功回调
this.dialogFormVisible1 = false
this.$refs.upload.clearFiles()
},
beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type)
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
return isJPG
},
warningExceed() {
this.$message.error('仅可上传五张照片')
},
searchTable1() {
let selectTheDialListValue_check
this.selectTheDialListValue ? selectTheDialListValue_check = 1 : selectTheDialListValue_check = 0
var param = []
param[0] = ['外协厂家流水号', this.selectTheOutsourcingManufacturersValue]
param[1] = ['外协调拨单流水号', this.selectTheDialListValue]
param[2] = ['外协调拨单_check', selectTheDialListValue_check]
var Data = this.CreateData('11', '仓储管理_外协到货_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData3 = response.data
})
}
}
}
</script>

View File

@@ -0,0 +1,297 @@
<!--外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家外协厂家-->
<template>
<div class="app-container">
<el-card>
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="outManufacturerNameValue" style="width:150px" size="small" clearable placeholder="外协厂家名称"/>
<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="warning" plain icon="el-icon-plus" size="small" @click="editType('form')">外协厂家</el-button>
</div>
</el-card>
<el-card>
<el-table v-loading="loading" :data="tableData" highlight-current-row border stripe size="small" style="width: 100%" height="750" @sort-change="sortChange">
<el-table-column type="index" label="序号" align="center" width="50"/>
<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" 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">
<el-button type="text" icon="el-icon-edit" size="mini" style="margin-right: 10px" @click="handleEdit(scope.row)"/>
<el-button type="text" icon="el-icon-delete" size="mini" @click="handleDelete(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>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="title" center width="660px">
<el-form ref="form" :model="form" :rules="rules" label-position="center" label-width="100px" class="demo-ruleForm">
<el-form-item label="厂家名称" prop="厂家名称" style="display: inline-block;">
<el-input v-model="form.厂家名称" style="width:180px;display: inline-block" placeholder="厂家名称" size="small" clearable/>
</el-form-item>
<el-form-item label="厂家简称" prop="厂家简称" style="display: inline-block;margin-left: 10px">
<el-input v-model="form.厂家简称" style="width:180px;display: inline-block" placeholder="厂家简称" size="small" clearable/>
</el-form-item>
<el-form-item label="地址" prop="地址" style="display: inline-block;margin-left: -30px">
<el-input v-model="form.地址" style="width:180px;display: inline-block;margin-left: 30px" placeholder="地址" size="small" clearable/>
</el-form-item>
<el-form-item label="联系人" prop="联系人" style="display: inline-block;margin-left: -4px">
<el-input v-model="form.联系人" style="width:180px;display: inline-block;margin-left: 14px" placeholder="联系人" size="small" clearable/>
</el-form-item>
<el-form-item label="电话" prop="电话" style="display: inline-block;margin-left: -30px">
<el-input v-model="form.电话" style="width:180px;display: inline-block;margin-left: 30px" placeholder="电话" size="small" clearable/>
</el-form-item>
<el-form-item label="备注" prop="备注" style="display: inline-block;margin-left: -20px">
<el-input v-model="form.备注" style="width:180px;display: inline-block;margin-left: 30px" placeholder="备注" size="small" clearable/>
</el-form-item>
<el-form-item v-if="!buttonChange">
<el-button style="margin-left: 230px;margin-top: 30px" @click="callOff('form')">取消</el-button>
<el-button style="margin-left: 10px;background-color: rgb(255,151,89);color: white" @click="submit('form')">确定</el-button>
</el-form-item>
<el-form-item v-if="buttonChange">
<el-button style="margin-left: 230px;margin-top: 30px" @click="dialogFormVisible=false">取消</el-button>
<el-button style="margin-left: 10px;background-color: rgb(255,151,89);color: white" @click="submitUpdate('form')">确定</el-button>
</el-form-item>
</el-form>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
buttonChange: '',
form: {
厂家名称: '',
厂家简称: '',
地址: '',
联系人: '',
电话: '',
备注: ''
},
rules: {
厂家名称: [{ required: true, message: '请输入厂家名称', trigger: 'blur' }],
厂家简称: [{ required: true, message: '请输入厂家简称', trigger: 'blur' }]
},
title: '',
dialogFormVisible: false,
outManufacturerNameValue: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
// this.fetchData()
},
methods: {
// fetchData() {
// this.getCustomer()
// },
editType(formName) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.buttonChange = false
this.title = '增加外协厂家'
this.dialogFormVisible = true
},
// 增加删除
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
// 增加确定
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
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.备注]
console.log(param)
var Data = this.CreateData('11', '技术中心_外协厂家_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].结果 === 1) {
this.$message({
message: '信息增加成功',
type: 'success'
})
this.searchTable()
} else {
this.$message.error('信息增加失败')
}
})
this.dialogFormVisible = false
} else {
return false
}
})
},
// 删除
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('删除成功')
if (this.tableData && this.tableData.length === 1 && this.pageList > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageList--
}
this.searchTable()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable() {
let outManufacturerNameValue_check
this.outManufacturerNameValue ? outManufacturerNameValue_check = 1 : outManufacturerNameValue_check = 0
var param = []
param[0] = ['外协厂家名称_check', outManufacturerNameValue_check]
param[1] = ['外协厂家名称', this.outManufacturerNameValue]
var Data = this.CreateData('11', '技术中心_技术确认_外协厂家_查询数据', 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.tableData.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].备注,
edit: false
})
}
}
this.tableData = response.data.rows
this.total = response.data.total
})
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑'
this.buttonChange = true
this.form.厂家名称 = row.外协厂家名称
this.form.厂家简称 = row.外协厂家简称
this.外协厂家流水号 = row.外协厂家流水号
this.form.地址 = row.地址
// this.form.材料 = Number(row.材料流水号) === 3 ? null : Number(row.材料流水号)
this.form.联系人 = row.联系人
this.form.电话 = row.电话
this.form.备注 = row.备注
this.dialogFormVisible = true
},
submitUpdate(formName, row) {
console.log('李显', this.外协厂家流水号)
this.$refs[formName].validate((valid) => {
if (valid) {
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.外协厂家流水号]
param[6] = ['备注', 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.error('编辑失败')
}
})
}
})
},
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.searchTable()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,377 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-select
v-model="orderNumberTypeValue"
:remote-method="getOrderNumberType"
style="width:200px"
placeholder="订单号"
size="small"
filterable
clearable
remote
@change="searchTable();getproductpartName()">
<el-option
v-for="item in orderNumberType"
: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="searchTable()">
<el-option
v-for="item in productpartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="pickingListPeople"
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 = 40;searchTable()">查询
</el-button>
</div>
<el-col style="width: 761px">
<el-table
v-loading="loading"
:data="tableData"
:row-class-name="tableRowClassName"
highlight-current-row
border
size="small"
style="width: 761px"
height="740px"
@row-click="searchTable1"
@sort-change="sortChange">
<el-table-column width="75px" label="任务状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.任务状态 === '完成'" type="success"> {{ scope.row.任务状态 }}</el-tag>
<el-tag v-else-if="scope.row.任务状态 === '部分'" type="warning"> {{ scope.row.任务状态 }}</el-tag>
<el-tag v-else type="info"> {{ scope.row.任务状态 }}</el-tag>
</template>
</el-table-column>
<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"
show-overflow-tooltip
prop="领料人"
sortable="领料人">
<template slot-scope="scope">
{{ scope.row.领料人 }}
</template>
</el-table-column>
<el-table-column
:width="setColumnWidth('订单号')"
label="订单号"
align="center"
show-overflow-tooltip
prop="订单号"
sortable="订单号">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column width="200px" label="产品/部件" align="center">
<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.领料人流水号) !== id || Number(scope.row.已领) === 1 || Number(scope.row.是否部件) === 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="deletePick(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-left: 30px;width: 876px">
<el-table
ref="table"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
:row-class-name="tableRowClassName1"
show-summary
highlight-current-row
border
size="small"
style="width: 696px"
height="740px">
<el-table-column width="75px" label="任务状态" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.任务状态 === '完成'" type="success"> {{ scope.row.任务状态 }}</el-tag>
<el-tag v-else-if="scope.row.任务状态 === '部分'" type="warning"> {{ scope.row.任务状态 }}</el-tag>
<el-tag v-else type="info"> {{ scope.row.任务状态 }}</el-tag>
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center"/>
<el-table-column width="200px" 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" prop="申请数">
<template slot-scope="scope">
{{ scope.row.申请数 }}
</template>
</el-table-column>
<el-table-column width="100px" label="已领数" align="center" prop="已领数">
<template slot-scope="scope">
{{ scope.row.已领数 }}
</template>
</el-table-column>
</el-table>
</el-col>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
productpartNameValue: '', // 产品部件名称
productpartName: [], // 产品部件名称数组
pickingListPeople: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 领料单信息表
tableData1: [], // 领料单明细信息表
tableData3: [],
pageCurrent: 1, // 分页当前页
pageSize: 40, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable()
this.getOrderNumberType('')
},
methods: {
getOrderNumberType(query) {
this.orderNumberType = []
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.orderNumberType.push({
label: response.data[i].订单号,
value: response.data[i].订单流水号
})
}
})
},
getproductpartName() {
this.productpartName = []
this.productpartNameValue = ''
if (this.orderNumberTypeValue) {
var param = []
param[0] = ['订单流水号', this.orderNumberTypeValue]
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].组件流水号
})
}
})
}
},
searchTable() {
let orderNumberTypeValue_check, productpartNameValue_check, pickingListPeople_check
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.productpartNameValue ? productpartNameValue_check = 1 : productpartNameValue_check = 0
this.pickingListPeople ? pickingListPeople_check = 1 : pickingListPeople_check = 0
var param = []
param[0] = ['订单号_check', orderNumberTypeValue_check]
param[1] = ['订单流水号', this.orderNumberTypeValue]
param[2] = ['产品_check', productpartNameValue_check]
param[3] = ['组件流水号', this.productpartNameValue]
param[4] = ['领料人_check', pickingListPeople_check]
param[5] = ['领料人', this.pickingListPeople]
param[6] = ['排序名称', this.orderName]
param[7] = ['排序方式', 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
})
},
deletePick(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.searchTable()
this.tableData1 = []
this.$message.success('删除成功')
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable1(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 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.申请数和 === row.已领数和) {
row.任务状态 = '完成'
}
if (row.已领数和 === '0') {
row.任务状态 = '未领'
}
if (row.已领数和 !== '0' && row.申请数和 !== row.已领数和) {
row.任务状态 = '部分'
}
if (Number(row.是否部件) === 1) {
return 'is-group'
}
},
tableRowClassName1({ row, rowIndex }) {
if (row.申请数 === row.已领数) {
row.任务状态 = '完成'
} else if (row.已领数 === 0) {
row.任务状态 = '未领'
} else if (row.已领数 !== 0 && row.申请数 !== row.已领数) {
row.任务状态 = '部分'
}
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style>
.el-table .is-group {
background: #FFF582 !important;
}
.el-table .assembly {
background: #C4E1FF !important;
}
.el-table .complete {
background: #c6d7b3 !important;
}
.el-table .suspend {
background: #FFD1A4 !important;
}
.el-table .suspend1 {
background: #FFD1A4 !important;
}
</style>

View File

@@ -0,0 +1,541 @@
<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();getProductName()">
<el-option
v-for="item in customerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productNameValue"
style="width:200px ; margin-left: 10px"
size="small"
placeholder="产品部件"
filterable
clearable
@change="pageCurrent=1;pageSize=100;searchTable()">
<el-option
v-for="item in productName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="pickListValue"
:remote-method="getList"
style="width:200px ; margin-left: 10px"
size="small"
placeholder="领料单号"
filterable
clearable
remote
@change="pageCurrent=1;pageSize=100;searchTable()">
<el-option
v-for="item in pickList"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="typeValue"
style="width:100px"
placeholder="类型"
size="small"
filterable
clearable
@change="searchTable()">
<el-option
v-for="item in type"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="pickPeopleValue"
style="width:100px ; margin-left: 10px"
size="small"
placeholder="领料人"
filterable
clearable
@change="pageCurrent=1;pageSize=100;searchTable()">
<el-option
v-for="item in pickPeople"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="production"
style="width: 200px ; margin-left: 10px"
size="small"
clearable
placeholder="物料名称/编号/规格/型号"
@keyup.enter.native="pageCurrent=1;pageSize=100;searchTable()"/>
<span style="font-size: 17px;color: black ; margin-left: 24px">出库时间</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-checkbox v-model="returnMaterialChecked" style="margin-left: 20px" @change="searchTable()">退料
</el-checkbox>
<el-button
type="success"
plain
icon="el-icon-download"
size="small"
style="margin-left: 40px"
@click="exportExcel()">导出
</el-button>
</div>
<div style="margin-top: 20px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1611px"
height="740px">
<el-table-column width="70px" 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="130px" label="物料编号" align="center" show-overflow-tooltip>
<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="47px" 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">
<template slot-scope="scope">
{{ scope.row.库位 }}
</template>
</el-table-column>
<el-table-column width="95px" 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="99px" label="领料单号" align="center">
<template slot-scope="scope">
{{ scope.row.领料单号 }}
</template>
</el-table-column>
<el-table-column width="125px" label="订单号" align="center">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="产品/部件名称" width="140px" align="center" show-overflow-tooltip>
<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" 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="140px" label="备注" align="center">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column width="57px" label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="(Number(scope.row.领料数)-Number(scope.row.退料数量)) === 0"
type="text"
size="mini"
@click="MaterialReturn(scope.row)">退料
</el-button>
<!--<el-button type="text" icon="el-icon-delete" size="mini" @click="deleteRecord(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>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="退料" center width="390px">
<el-form
ref="form"
:model="form"
:rules="rules"
label-position="left"
label-width="100px"
class="demo-ruleForm"
style="margin: auto">
<el-row>
<el-form-item label="数量:" prop="数量">
<el-input-number
v-model="form.数量"
:min="1"
:max="NumberValue"
clearable
size="small"
style="width:200px"
placeholder="请输入数量"/>
</el-form-item>
</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 {
typeValue: '', // 类型
type: [{
label: '自制',
value: '自制'
}, {
label: '外购',
value: '外购'
}, {
label: '耗材',
value: '耗材'
}, {
label: '通用',
value: '通用'
}, {
label: '临时',
value: '临时'
}, {
label: '备货',
value: '备货'
}], // 类型数组
returnMaterialChecked: '',
dialogFormVisible: false,
form: {
数量: ''
},
rules: {
数量: [{ required: true, message: '请输入数量' }]
},
NumberValue: '',
DeliveryNumber: '',
customerNameValue: '', // 订单号
customerName: [], // 订单号数组
productNameValue: '', // 产品部件名称
productName: [],
pickList: [],
pickListValue: '',
pickPeople: [],
pickPeopleValue: '',
dateRange: '', // 提交日期
contractStateValue: '', // 合同状态
production: '',
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
pageCurrent: 1, // 分页当前页
pageSize: 100, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.fetchData()
this.searchTable()
// this.getCustomer()
// this.getPart()
},
methods: {
// returnMaterialchecked() {
// console.log('李显',this.returnMaterialChecked)
// },
// 导出表 8.10
exportExcel() {
if (this.tableData.length !== 0) {
let returnMaterialChecked_check, customerNameValue_check, dateRange_check, production_check,
productNameValue_check, pickPeopleValue_check, pickListValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.production ? production_check = 1 : production_check = 0
this.pickListValue ? pickListValue_check = 1 : pickListValue_check = 0
this.pickPeopleValue ? pickPeopleValue_check = 1 : pickPeopleValue_check = 0
if (this.returnMaterialChecked === true) {
returnMaterialChecked_check = 1
} else {
returnMaterialChecked_check = 0
}
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['订单_check', customerNameValue_check]
param[3] = ['订单流水号', this.customerNameValue]
param[4] = ['产品_check', productNameValue_check]
param[5] = ['组件流水号', this.productNameValue]
param[6] = ['出库时间_check', dateRange_check]
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
param[9] = ['领料单_check', pickListValue_check]
param[10] = ['领料单号', this.pickListValue]
param[11] = ['领料人_check', pickPeopleValue_check]
param[12] = ['领料人', this.pickPeopleValue]
param[13] = ['退料_check', returnMaterialChecked_check]
var Data = this.CreateData('2001', '仓储管理_出库记录_导出表格_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
fetchData() {
this.getCustomer('')
this.getList('')
this.getPeople()
},
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].订单流水号
})
}
})
},
getList(query) {
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.pickList.push({
label: response.data[i].领料单号,
value: response.data[i].领料单号
})
}
})
},
getPeople() {
var param = []
var Data = this.CreateData('11', '仓库管理_领料人_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.pickPeople.push({
label: response.data[i].领料人,
value: response.data[i].领料人
})
}
})
},
getProductName() {
this.productNameValue = ''
this.productName = []
if (this.customerNameValue) {
var param = []
param[0] = ['订单流水号', this.customerNameValue]
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 returnMaterialChecked_check, customerNameValue_check, dateRange_check, production_check,
productNameValue_check, pickPeopleValue_check, pickListValue_check, typeValue_check
this.customerNameValue ? customerNameValue_check = 1 : customerNameValue_check = 0
this.typeValue ? typeValue_check = 1 : typeValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
this.production ? production_check = 1 : production_check = 0
this.pickListValue ? pickListValue_check = 1 : pickListValue_check = 0
this.pickPeopleValue ? pickPeopleValue_check = 1 : pickPeopleValue_check = 0
if (this.returnMaterialChecked === true) {
returnMaterialChecked_check = 1
} else {
returnMaterialChecked_check = 0
}
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['订单_check', customerNameValue_check]
param[3] = ['订单流水号', this.customerNameValue]
param[4] = ['产品_check', productNameValue_check]
param[5] = ['组件流水号', this.productNameValue]
param[6] = ['出库时间_check', dateRange_check]
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[1]]
param[9] = ['领料单_check', pickListValue_check]
param[10] = ['领料单号', this.pickListValue]
param[11] = ['领料人_check', pickPeopleValue_check]
param[12] = ['领料人', this.pickPeopleValue]
param[13] = ['退料_check', returnMaterialChecked_check]
param[14] = ['类型_check', typeValue_check]
param[15] = ['类型', this.typeValue]
var Data = this.CreateData('11', '仓储管理_出库记录_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log('出库记录查询数据', response.data)
this.tableData = response.data.rows
this.total = response.data.total
})
},
MaterialReturn(row) {
this.NumberValue = Number(row.领料数) - Number(row.退料数量)
this.form.数量 = Number(row.领料数) - Number(row.退料数量)
this.DeliveryNumber = row.出库记录流水号
this.dialogFormVisible = true
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['出库记录流水号', this.DeliveryNumber]
param[1] = ['退料数量', this.form.数量]
param[2] = ['退料人', 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.dialogFormVisible = false
} else {
this.$message.error('添加失败')
}
})
}
})
},
deleteRecord(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>
<style>
.ziduan {
width: 50px !important;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,701 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-col style="width: 921px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-cascader ref="cascader" :options="product" :show-all-levels="false" placeholder="产品名称" clearable size="small" @clear="clearData" @change="getData"/>
<el-input v-model="specificationsValue" style="width:200px" placeholder="名称/规格/型号" size="small" clearable @keyup.enter.native="pageCurrent=1;updateCheck()"/>
<el-button :disabled="disabled1" icon="el-icon-edit" type="primary" style="margin-left: 10px" plain size="small" @click="setUpInventory()">最低库存</el-button>
<el-button :disabled="disabled" type="distribution" icon="el-icon-check" size="small" @click="openOrder()">提交补货</el-button>
<el-checkbox v-model="checked" style="margin-left: 40px" @change="updateCheck">自制补货</el-checkbox>
<el-badge :value="numberReturnedItems" class="item">
<el-button type="text" size="small" style="margin-left: 70px" @click="viewReturnedContracts()">打回通知</el-button>
</el-badge>
</div>
<div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
:row-class-name="tableRowClassName"
:summary-method="getSummaries"
highlight-current-row
show-summary
border
size="small"
style="width: 921px"
height="740px"
@sort-change="sortChange"
@row-click="updateStock">
<el-table-column :width="setColumnWidth('序号')" style="width: 55px;" label="选入" align="center">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="selectIn(scope.row)"><svg-icon icon-class="右箭头" style="width: 20px;height: 20px"/></el-button>
</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="130px" label="名称" align="center" prop="物料名称" sortable="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="120px" 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" prop="库存" sortable="库存">
<template slot-scope="scope">
{{ scope.row.库存 }}
</template>
</el-table-column>
<el-table-column width="85px" label="补货中" align="center" prop="补货中" sortable="补货中">
<template slot-scope="scope">
{{ scope.row.补货中 }}
</template>
</el-table-column>
<el-table-column width="85px" label="需求量" align="center" prop="需求量" sortable="需求量">
<template slot-scope="scope">
{{ scope.row.需求量 }}
</template>
</el-table-column>
<el-table-column width="73px" label="最低库存" align="center" prop="最低库存">
<template slot-scope="scope">
{{ scope.row.最低库存 }}
</template>
</el-table-column>
<el-table-column label="补货数" align="center" prop="补货数">
<template slot-scope="scope">
<el-input-number v-model="scope.row.补货数" :min="1" size="mini" style="margin: 0;width: 100%"/>
</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-col>
<el-col style="width: 720px;margin-left: 30px">
<div style="margin-top: 7px">
<p v-if="!checked" style="margin-bottom: 0px;margin-left: 270px; font-size: 20px;font-weight:bold">外购件补货单</p>
<p v-if="checked" style="margin-bottom: 0px;margin-left: 270px;color: #919ae9;font-size: 20px;font-weight:bold">自制件补货单</p>
<el-table
v-loading="loading1"
ref="table1"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 661px"
height="740px">
<el-table-column :width="setColumnWidth('序号')" label="选出" align="center">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="deleteProduct(scope.row)"><svg-icon icon-class="箭头2" class="is-rotate" style="width: 20px;height: 20px"/></el-button>
</template>
</el-table-column>
<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="120px" 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" prop="补货数量">
<template slot-scope="scope">
{{ scope.row.补货数量 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="50">
<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="handlePicture(scope.row)"/>
</el-tooltip>
</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>
</el-col>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="最低库存" center width="300px">
<el-form ref="form" :model="form">
<el-form-item prop="最低库存">
<el-input-number v-model="form.最低库存" :min="0" :step="1" size="small" clearable style="width:200px;margin-left: 25px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff()"> </el-button>
<el-button type="primary" @click="submitStock()"> </el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="补货期限" center width="300px">
<el-date-picker
v-model="finishTime"
size="small"
align="center"
style="width: 100%"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
<el-input
:rows="3"
v-model="orderRemarks"
style="margin-top: 30px"
type="textarea"
placeholder="请输入订单备注!"/>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff()"> </el-button>
<el-button type="primary" @click="submitOrder()"> </el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="上传图片" center style="height: 800px" width="30%">
<el-upload
id="invoiceScan"
ref="upload"
:multiple="true"
:auto-upload="false"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
: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 @click="dialogFormVisible2=false">取消</el-button>
<el-button type="primary" style="width: 70px" @click="submitPicture()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleReturnContract" center width="1120px">
<div style="width: 100%;overflow: hidden">
<el-table
:data="tableData100"
:header-cell-style="{background: '#383E4B',color: 'white'}"
highlight-current-row
border
stripe
size="mini"
style="width: 1090px;margin-top: 10px;"
height="440px">
<el-table-column width="80px" label="序号" type="index" align="center"/>
<el-table-column width="150px" label="订单编号" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.订单编号 }}
</template>
</el-table-column>
<el-table-column width="150px" label="名称" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column width="180px" label="图号或型号" show-overflow-tooltip 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="200px" 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 label="打回日期" align="center">
<template slot-scope="scope">
{{ scope.row.打回日期 }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { url } from '@/utils/request'
export default {
data() {
return {
tableData100: [],
numberReturnedItems: '',
orderRemarks: '',
checked: false,
showInput: false,
disabled: true,
disabled1: true,
stockValue: '', // 累计库存流水号
number: '',
specificationsValue: '', // 规格型号
loading: false, // 数据加载
loading1: false, // 数据加载
dialogFormVisible: false,
dialogFormVisible2: false,
dialogFormVisibleReturnContract: false,
form: {
最低库存: ''
},
product: [], // 产品名称数组
productValue: '',
finishTime: '',
limit: 5,
Data: {},
upload: url,
dialogFormVisible1: false,
total: 0, // 分页总数
tableData: [],
tableData1: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
})
},
created() {
this.searchTable()
this.searchNumber()
this.getTreeData()
},
methods: {
getData(val) {
this.pageCurrent = 1
this.productValue = val[val.length - 1]
this.updateCheck()
},
clearData() {
this.pageCurrent = 1
this.productValue = ''
this.updateCheck()
},
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
},
viewReturnedContracts() {
this.dialogFormVisibleReturnContract = true
this.searchTable100()
this.updateNumber()
},
searchTable100() {
var param = []
var Data = this.CreateData('11', '仓储管理_补货订单打回_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData100 = response.data
})
},
updateNumber() {
var param = []
var Data = this.CreateData('12', '仓储管理_补货订单打回_查看', param)
this.ExecDatabase(Data).then(response => {
this.searchNumber()
})
},
searchNumber() {
var param = []
var Data = this.CreateData('11', '仓储管理_补货订单打回_未查看数量', param)
this.ExecDatabase(Data).then(response => {
this.numberReturnedItems = response.data[0].数量
})
},
sortChange(column) {
if (column.prop === '物料名称') {
this.orderName = 1
} else if (column.prop === '图号或型号') {
this.orderName = 2
} else if (column.prop === '库存') {
this.orderName = 3
} else if (column.prop === '补货中') {
this.orderName = 4
} else if (column.prop === '需求量') {
this.orderName = 5
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
warningExceed() {
this.$message.error('仅可上传五张照片')
},
beforeUpload(file) { // 上传前检测
const isJPG = /^image\/.*/.test(file.type)
if (!isJPG) {
this.$message.error('只能上传图片。。')
}
return isJPG
},
uploadSuccess(res) { // 上传成功回调
this.dialogFormVisible2 = false
this.$refs.upload.clearFiles()
},
setUpInventory() {
this.dialogFormVisible = true
},
openOrder() {
this.finishTime = ''
this.dialogFormVisible1 = true
},
handlePicture(row) {
this.dialogFormVisible2 = true
this.replenishmentOrderId = row.补货单明细中间表流水号
// this.PersonId = row.人员编号
},
submitPicture() {
let check
this.checked ? check = 0 : check = 1
var param = []
param[0] = ['补货单明细中间表流水号', this.replenishmentOrderId]
param[1] = ['是否外购', check]
param[2] = ['文件名称', '']
param[3] = ['文件后缀', '']
param[4] = ['文件内容', null]
var Data1 = this.CreateData('15', '补货单_上传图片', param)
this.Data.param = Data1
this.$refs.upload.submit()
this.dialogFormVisible2 = false
},
submitOrder() {
if (this.finishTime) {
let check
this.checked ? check = 0 : check = 1
var param = []
param[0] = ['是否外购', check]
param[1] = ['操作者', this.id]
param[2] = ['补货期限', this.finishTime]
param[3] = ['订单备注', this.orderRemarks]
var Data = this.CreateData('12', '报缺补货_提交', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('提交成功')
this.dialogFormVisible1 = false
this.updateCheck()
} else {
this.$message.error('提交失败')
}
})
} else {
this.$message.warning('请选择补货期限')
}
},
selectIn(row) {
if (row.补货数 !== 0 && row.补货数 !== undefined) {
let check
this.checked ? check = 0 : check = 1
var param = []
param[0] = ['累计库存流水号', row.累计库存流水号]
param[1] = ['补货数', row.补货数]
param[2] = ['物料流水号', row.物料流水号]
param[3] = ['是否外购', check]
var Data = this.CreateData('12', '报缺补货_选入', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.updateCheck()
this.$message.success('选入成功')
} else {
this.$message.error('选入失败')
}
})
} else {
this.$message.warning('补货数不能为0或空')
}
},
deleteProduct(row) {
let check
this.checked ? check = 0 : check = 1
var param = []
param[0] = ['补货单明细中间表流水号', row.补货单明细中间表流水号]
param[1] = ['是否外购', check]
param[2] = ['补货数量', row.补货数量]
var Data = this.CreateData('12', '报缺补货_选出', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.updateCheck()
this.$message.success('移出成功')
} else {
this.$message.error('移出失败')
}
})
},
updateStock(row) {
this.stockValue = row.累计库存流水号
this.form.最低库存 = Number(row.最低库存)
this.disabled1 = false
},
callOff() {
this.dialogFormVisible = false
this.dialogFormVisible1 = false
},
submitStock() {
if (this.form.最低库存 !== '' && this.form.最低库存 !== undefined) {
var param = []
param[0] = ['累计库存流水号', this.stockValue]
param[1] = ['类型流水号', 1]
param[2] = ['最低库存', this.form.最低库存]
var Data = this.CreateData('12', '最低库存_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.updateCheck()
this.dialogFormVisible = false
this.$message.success('编辑成功')
} else {
this.$message.error('编辑失败')
}
})
} else {
this.$message.warning('不能为空')
}
},
tableRowClassName({ row, rowIndex }) {
if (Number(row.库存预警) === 0) {
if (row.补货类型 === '外购') {
return 'Outsourcing'
}
} else if (Number(row.库存预警) === 1) {
return 'red'
} else if (Number(row.库存预警) === 2) {
return 'yellow'
}
},
updateCheck() {
if (this.checked) {
this.searchTable1()
} else {
this.searchTable()
}
this.disabled1 = true
},
searchTable() {
let specificationsValue_check, product_check
this.specificationsValue ? specificationsValue_check = 1 : specificationsValue_check = 0
this.productValue ? product_check = 1 : product_check = 0
var param = []
param[0] = ['品名', this.specificationsValue]
param[1] = ['品名_check', specificationsValue_check]
param[2] = ['产品', this.productValue]
param[3] = ['产品_check', product_check]
param[4] = ['排序名称', this.orderName]
param[5] = ['排序方式', this.order]
var Data = this.CreateData('11', '仓储管理_报缺补货_外购件_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log(response.data.rows, 2222)
this.tableData = response.data.rows
this.total = response.data.total
})
var param1 = []
var Data1 = this.CreateData('11', '仓储管理_外购补货中间表_查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData1 = response.data
if (response.data.length === 0) {
this.disabled = true
} else {
this.disabled = false
}
})
},
searchTable1() {
let specificationsValue_check, product_check
this.specificationsValue ? specificationsValue_check = 1 : specificationsValue_check = 0
this.productValue ? product_check = 1 : product_check = 0
var param = []
param[0] = ['品名', this.specificationsValue]
param[1] = ['品名_check', specificationsValue_check]
param[2] = ['产品', this.productValue]
param[3] = ['产品_check', product_check]
param[4] = ['排序名称', this.orderName]
param[5] = ['排序方式', 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
})
var param1 = []
var Data1 = this.CreateData('11', '仓储管理_自制补货中间表_查询', param1)
this.ExecDatabase(Data1).then(response => {
this.tableData1 = response.data
if (response.data.length === 0) {
this.disabled = true
} else {
this.disabled = false
}
})
},
// 表格统计1
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
} else if (index === 5) {
const values = data.map(item => Number(item[column.property]))
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]
} else {
sums[index] = 'N/A'
}
} else if (index === 6) {
const values = data.map(item => Number(item[column.property]))
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]
} else {
sums[index] = 'N/A'
}
} else if (index === 7) {
const values = data.map(item => Number(item[column.property]))
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]
} else {
sums[index] = 'N/A'
}
} else if (index === 8) {
const values = data.map(item => Number(item[column.property]))
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]
} else {
sums[index] = 'N/A'
}
}
})
return sums
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.updateCheck()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.updateCheck()
}
}
}
</script>
<style>
.is-rotate {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.Outsourcing {
background: #D9FFFF!important;
}
.red {
background: #e88383!important;
}
.yellow {
background: yellow!important;
}
</style>

View File

@@ -0,0 +1,308 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-row>
<div style="margin-top: 7px; margin-bottom: 7px">
<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="pageSize=100;pageCurrent=1;searchTable()"/>
<el-select v-model="orderValue" style="width:200px" placeholder="补货单号" size="small" filterable clearable @change="pageSize=100;pageCurrent=1;searchTable()">
<el-option
v-for="item in orderArray"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="replenishmentStatusValue" style="width:100px;margin-right: 0" placeholder="补货状态" size="small" filterable clearable @change="pageSize=100;pageCurrent=1;searchTable()">
<el-option
v-for="item in replenishmentStatus"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="replenishmentManValue" style="width:100px" placeholder="补货人" size="small" clearable @keyup.enter.native="pageSize=100;pageCurrent=1;searchTable()"/>
</div>
<el-col style="margin-left: 7px;width: 691px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
:data="tableData"
highlight-current-row
border
stripe
size="mini"
style="width: 691px;margin-top: 10px"
height="750"
@sort-change="sortChange"
@row-click="searchTable1">
<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="补货单号">
<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="150px" 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">
<el-button
:disabled="Number(scope.row.是否下达) === 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(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-card>-->
</el-col>
<el-col style="margin-left: 30px;width: 551px">
<!-- <el-card>-->
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="mini"
style="width: 551px;margin-top: 10px"
height="750">
<el-table-column :width="setColumnWidth('序号')" label="序号" type="index" align="center" prop="序号"/>
<el-table-column width="70px" label="状态" align="center" prop="">
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column width="200px" 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>
</div>
<!-- </el-card>-->
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
orderArray: [],
orderValue: '',
replenishmentStatusValue: '', // 补货状态
replenishmentStatus: [{
value: '订单下达',
label: '订单下达'
}, {
value: '技术确认',
label: '技术确认'
}, {
value: '采购',
label: '采购'
}, {
value: '自制',
label: '自制'
}, {
value: '装配中',
label: '装配中'
}, {
value: '装配完成',
label: '装配完成'
}, {
value: '入库',
label: '入库'
}], // 补货状态数组
replenishmentManValue: '', // 补货人
dateRange: '', // 提交日期
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.searchTable()
this.getOrder()
},
methods: {
getOrder() {
this.orderArray = []
var param = []
var Data = this.CreateData('11', '仓库管理_报缺补货单_查询', 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].订单流水号
})
}
})
},
searchTable() {
this.tableData1 = []
let replenishmentStatusValue_check, dateRange_check, replenishmentManValue_check, orderValue_check
this.replenishmentStatusValue ? replenishmentStatusValue_check = 1 : replenishmentStatusValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.replenishmentManValue ? replenishmentManValue_check = 1 : replenishmentManValue_check = 0
this.orderValue ? orderValue_check = 1 : orderValue_check = 0
var param = []
param[0] = ['补货状态', this.replenishmentStatusValue]
param[1] = ['补货状态_check ', replenishmentStatusValue_check]
param[2] = ['补货人', this.replenishmentManValue]
param[3] = ['补货人_check', replenishmentManValue_check]
param[4] = ['开始时间', this.dateRange[0]]
param[5] = ['结束时间', this.dateRange[1]]
param[6] = ['补货日期_check', dateRange_check]
param[7] = ['订单流水号', this.orderValue]
param[8] = ['补货单号_check', orderValue_check]
param[9] = ['排序名称', this.orderName]
param[10] = ['排序方式', this.order]
var Data = this.CreateData('11', '仓储管理_补货信息_查询', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
console.log('补货信息查询', response.data)
this.tableData = response.data.rows
this.total = response.data.total
})
},
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()
},
searchTable1(row) {
var param = []
param[0] = ['订单流水号', row.订单流水号]
param[1] = ['订单类型', row.订单类型]
var Data = this.CreateData('11', '仓储管理_补货明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
handleDelete(row) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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.searchTable()
this.tableData1 = []
} 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,510 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px">
<el-input v-model="production" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="物料名称/编号/规格/型号" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable()"/>
<el-input v-model="purchaseNumber" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="采购合同编号" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable()"/>
<el-input v-model="supplier" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="供应商" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable()"/>
<span style="font-size: 17px;color: black ; margin-left: 10px">时间</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=20;searchTable()"/>
<el-button style="margin-left: 10px" type="success" icon="el-icon-bottom" plain size="small" @click="selectIn()">选入</el-button>
</div>
<div style="margin-top: 10px">
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1300px"
height="400px"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="60px" label="序号" type="index" align="center"/>
<el-table-column width="80px" label="类型" align="center">
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column width="150px" label="物料名称" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="150px" label="图号或型号" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column width="150px" label="供应商" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column width="130px" label="采购合同" show-overflow-tooltip 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="200px" 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 label="退货时间" align="center">
<template slot-scope="scope">
{{ scope.row.退货时间 }}
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="12">
<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 :span="12">
<el-button style="margin-left: 20px" type="danger" icon="el-icon-delete" size="small" plain @click="deleteData()">清空</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="printReceiptDoc1()">打印退货单</el-button>
</el-col>
</el-row>
</div>
<div style="margin-top: 0">
<el-table
v-loading="loading"
ref="table"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1561px"
height="340px"
@selection-change="handleSelectionChange1">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="60px" label="序号" type="index" align="center"/>
<el-table-column width="80px" label="类型" align="center">
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column width="150px" label="物料名称" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="150px" label="图号或型号" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.图号或型号 }}
</template>
</el-table-column>
<el-table-column width="150px" label="供应商" show-overflow-tooltip align="center">
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column width="130px" label="采购合同" show-overflow-tooltip 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="200px" 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 label="退货时间" align="center">
<template slot-scope="scope">
{{ scope.row.退货时间 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="操作" placement="top">
<el-button type="text" icon="el-icon-edit" size="small" @click="editData(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="操作" placement="top">
<el-button type="text" icon="el-icon-delete" size="small" @click="deleteData1(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="修改数量" center width="390px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="数量:" prop="数量">
<el-input v-model="form.数量" clearable size="small" style="width:200px" placeholder="请输入数量"/>
</el-form-item>
</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>
</el-card>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD" style="width: 840px;margin: 0 auto">
<div style="width: 260px;margin: 0 auto 20px">
<!-- 调整这一个即可解决 打印出来表头布局中的问题-->
<h3>浙江景耀数控采购退货单</h3>
</div>
<div style="margin: 0 0 20px">
<span style="float: left;margin-left: 10px;font-size: 14px">供应商{{ supplierSelectionName }}</span>
<span style="float: right; font-size: 14px;margin-right: 10px">采购单号{{ contractNumber }}</span>
<span style="float: right;margin-right: 60px;font-size: 14px; width: 130px">日期{{ NowTime }}</span>
</div>
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">物料编码</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">物料名称</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">规格型号</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">仓库</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">数量</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">采购备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">{{ list.物料编码 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">{{ list.物料名称 }}</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">{{ list.规格型号 }}</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">{{ list.库位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.数量 }}</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">{{ list.采购备注 }}</td>
</tr>
<tr style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">合计</td>
<td colspan="17" style="text-align: center;width: 85%">
<div>
<span style="float: right;margin-right: 24%;font-size: 14px">{{ Number(totalAmount) }}</span>
</div>
</td>
</tr>
</table>
<div style="margin-top: 15px"><span style="margin-left: 10px;font-size: 14px">审核</span><span style="margin-left: 15%;font-size: 14px">记账</span><span style="margin-left: 15%;font-size: 14px">验收</span><span style="margin-left: 15%;font-size: 14px">保管</span><span style="margin-left: 15%;font-size: 14px">制单</span></div>
</div>
</el-card>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import $ from 'jquery'
import { getNowDAY } from '../../../utils'
export default {
data() {
return {
NowTime: getNowDAY(),
dateRange: '', // 提交日期
production: '',
purchaseNumber: '',
supplier: '',
multipleSelection: [],
multipleSelection_variable: [],
multipleSelection1: [],
form: {
数量: ''
},
rules: {
数量: [{ required: true, message: '请输入数量' }]
},
returns: [],
supplierSelectionName: '',
contractNumber: '',
totalAmount: 0,
dialogFormVisible: false,
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [],
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '' // 排序方式
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.searchTable1()
this.searchTable()
},
methods: {
handleSelectionChange1(val1) {
this.multipleSelection1 = val1
},
searchTable1() {
this.loading = true
this.tableData1 = []
var param = []
var Data = this.CreateData('11', '仓储管理_退货记录打印明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
this.loading = false
})
},
selectIn() {
var orderNumber, purchaseContract, orderName
if (this.multipleSelection.length !== 0) {
const processGroup = []
const numberGroup = []
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
processGroup[i] = this.multipleSelection_variable[i].退货记录流水号
numberGroup[i] = this.multipleSelection_variable[i].退货数量
if (this.multipleSelection_variable.length !== 1) {
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
if (i === 0) {
orderNumber = this.multipleSelection_variable[i].图号或型号
orderName = this.multipleSelection_variable[i].物料名称
purchaseContract = this.multipleSelection_variable[i].采购合同
} else {
if (orderNumber !== this.multipleSelection_variable[i].图号或型号 || orderName !== this.multipleSelection_variable[i].物料名称 || purchaseContract !== this.multipleSelection_variable[i].采购合同) {
this.$message.warning('请选择正确的订单')
return
}
}
}
}
}
var param = []
param[0] = ['退货记录流水号组', processGroup]
param[1] = ['数量组', numberGroup]
var Data = this.CreateData('12', '仓储管理_退货记录打印明细_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
this.searchTable1()
} else {
this.$message.success('选入失败')
}
})
} else {
this.$message.warning('请选择订单')
}
},
editData(row) {
this.form.数量 = Number(row.数量)
this.DeliveryNumber = row.退货记录流水号
this.dialogFormVisible = true
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['退货记录流水号', this.DeliveryNumber]
param[1] = ['数量', this.form.数量]
var Data = this.CreateData('12', '仓储管理_退货记录打印明细_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable1()
this.dialogFormVisible = false
} else {
this.$message.error('修改失败')
}
})
}
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
deleteData() {
var param = []
var Data = this.CreateData('12', '仓储管理_退货记录打印明细_清空', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable1()
} else {
this.$message.error('删除失败')
}
})
},
deleteData1(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['id', row.id]
var Data = this.CreateData('12', '仓储管理_退货记录打印明细_删除', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable1()
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
async printReceiptDoc1() {
const aa = this.printReceiptDoc()
if (aa === 2) {
await this.sleep(500)
await this.exportTable()
} else if (aa === 1) {
this.$message.warning('所选的物料采购合同和供应商不同!!')
}
},
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
},
exportTable() {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
},
printReceiptDoc() {
this.returns = []
var number, caigou
if (this.multipleSelection1.length !== 0) {
if (this.multipleSelection1.length !== 1) {
for (let i = 0; i < this.multipleSelection1.length; i++) {
if (i === 0) {
number = this.multipleSelection1[i].供应商
caigou = this.multipleSelection1[i].采购合同
} else {
if (number !== this.multipleSelection1[i].供应商 || caigou !== this.multipleSelection1[i].采购合同) {
return 1
}
}
}
}
this.supplierSelectionName = this.multipleSelection1[0].供应商
this.contractNumber = this.multipleSelection1[0].采购合同
this.totalAmount = 0
for (let i = 0; i < this.multipleSelection1.length; i++) {
this.totalAmount = this.totalAmount + Number(this.multipleSelection1[i].退货数量)
this.returns.push({
物料编码: this.multipleSelection1[i].物料编码,
物料名称: this.multipleSelection1[i].物料名称,
规格型号: this.multipleSelection1[i].图号或型号,
单位: this.multipleSelection1[i].单位,
数量: this.multipleSelection1[i].数量,
采购备注: '',
库位: '采购仓库'
})
}
return 2
} else {
this.$message.warning('未勾选物料!!')
return 1
}
},
searchTable() {
let dateRange_check, production_check, purchaseNumber_check, supplier_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.production ? production_check = 1 : production_check = 0
this.purchaseNumber ? purchaseNumber_check = 1 : purchaseNumber_check = 0
this.supplier ? supplier_check = 1 : supplier_check = 0
var param = []
param[0] = ['物料名称_check', production_check]
param[1] = ['物料名称', this.production]
param[2] = ['采购合同_check', purchaseNumber_check]
param[3] = ['采购合同', this.purchaseNumber]
param[4] = ['供应商_check', supplier_check]
param[5] = ['供应商', this.supplier]
param[6] = ['时间_check', dateRange_check]
param[7] = ['开始时间', this.dateRange[0]]
param[8] = ['结束时间', this.dateRange[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
})
},
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,854 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<el-tabs
v-model="PartType"
style="height: 850px"
type="border-card"
@tab-click="pageCurrent=1;pageCurrent1=1;getData()">
<el-tab-pane label="调拨单查询" name="调拨单查询">
<el-col style="width: 701px">
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black">调拨日期</span>
<el-date-picker
v-model="dateRange"
align="center"
end-placeholder="结束日期"
format="yyyy-MM-dd"
range-separator=""
size="small"
start-placeholder="开始日期"
style="width: 240px;"
type="daterange"
value-format="yyyy-MM-dd"
@change="searchTable"/>
<el-select
v-model="outsourcingManufacturersValue"
clearable
filterable
placeholder="外协厂家"
size="small"
style="width:100px"
@change="pageCurrent=1;getTransferNotes();searchTable()">
<el-option
v-for="item in outsourcingManufacturers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="selectTheDialListValue"
clearable
filterable
placeholder="调拨单号"
size="small"
style="width:150px"
@change="pageCurrent=1;searchTable()">
<el-option
v-for="item in transferNotes"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</div>
<div>
<el-table
v-loading="loading"
:data="tableData"
border
height="700px"
highlight-current-row
size="small"
stripe
style="width: 751px"
@row-click="searchTable2">
<el-table-column :width="setColumnWidth('状态')" align="center" label="调拨状态">
<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="调拨日期" prop="调拨日期">
<template slot-scope="scope">
{{ scope.row.调拨日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="调拨备注" prop="调拨备注">
<template slot-scope="scope">
{{ scope.row.调拨备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="115px">
<template slot-scope="scope">
<el-tooltip :open-delay="500" content="查看图片" effect="dark" placement="top">
<el-button
icon="el-icon-picture-outline"
size="mini"
style="margin-right: 10px"
type="text"
@click="handlePicture(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="500" content="打印调拨单" effect="dark" placement="top">
<el-button
icon="el-icon-printer"
size="mini"
style="margin-right: 10px"
type="text"
@click="exportTable()"/>
</el-tooltip>
<el-tooltip :open-delay="500" content="删除调拨单" effect="dark" placement="top">
<el-button
:disabled="(Number(scope.row.单据状态) > 1) || (jobNumber != '1002')"
icon="el-icon-delete"
size="mini"
type="text"
@click="handleDelete(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 100]"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
</div>
</el-col>
<el-col style="width: 951px;margin-left: 10px">
<div style="margin-top: 45px">
<el-table
v-loading="loading"
ref="table"
:data="tableData2"
:header-cell-style="{background: '#2283D4',color: 'white'}"
border
highlight-current-row
show-summary
size="small"
stripe
style="width: 946px">
<!-- <el-table-column :width="setColumnWidth('序号')" label="选出" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="mini" @click="deleteProduct(scope.row)"><svg-icon icon-class="箭头2" class="is-rotate" style="width: 20px;height: 20px"/></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="状态" prop="状态" width="55px">
<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="工序">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('单位')" align="center" label="单位" prop="单位">
<template slot-scope="scope">
{{ scope.row.单位 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="数量" prop="调拨数量">
<template slot-scope="scope">
{{ scope.row.调拨数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="外协价格" prop="外协价格" width="90px">
<template slot-scope="scope">
{{ scope.row.外协价格 }}
</template>
</el-table-column>
<el-table-column align="center" label="总价" prop="总价" width="90px">
<template slot-scope="scope">
{{ scope.row.调拨数量 * scope.row.外协价格 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="到货数" prop="已到货数量">
<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('日期')" align="center" label="到货日期">
<template slot-scope="scope">
{{ scope.row.到货日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="90px">
<template slot-scope="scope">
<el-button icon="el-icon-edit" size="mini" type="text" @click="editProduct(scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-tab-pane>
<el-tab-pane label="调拨件查询" name="调拨件查询">
<div style="margin-top: 7px; margin-bottom: 7px">
<span style="font-size: 13px;color: black">调拨日期</span>
<el-date-picker
v-model="dateRange"
align="center"
end-placeholder="结束时间"
format="yyyy-MM-dd"
range-separator=""
size="small"
start-placeholder="开始时间"
style="width: 240px;"
type="daterange"
value-format="yyyy-MM-dd"
@change="searchTable1"/>
<el-select
v-model="outsourcingManufacturersValue"
clearable
filterable
placeholder="外协厂家"
size="small"
style="width:150px;margin-right: 0"
@change="searchTable1()">
<el-option
v-for="item in outsourcingManufacturers"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="orderNumberValue"
:remote-method="getOrderNumberValue"
clearable
filterable
remote
placeholder="订单号"
size="small"
style="width:150px;margin-right: 0"
@change="searchTable1();getProductPartName()">
<el-option
v-for="item in orderNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="productPartNameValue"
clearable
filterable
placeholder="产品/部件名称"
size="small"
style="width:100px;margin-right: 0"
@change="searchTable1()">
<el-option
v-for="item in productPartName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="transferStatusValue"
clearable
filterable
placeholder="调拨状态"
size="small"
style="width:100px"
@change="searchTable1()">
<el-option
v-for="item in transferStatus"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input
v-model="partName"
clearable
placeholder="工件名称"
size="small"
style="width: 200px"
@keyup.enter.native="searchTable1()"/>
<el-input
v-model="partNumber"
clearable
placeholder="图号"
size="small"
style="width: 200px"
@keyup.enter.native="searchTable1()"/>
</div>
<div style="width: 1521px">
<el-table
v-loading="loading"
ref="table1"
:data="tableData1"
border
height="700px"
highlight-current-row
show-summary
size="small"
stripe
style="width: 1601px"
@sort-change="sortChange">
<el-table-column :width="setColumnWidth('状态')" align="center" label="状态" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.状态 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="工件名称"
prop="工件名称"
show-overflow-tooltip
sortable="工件名称"
width="160px">
<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('工序')" align="center" 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('数量')" align="center" label="调拨数" prop="调拨数量">
<template slot-scope="scope">
{{ scope.row.调拨数量 }}
</template>
</el-table-column>
<el-table-column :width="setColumnWidth('数量')" align="center" label="到货数" prop="已到货数量">
<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('日期')" align="center" label="任务生成">
<template slot-scope="scope">
{{ scope.row.任务生成 }}
</template>
</el-table-column>
<el-table-column align="center" label="调拨日期" prop="调拨日期" sortable="调拨日期" width="110px">
<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('调拨单号')" align="center" 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('工件名称')" align="center" label="产品部件名称">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-size="pageSize1"
:page-sizes="[10, 20, 30, 40, 100]"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges1"
@current-change="handleCurrentChanges1"/>
</div>
</div>
</el-tab-pane>
</el-tabs>
</el-card>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD" style="width: 880px;margin: 0 auto">
<div style="width: 117px;margin: 0 auto 20px">
<!-- 调整这一个即可解决 打印出来表头布局中的问题-->
<h3>仓库调拨单</h3>
</div>
<div style="margin-bottom: 10px">
<span style="float: left;margin-left: 10px;font-size: 16px">日期{{ date }}</span><span
style="float: right;font-size: 16px;margin-right: 20px">编号{{ number }}</span>
</div>
<table align="center" border="1 solid black" cellspacing="0px" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">物料代码</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">物料名称</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">规格型号</td>
<td colspan="2" style="text-align: center;width: 10%;font-size: 16px">调出仓库</td>
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">调入仓库</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">单价</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">数量</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">总价</td>
<td colspan="2" style="text-align: center;width: 8%;font-size: 16px">备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">{{ list.物料代码 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">{{ list.物料名称 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">{{ list.规格型号 }}</td>
<td colspan="2" style="text-align: center;width: 10%;font-size: 16px">{{ list.调出仓库 }}</td>
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">{{ list.调入仓库 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{ list.外协价格 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{ list.数量 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{
list.数量 * list.外协价格
}}
</td>
<td colspan="2" style="text-align: center;width: 5%;font-size: 16px">{{ list.备注 }}</td>
</tr>
</table>
<div style="margin-top: 20px"><span style="margin-left: 10px;font-size: 16px">审核</span><span
style="margin-left: 15%;font-size: 16px">记账</span><span
style="margin-left: 15%;font-size: 16px">验收</span><span
style="margin-left: 15%;font-size: 16px">保管</span><span
style="margin-left: 15%;font-size: 16px">制单</span></div>
</div>
</el-card>
</div>
</el-card>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" center style="" title="图片" width="600px">
<el-image
v-for="url in urls"
:key="url"
:preview-src-list="urls"
:src="url"
lazy
style="width: 500px; height: 500px"/>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible3" center title="编辑" width="360px">
<el-form ref="form" :model="form" class="demo-ruleForm" label-position="center" label-width="100px">
<el-form-item label="外协价格">
<el-input v-model="form.外协价格" clearable size="small" style="width:150px;" type="number"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.备注" clearable size="small" style="width:150px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogFormVisible3=false">取消</el-button>
<el-button size="small" type="distribution" @click="submitUpdate()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import $ from 'jquery'
import Cookie from 'js-cookie'
export default {
data() {
return {
type: '',
date: '',
number: '',
PartType: '调拨单查询',
returns: [],
partName: '',
partNumber: '',
outsourcingManufacturersValue: '', // 外协厂家
outsourcingManufacturers: [], // 外协厂家数组
orderNumberValue: '', // 订单号
orderNumber: [], // 订单号数组
selectTheDialListValue: '',
transferNotes: [],
productPartNameValue: '', // 产品部件名称
productPartName: [], // 产品部件名称数组
transferStatusValue: '', // 调拨状态
transferStatus: [], // 调拨状态数组
checked: false,
showInput: false,
dialogFormVisible: false,
dialogFormVisible3: false,
NumberValue: '',
waixiechangjia: '',
materialValue: '',
form: {
外协价格: '',
备注: ''
},
urls: [],
dateRange: '', // 提交日期
loading: false, // 数据加载
total: 0, // 分页总数
total1: 0, // 分页总数
tableData: [],
tableData1: [],
tableData2: [],
pageCurrent: 1, // 分页当前页
pageSize: 50, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
pageSize1: 50, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
jobNumber: 0
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
this.$refs['table1'].doLayout()
})
},
created() {
this.getOrderNumberValue('')
this.getTransferStatus()
this.getOutsourcingManufacturers()
this.searchTable()
this.jobNumber = Cookie.get('jobNumber')
},
methods: {
editProduct(row) {
this.form.外协价格 = row.外协价格
this.form.备注 = row.备注
this.materialValue = row.外协调拨单明细流水号
this.dialogFormVisible3 = true
},
submitUpdate() {
var param = []
param[0] = ['外协调拨单明细流水号', this.materialValue]
param[1] = ['外协价格', this.form.外协价格]
param[2] = ['备注', this.form.备注]
var Data = this.CreateData('12', '仓储管理_外协调拨单明细_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
var param = []
param[0] = ['外协调拨单流水号', this.NumberValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.returns = []
for (let i = 0; i < response.data.length; i++) {
this.returns.push({
物料代码: response.data[i].物料编码,
物料名称: response.data[i].工件名称,
规格型号: response.data[i].图号,
调出仓库: '精工车间',
调入仓库: this.waixiechangjia,
单位: response.data[i].单位,
外协价格: response.data[i].外协价格 ? response.data[i].外协价格 : 0,
数量: response.data[i].调拨数量,
备注: response.data[i].备注
})
}
console.log(this.returns, 222)
this.tableData2 = response.data
})
this.dialogFormVisible3 = false
} else {
this.$message.error('编辑失败')
}
})
},
exportTable() {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
},
// 外协厂家查询
getOutsourcingManufacturers() {
var param = []
var Data = this.CreateData('11', '外协厂家_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.outsourcingManufacturers.push({
label: response.data[i].外协厂家简称,
value: response.data[i].外协厂家流水号
})
}
})
},
getTransferNotes() {
this.transferNotes = []
this.selectTheDialListValue = ''
if (this.outsourcingManufacturersValue) {
var param = []
param[0] = ['外协厂家流水号', this.outsourcingManufacturersValue]
var Data = this.CreateData('11', '仓储管理_外协调拨单列表_全部查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.transferNotes.push({
label: response.data[i].调拨单号,
value: response.data[i].外协调拨单流水号
})
}
})
}
},
getOrderNumberValue(query) {
this.orderNumber = []
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.orderNumber.push({
label: response.data[i].订单编号,
value: response.data[i].订单流水号
})
}
})
},
getProductPartName() {
this.productPartName = []
this.productPartNameValue = ''
if (this.orderNumberValue) {
var param = []
param[0] = ['订单流水号', this.orderNumberValue]
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].组件流水号
})
}
})
}
},
getTransferStatus() {
var param = []
var Data = this.CreateData('11', '仓储管理_外协调拨单状态_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.transferStatus.push({
label: response.data[i].调拨状态,
value: response.data[i].调拨状态
})
}
})
},
getData() {
if (this.PartType === '调拨单查询') {
this.searchTable()
} else if (this.PartType === '调拨件查询') {
this.searchTable1()
}
},
searchTable() {
let outsourcingManufacturersValue_check, dateRange_check, selectTheDialListValue_check
this.outsourcingManufacturersValue ? outsourcingManufacturersValue_check = 1 : outsourcingManufacturersValue_check = 0
this.selectTheDialListValue ? selectTheDialListValue_check = 1 : selectTheDialListValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['外协厂家流水号', this.outsourcingManufacturersValue]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['外协厂家_check', outsourcingManufacturersValue_check]
param[4] = ['调拨日期_check', dateRange_check]
param[5] = ['调拨单号_check', selectTheDialListValue_check]
param[6] = ['调拨单号流水号', this.selectTheDialListValue]
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
})
},
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()
this.tableData2 = []
} else {
this.$message.error('删除失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchTable2(row) {
console.log('调拨查询调拨单信息', row)
this.date = row.调拨日期
this.number = row.调拨单号
this.NumberValue = row.外协调拨单流水号
this.waixiechangjia = row.外协厂家
var AA = row.外协厂家
var param = []
param[0] = ['外协调拨单流水号', row.外协调拨单流水号]
var Data = this.CreateData('11', '仓储管理_外协调拨单明细_查询', param)
this.ExecDatabase(Data).then(response => {
this.returns = []
for (let i = 0; i < response.data.length; i++) {
this.returns.push({
物料代码: response.data[i].物料编码,
物料名称: response.data[i].工件名称,
规格型号: response.data[i].图号,
调出仓库: '精工车间',
调入仓库: AA,
单位: response.data[i].单位,
外协价格: response.data[i].外协价格 ? response.data[i].外协价格 : 0,
数量: response.data[i].调拨数量,
备注: response.data[i].备注
})
}
this.tableData2 = response.data
})
},
searchTable1() {
let outsourcingManufacturerValue_check, dateRange_check, orderNumberValue_check, productPartNameValue_check,
transferStatusValue_check, partName_check, partNumber_check
this.outsourcingManufacturersValue ? outsourcingManufacturerValue_check = 1 : outsourcingManufacturerValue_check = 0
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.orderNumberValue ? orderNumberValue_check = 1 : orderNumberValue_check = 0
this.productPartNameValue ? productPartNameValue_check = 1 : productPartNameValue_check = 0
this.transferStatusValue ? transferStatusValue_check = 1 : transferStatusValue_check = 0
this.partName ? partName_check = 1 : partName_check = 0
this.partNumber ? partNumber_check = 1 : partNumber_check = 0
var param = []
param[0] = ['外协厂家流水号', this.outsourcingManufacturersValue]
param[1] = ['订单流水号', this.orderNumberValue]
param[2] = ['组件流水号', this.productPartNameValue]
param[3] = ['调拨状态', this.transferStatusValue]
param[4] = ['开始时间', this.dateRange[0]]
param[5] = ['结束时间', this.dateRange[1]]
param[6] = ['外协厂家_check', outsourcingManufacturerValue_check]
param[7] = ['调拨日期_check', dateRange_check]
param[8] = ['订单号_check', orderNumberValue_check]
param[9] = ['产品名称_check', productPartNameValue_check]
param[10] = ['调拨状态_check', transferStatusValue_check]
param[11] = ['排序名称', this.orderName]
param[12] = ['排序方式', this.order]
param[13] = ['工件名称_check', partName_check]
param[14] = ['工件名称', this.partName]
param[15] = ['图号_check', partNumber_check]
param[16] = ['图号', this.partNumber]
var Data = this.CreateData('11', '仓储管理_外协调拨件_查询', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
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()
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
},
handleSizeChanges1(val) {
this.pageCurrent1 = 1
this.pageSize1 = val
this.searchTable1()
},
handleCurrentChanges1(val) {
this.pageCurrent1 = val
this.searchTable1()
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-card__body {
padding: 0px !important;
}
</style>

View File

@@ -0,0 +1,326 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="workpieceName" style="width:200px" placeholder="工件名称" size="small" clearable @keyup.enter.native="searchTable()"/>
<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="searchTable()"/>
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 20px" @click="exportExcel()">导出</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="printReceiptDoc1()">打印入库单</el-button>
</div>
<div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 961px"
height="750px"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="150px" 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="180px" label="工件名称" prop="工件名称" align="center">
<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="90px" 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" show-overflow-tooltip>
<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-card>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD1" style="width: 840px;margin: 0 auto">
<div style="width: 260px;margin: 0 auto 20px">
<!--调整这一个即可解决 打印出来表头布局中的问题-->
<h3>浙江景耀数控调拨入库单</h3>
</div>
<div style="margin: 0 0 20px">
<span style="float: left;margin-left: 10px;font-size: 14px">编号{{ supplierSelectionName }}</span>
<span style="float: left; font-size: 14px;margin-left: 120px">外协厂家{{ contractNumber }}</span>
<span style="float: right;margin-right: 10px;font-size: 14px; width: 130px">日期{{ NowTime }}</span>
</div>
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">物料编码</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">物料名称</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">规格型号</td>
<td colspan="2" style="text-align: center;width: 10%;font-size: 16px">调出仓库</td>
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">调入仓库</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">数量</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">{{ list.物料代码 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">{{ list.工件名称 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 16px">{{ list.图号 }}</td>
<td colspan="2" style="text-align: center;width: 10%;font-size: 16px">{{ list.调出仓库 }}</td>
<td colspan="3" style="text-align: center;width: 14%;font-size: 16px">{{ list.调入仓库 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 5%;font-size: 16px">{{ list.入库数量 }}</td>
</tr>
<tr style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">合计</td>
<td colspan="17" style="text-align: center;width: 85%">
<div>
<span style="float: right;margin-right: 41%;font-size: 14px">{{ Number(totalAmount) }}</span>
</div>
</td>
</tr>
</table>
<div style="margin-top: 15px"><span style="margin-left: 10px;font-size: 14px">审核</span><span style="margin-left: 15%;font-size: 14px">记账</span><span style="margin-left: 15%;font-size: 14px">验收</span><span style="margin-left: 15%;font-size: 14px">保管</span><span style="margin-left: 15%;font-size: 14px">制单</span></div>
</div>
</el-card>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { wsuri } from '@/utils/request'
import { getNowDAY } from '../../../utils'
import $ from 'jquery'
export default {
data() {
return {
NowTime: getNowDAY(),
totalAmount: '',
returns: [],
contractNumber: '', // 外协厂家
supplierSelectionName: '', // 选择供应商名称
workpieceName: '', // 工件名称
supplierSelectionValue: '',
supplierSelection: [],
multipleSelection: [],
materialNumber: '',
company: '',
dateRange: '', // 提交日期
loading: false, // 数据加载
total: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 退货记录表
pageCurrent: 1, // 分页当前页
pageSize: 20 // 分页每页显示条数
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.initWebpack()
this.searchTable()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
async printReceiptDoc1() {
const aa = this.printReceiptDoc()
if (aa === 2) {
await this.sleep(500)
await this.exportTable()
} else if (aa === 1) {
this.$message.warning('所选的物料入库日期和外协厂家不同!!')
}
},
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
},
exportTable() {
const htmlNode = $('#WGBLD1').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
},
printReceiptDoc() {
this.returns = []
var time, number, caigou
if (this.multipleSelection.length !== 0) {
if (this.multipleSelection.length !== 1) {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (i === 0) {
time = this.multipleSelection[i].入库日期
number = this.multipleSelection[i].调拨单号
caigou = this.multipleSelection[i].外协厂家
} else {
if (time !== this.multipleSelection[i].入库日期 || number !== this.multipleSelection[i].调拨单号 || caigou !== this.multipleSelection[i].外协厂家) {
return 1
}
}
}
}
this.supplierSelectionName = this.multipleSelection[0].调拨单号
this.contractNumber = this.multipleSelection[0].外协厂家
this.totalAmount = 0
for (let i = 0; i < this.multipleSelection.length; i++) {
this.totalAmount = this.totalAmount + Number(this.multipleSelection[i].入库数量)
this.returns.push({
物料代码: this.multipleSelection[i].物料编码,
工件名称: this.multipleSelection[i].工件名称,
图号: this.multipleSelection[i].图号,
调入仓库: '精工车间',
调出仓库: this.multipleSelection[i].外协厂家,
单位: this.multipleSelection[i].单位,
入库数量: this.multipleSelection[i].入库数量
})
}
return 2
} else {
this.$message.warning('未勾选物料!!')
return 1
}
},
// 导出表 8.10
exportExcel() {
if (this.tableData.length !== 0) {
let dateRange_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['工件名称', this.workpieceName]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['入库时间_check', dateRange_check]
var Data = this.CreateData('2001', '仓储管理_外协到货记录_导出表格_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
getWord(number, name, val, location) {
let word
word = ''
for (let i = 0; i < number; i++) {
word = word + '~JY_Batch|BarCode^Code0^' + val + '|TEXT^TEXT0^' + location + '|TEXT^TEXT1^' + name + '|TEXT^TEXT2^' + val
}
return word
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// // 数据接收
// websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
// },
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
returnRecord() {
this.dialogFormVisible1 = true
this.searchTable1()
},
searchTable() {
this.tableData = []
let dateRange_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
var param = []
param[0] = ['工件名称', this.workpieceName]
param[1] = ['开始时间', this.dateRange[0]]
param[2] = ['结束时间', this.dateRange[1]]
param[3] = ['入库时间_check', dateRange_check]
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
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

View File

@@ -0,0 +1,728 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input v-model="materialNameTypeValue" style="width:200px" placeholder="物料名称规格型号" size="small" clearable @keyup.enter.native="searchTable()"/>
<el-input v-model="orderNumberTypeValue" style="width:170px" placeholder="订单号" size="small" clearable @keyup.enter.native="searchTable()"/>
<el-select v-model="purchaseOrderValue" style="width:200px" placeholder="采购合同编号" size="small" filterable clearable @change="searchTable()">
<el-option
v-for="item in purchaseOrder"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="supplierSelectionValue" style="width:200px" placeholder="供应商" size="small" filterable clearable @change="searchTable()">
<el-option
v-for="item in supplierSelection"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="typeValue" style="width:100px" placeholder="类型" size="small" filterable clearable @change="searchTable()">
<el-option
v-for="item in type"
: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="searchTable"/>
<el-button style="margin-left: 10px" type="success" icon="el-icon-bottom" plain size="small" @click="selectIn()">选入</el-button>
</div>
<div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1561px"
height="400px"
@selection-change="handleSelectionChange"
@sort-change="sortChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="50px" label="类型" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column width="110px" label="物料编号" align="center" prop="物料码" sortable="物料码" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="97px" label="物料名称" align="center" prop="物料名称" sortable="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="130px" 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="70px" label="入库数" align="center" prop="入库数">
<template slot-scope="scope">
{{ scope.row.入库数 }}
</template>
</el-table-column>
<el-table-column width="72px" label="退货数" prop="退货数量" align="center">
<template slot-scope="scope">
{{ scope.row.退货数量 }}
</template>
</el-table-column>
<el-table-column width="72px" label="库位" align="center" prop="货位名称" sortable="货位名称">
<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="140px" label="批次编号" align="center" prop="批次" sortable="批次" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column width="111px" 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" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column width="130px" 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" 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>
<el-row>
<el-col :span="12">
<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 :span="12">
<el-button style="margin-left: 20px" type="danger" icon="el-icon-delete" size="small" plain @click="deleteData()">清空</el-button>
<el-button type="primary" icon="el-icon-printer" style="margin-left: 20px" plain size="small" @click="printReceiptDoc1()">打印入库单</el-button>
</el-col>
</el-row>
</div>
<div style="margin-top: 0">
<el-table
v-loading="loading"
ref="table"
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
highlight-current-row
show-summary
border
stripe
size="small"
style="width: 1561px"
height="290px"
@selection-change="handleSelectionChange1"
@sort-change="sortChange">
<el-table-column type="selection" align="center" width="50px"/>
<el-table-column width="50px" label="类型" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column width="110px" label="物料编号" align="center" prop="物料码" sortable="物料码" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column width="97px" label="物料名称" align="center" prop="物料名称" sortable="物料名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column width="130px" 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="70px" label="入库数" align="center" prop="入库数">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column width="72px" label="退货数" prop="退货数量" align="center">
<template slot-scope="scope">
{{ scope.row.退货数量 }}
</template>
</el-table-column>
<el-table-column width="72px" label="库位" align="center" prop="货位名称" sortable="货位名称">
<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="140px" label="批次编号" align="center" prop="批次" sortable="批次" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column width="111px" 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" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column width="130px" 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" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="操作" placement="top">
<el-button type="text" icon="el-icon-edit" size="small" @click="editData(scope.row)"/>
</el-tooltip>
<el-tooltip :open-delay="700" effect="dark" content="操作" placement="top">
<el-button type="text" icon="el-icon-delete" size="small" @click="deleteData1(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize1"
:total="total1"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"/>
</div>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="修改数量" center width="390px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" class="demo-ruleForm" style="margin: auto">
<el-row>
<el-form-item label="数量:" prop="数量">
<el-input v-model="form.数量" clearable size="small" style="width:200px" placeholder="请输入数量"/>
</el-form-item>
</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>
</el-card>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD2" style="width: 840px;margin: 0 auto">
<div style="width: 260px;margin: 0 auto 20px">
<!-- 调整这一个即可解决 打印出来表头布局中的问题-->
<h3>浙江景耀数控采购入库单</h3>
</div>
<div style="margin: 0 0 20px">
<span style="float: left;margin-left: 10px;font-size: 14px">供应商{{ supplierSelectionName }}</span>
<span style="float: right; font-size: 14px;margin-right: 10px">采购单号{{ contractNumber }}</span>
<span style="float: right;margin-right: 60px;font-size: 14px; width: 130px">日期{{ NowTime }}</span>
</div>
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">物料编码</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">物料名称</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">规格型号</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">库位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">数量</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">采购备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">{{ list.物料编码 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">{{ list.物料名称 }}</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">{{ list.规格型号 }}</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">{{ list.库位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.数量 }}</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">{{ list.采购备注 }}</td>
</tr>
<tr style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">合计</td>
<td colspan="17" style="text-align: center;width: 85%">
<div>
<span style="float: right;margin-right: 24%;font-size: 14px">{{ Number(totalAmount) }}</span>
</div>
</td>
</tr>
</table>
<div style="margin-top: 15px"><span style="margin-left: 10px;font-size: 14px">审核</span><span style="margin-left: 15%;font-size: 14px">记账</span><span style="margin-left: 15%;font-size: 14px">验收</span><span style="margin-left: 15%;font-size: 14px">保管</span><span style="margin-left: 15%;font-size: 14px">制单</span></div>
</div>
</el-card>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { wsuri } from '@/utils/request'
import { getNowDAY } from '../../../utils'
import $ from 'jquery'
export default {
data() {
return {
NowTime: getNowDAY(),
totalAmount: '',
returns: [],
contractNumber: '', // 合同
supplierSelectionName: '', // 选择供应商名称
materialNameTypeValue: '', // 物料名称规格型号
materialNameType: [], // 物料名称规格型号数组
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
purchaseOrder: [],
purchaseOrderValue: '',
supplierSelectionValue: '',
supplierSelection: [],
typeValue: '', // 类型
DeliveryNumber: '', // 入库记录流水号
suppliPeople: '', // 供应商流水号
suppliPeoples: '', // 供应商
typeNumber: '', // 类型
purchaseContract: '', // 采购合同流水号
purchaseContracts: '', // 采购合同编号
materialSerialNumber: '', // 物料流水号
materialSerialName: '', // 物料名称
materialTool: '', // 图号或型号
purchaseOrNot: '', // 是否采购
purchaseContractDetailSerialNumber: '', // 采购合同明细流水号
batchNumber: '', // 批号
warehousingDate: '', // 入库日期
componentSerialVumber: '', // 组件流水号
NumberValue: '',
form: {
数量: ''
},
rules: {
数量: [{ required: true, message: '请输入数量' }]
},
type: [{
label: '自制',
value: '自制'
}, {
label: '采购',
value: '采购'
}, {
label: '通用',
value: '通用'
}, {
label: '耗材',
value: '耗材'
}, {
label: '退件',
value: '退件'
}, {
label: '备货',
value: '备货'
}], // 类型数组
multipleSelection: [],
multipleSelection1: [],
materialNumber: '',
company: '',
dateRange: '', // 提交日期
loading: false, // 数据加载
total: 0, // 分页总数
total1: 0, // 分页总数
tableData: [], // 合同信息表
tableData1: [], // 选入记录表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
pageCurrent1: 1, // 分页当前页
pageSize1: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
PurchaseContractNo: '', // 采购合同号
dialogFormVisible: false // 数量
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.initWebpack()
this.searchTable()
this.getSupplierSelection()
this.getPurchaseOrder()
this.searchTable1()
this.deleteData()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
handleSelectionChange1(val1) {
this.multipleSelection1 = val1
},
// selectAble(row) {
// return row.采购合同流水号 === this.PurchaseContractNo || this.PurchaseContractNo === ''
// },
async printReceiptDoc1() {
const aa = this.printReceiptDoc()
if (aa === 2) {
await this.sleep(500)
await this.exportTable()
} else if (aa === 1) {
this.$message.warning('所选的物料入库日期和供应商不同!!')
}
},
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
},
exportTable() {
const htmlNode = $('#WGBLD2').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
},
printReceiptDoc() {
this.returns = []
var time, number, caigou
if (this.multipleSelection1.length !== 0) {
if (this.multipleSelection1.length !== 1) {
for (let i = 0; i < this.multipleSelection1.length; i++) {
if (i === 0) {
time = this.multipleSelection1[i].入库日期
number = this.multipleSelection1[i].供应商
caigou = this.multipleSelection1[i].采购合同编号
} else {
if (time !== this.multipleSelection1[i].入库日期 || number !== this.multipleSelection1[i].供应商 || caigou !== this.multipleSelection1[i].采购合同编号) {
return 1
}
}
}
}
this.supplierSelectionName = this.multipleSelection1[0].供应商
this.contractNumber = this.multipleSelection1[0].采购合同编号
this.totalAmount = 0
for (let i = 0; i < this.multipleSelection1.length; i++) {
this.totalAmount = this.totalAmount + Number(this.multipleSelection1[i].数量)
this.returns.push({
物料编码: this.multipleSelection1[i].物料编码,
物料名称: this.multipleSelection1[i].物料名称,
规格型号: this.multipleSelection1[i].图号或型号,
单位: this.multipleSelection1[i].单位,
数量: this.multipleSelection1[i].数量,
采购备注: this.multipleSelection1[i].备注,
库位: this.multipleSelection1[i].货位名称
})
}
return 2
} else {
this.$message.warning('未勾选物料!!')
return 1
}
},
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// // 数据接收
// websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
// },
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
getSupplierSelection() {
var param = []
var Data = this.CreateData('11', '仓储管理_入库记录_供应商_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplierSelection.push({
label: response.data[i].供应商,
value: response.data[i].供应商
})
}
})
},
getPurchaseOrder() {
var param = []
var Data = this.CreateData('11', '仓储管理_入库记录_采购合同_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.purchaseOrder.push({
label: response.data[i].采购合同编号,
value: 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 if (column.prop === '货位名称') {
this.orderName = 4
} else if (column.prop === '批次') {
this.orderName = 5
} else if (column.prop === '供应商') {
this.orderName = 6
} else if (column.prop === '采购合同') {
this.orderName = 7
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') { this.order = 2 } else {
this.order = ''
}
this.searchTable()
},
searchTable() {
this.loading = true
let dateRange_check, materialNameTypeValue_check, orderNumberTypeValue_check, typeValue_check, purchaseOrderValue_check, supplierSelection_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.typeValue ? typeValue_check = 1 : typeValue_check = 0
this.purchaseOrderValue ? purchaseOrderValue_check = 1 : purchaseOrderValue_check = 0
this.supplierSelectionValue ? supplierSelection_check = 1 : supplierSelection_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['订单号_check', orderNumberTypeValue_check]
param[3] = ['订单号', this.orderNumberTypeValue]
param[4] = ['类型_check', typeValue_check]
param[5] = ['类型', this.typeValue]
param[6] = ['开始时间', this.dateRange[0]]
param[7] = ['结束时间', this.dateRange[1]]
param[8] = ['入库时间_check', dateRange_check]
param[9] = ['采购合同_check', purchaseOrderValue_check]
param[10] = ['采购合同流水号', this.purchaseOrderValue]
param[11] = ['供应商_check', supplierSelection_check]
param[12] = ['供应商名称', this.supplierSelectionValue]
param[13] = ['排序名称', this.orderName]
param[14] = ['排序方式', 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
this.loading = false
})
},
searchTable1() {
this.loading = true
this.tableData1 = []
var param = []
var Data = this.CreateData('11', '仓储管理_入库记录主轴明细_查询', param, this.pageSize1, this.pageCurrent1)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
this.loading = false
})
},
selectIn() {
var orderNumber, purchaseContract
if (this.multipleSelection.length !== 0) {
const processGroup = []
const numberGroup = []
this.multipleSelection_variable = this.multipleSelection
this.multipleSelection = []
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
processGroup[i] = this.multipleSelection_variable[i].入库记录流水号
numberGroup[i] = this.multipleSelection_variable[i].入库数
if (this.multipleSelection_variable.length !== 1) {
for (let i = 0; i < this.multipleSelection_variable.length; i++) {
if (i === 0) {
orderNumber = this.multipleSelection_variable[i].物料编码
purchaseContract = this.multipleSelection_variable[i].采购合同编号
} else {
if (orderNumber !== this.multipleSelection_variable[i].物料编码 || purchaseContract !== this.multipleSelection_variable[i].采购合同编号) {
this.$message.warning('请选择正确的订单')
return
}
}
}
}
}
var param = []
param[0] = ['入库记录流水号组', processGroup]
param[1] = ['数量组', numberGroup]
var Data = this.CreateData('12', '仓储管理_入库记录主轴明细_增加', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('选入成功')
this.searchTable1()
} else {
this.$message.success('选入失败')
}
})
} else {
this.$message.warning('请选择订单')
}
},
editData(row) {
this.form.数量 = Number(row.入库数)
this.DeliveryNumber = row.入库记录流水号
this.dialogFormVisible = true
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
param[0] = ['入库记录流水号', this.DeliveryNumber]
param[1] = ['数量', this.form.数量]
var Data = this.CreateData('12', '仓储管理_入库记录主轴明细_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.searchTable1()
this.dialogFormVisible = false
} else {
this.$message.error('修改失败')
}
})
}
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
deleteData() {
var param = []
var Data = this.CreateData('12', '仓储管理_入库记录主轴明细_清空', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.searchTable1()
} else {
this.$message.error('删除失败')
}
})
},
deleteData1(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.searchTable1()
} 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,999 @@
<template>
<div class="app-container">
<el-card style="height: 850px">
<div style="margin-top: 7px; margin-bottom: 7px">
<el-input
v-model="materialNameTypeValue"
clearable
placeholder="物料名称规格型号批次"
size="small"
style="width:200px"
@keyup.enter.native="searchTable()"/>
<el-input
v-model="orderNumberTypeValue"
clearable
placeholder="订单号"
size="small"
style="width:170px"
@keyup.enter.native="searchTable()"/>
<el-select
v-model="purchaseOrderValue"
clearable
filterable
placeholder="采购合同编号"
size="small"
style="width:180px"
@change="searchTable()">
<el-option
v-for="item in purchaseOrder"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="supplierSelectionValue"
clearable
filterable
placeholder="供应商"
size="small"
style="width:170px"
@change="searchTable()">
<el-option
v-for="item in supplierSelection"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="typeValue"
clearable
filterable
placeholder="类型"
size="small"
style="width:80px"
@change="searchTable()">
<el-option
v-for="item in type"
: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"
align="center"
end-placeholder="结束时间"
format="yyyy-MM-dd"
range-separator=""
size="small"
start-placeholder="开始时间"
style="width: 240px;"
type="daterange"
value-format="yyyy-MM-dd"
@change="searchTable"/>
<el-button
icon="el-icon-download"
plain
size="small"
style="margin-left: 20px"
type="success"
@click="exportExcel()"/>
<el-button
icon="el-icon-printer"
plain
size="small"
style="margin-left: 10px"
type="primary"
@click="printReceiptDoc1()">打印入库单
</el-button>
<el-button plain size="small" style="margin-left: 10px" type="info" @click="returnRecord()">退货</el-button>
<el-button plain size="small" style="margin-left: 10px" type="info" @click="returnRecord1()">退货自制件
</el-button>
<el-button
icon="el-icon-printer"
plain
size="small"
style="margin-left: 10px"
type="primary"
@click="Pronters()">批量打印
</el-button>
</div>
<div>
<el-table
v-loading="loading"
ref="table"
:data="tableData"
border
height="750px"
highlight-current-row
show-summary
size="small"
stripe
style="width: 1801px"
@selection-change="handleSelectionChange"
@sort-change="sortChange">
<el-table-column align="center" type="selection" width="50px"/>
<el-table-column align="center" label="类型" show-overflow-tooltip width="50px">
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="物料编号"
prop="物料码"
show-overflow-tooltip
sortable="物料码"
width="110px">
<template slot-scope="scope">
{{ scope.row.物料编码 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="物料名称"
prop="物料名称"
show-overflow-tooltip
sortable="物料名称"
width="97px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="图号/型号"
prop="图号"
show-overflow-tooltip
sortable="图号"
width="130px">
<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 align="center" label="入库数" prop="入库数" width="70px">
<template slot-scope="scope">
{{ scope.row.入库数 }}
</template>
</el-table-column>
<el-table-column align="center" label="退货数" prop="退货数量" width="72px">
<template slot-scope="scope">
{{ scope.row.退货数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="库位" prop="货位名称" sortable="货位名称" width="72px">
<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
align="center"
label="批次编号"
prop="批次"
show-overflow-tooltip
sortable="批次"
width="140px">
<template slot-scope="scope">
{{ scope.row.批次编号 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="供应商编号"
prop="供应商"
show-overflow-tooltip
sortable="供应商"
width="111px">
<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
align="center"
label="采购合同"
prop="采购合同"
show-overflow-tooltip
sortable="采购合同"
width="130px">
<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 align="center" label="打印条码数" width="120px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.打印条码数" :min="1" size="mini" style="margin: 0;width: 100%"/>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" show-overflow-tooltip width="100px">
<template slot-scope="scope">
<el-button icon="el-icon-printer" size="small" type="text" @click="Pronter(scope.row)"/>
<el-tooltip content="退货" effect="dark" placement="top">
<el-button
:disabled="scope.row.入库数 === '0' || scope.row.批次编号 === '' || (scope.row.类型 !== '采购' && scope.row.类型 !== '耗材' && scope.row.类型 !== '自制') || scope.row.库存 === '0'"
icon="el-icon-right"
size="mini"
type="text"
@click="MaterialReturn(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>
<!--<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-tooltip :open-delay="700" effect="dark" content="删除入库记录" placement="top">
<el-button type="text" icon="el-icon-delete" size="mini" @click="handleDelete(scope.row)"/>
</el-tooltip>
</template>
</el-table-column>-->
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="pageCurrent"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 100]"
: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 title="退货" width="390px">
<el-form
ref="form"
:model="form"
:rules="rules"
class="demo-ruleForm"
label-position="left"
label-width="100px"
style="margin: auto">
<el-row>
<el-form-item label="退货数量:" prop="退货数量">
<el-input-number
v-model="form.退货数量"
:max="NumberValue"
:min="1"
clearable
placeholder="请输入数量"
size="small"
style="width:200px"/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="退货原因:" prop="退货原因">
<el-input
v-model="form.退货原因"
clearable
placeholder="退货原因"
rows="4"
size="small"
style="width:200px"
type="textarea"/>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button size="small" type="distribution" @click="submit('form')"> </el-button>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" center width="1120px">
<div style="width: 100%;overflow: hidden">
<span style="font-size: 13px;color: black">退货时间</span>
<el-date-picker
v-model="dateRange1"
align="center"
end-placeholder="结束时间"
format="yyyy-MM-dd"
range-separator=""
size="small"
start-placeholder="开始时间"
style="width: 240px;"
type="daterange"
value-format="yyyy-MM-dd"
@change="searchTable1"/>
<el-table
:data="tableData1"
:header-cell-style="{background: '#2283D4',color: 'white'}"
border
height="440px"
highlight-current-row
size="mini"
stripe
style="width: 1090px;margin-top: 10px;">
<el-table-column align="center" label="类型" width="80px">
<template slot-scope="scope">
{{ scope.row.类型 }}
</template>
</el-table-column>
<el-table-column align="center" label="物料名称" show-overflow-tooltip width="150px">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="供应商" show-overflow-tooltip width="150px">
<template slot-scope="scope">
{{ scope.row.供应商 }}
</template>
</el-table-column>
<el-table-column align="center" label="采购合同" show-overflow-tooltip width="180px">
<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 align="center" label="退货原因" show-overflow-tooltip width="200px">
<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 align="center" label="退货时间">
<template slot-scope="scope">
{{ scope.row.退货时间 }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" center width="1120px">
<div style="width: 100%;overflow: hidden">
<span style="font-size: 13px;color: black">退货时间</span>
<el-date-picker
v-model="dateRange2"
align="center"
end-placeholder="结束时间"
format="yyyy-MM-dd"
range-separator=""
size="small"
start-placeholder="开始时间"
style="width: 240px;"
type="daterange"
value-format="yyyy-MM-dd"
@change="searchTable2"/>
<el-table
:data="tableData2"
:header-cell-style="{background: '#2283D4',color: 'white'}"
border
height="440px"
highlight-current-row
size="mini"
stripe
style="width: 1090px;margin-top: 10px;">
<el-table-column align="center" label="订单号" show-overflow-tooltip width="150px">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="产品名称" show-overflow-tooltip width="150px">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" show-overflow-tooltip width="150px">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" show-overflow-tooltip width="150px">
<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 align="center" label="退货原因" show-overflow-tooltip width="200px">
<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 align="center" label="退货时间">
<template slot-scope="scope">
{{ scope.row.退货时间 }}
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</el-card>
<el-card v-show="false">
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="WGBLD" style="width: 840px;margin: 0 auto">
<div style="width: 260px;margin: 0 auto 20px">
<!-- 调整这一个即可解决 打印出来表头布局中的问题-->
<h3>浙江景耀数控采购入库单</h3>
</div>
<div style="margin: 0 0 20px">
<span style="float: left;margin-left: 10px;font-size: 14px">供应商{{ supplierSelectionName }}</span>
<span style="float: right; font-size: 14px;margin-right: 10px">采购单号{{ contractNumber }}</span>
<span style="float: right;margin-right: 60px;font-size: 14px; width: 130px">日期{{ NowTime }}</span>
</div>
<table align="center" border="1 solid black" cellspacing="0px" width="100%">
<tr id="tablehead12" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">物料编码</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">物料名称</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">规格型号</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">库位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 16px">单位</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">数量</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">采购备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">{{ list.物料编码 }}</td>
<td colspan="4" style="text-align: center;width: 20%;font-size: 14px">{{ list.物料名称 }}</td>
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">{{ list.规格型号 }}</td>
<td colspan="2" style="text-align: center;width: 12%;font-size: 14px">{{ list.库位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.单位 }}</td>
<td colspan="1" style="text-align: center;width: 6%;font-size: 14px">{{ list.数量 }}</td>
<td colspan="5" style="text-align: center;width: 19%;font-size: 14px">{{ list.采购备注 }}</td>
</tr>
<tr style="height: 35px">
<td colspan="3" style="text-align: center;width: 15%;font-size: 14px">合计</td>
<td colspan="17" style="text-align: center;width: 85%">
<div>
<span style="float: right;margin-right: 24%;font-size: 14px">{{ Number(totalAmount) }}</span>
</div>
</td>
</tr>
</table>
<div style="margin-top: 15px"><span style="margin-left: 10px;font-size: 14px">审核</span><span
style="margin-left: 15%;font-size: 14px">记账</span><span
style="margin-left: 15%;font-size: 14px">验收</span><span
style="margin-left: 15%;font-size: 14px">保管</span><span
style="margin-left: 15%;font-size: 14px">制单</span></div>
</div>
</el-card>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { wsuri } from '@/utils/request'
import { getNowDAY } from '../../../utils'
import $ from 'jquery'
export default {
data() {
return {
NowTime: getNowDAY(),
totalAmount: '',
returns: [],
contractNumber: '', // 合同
supplierSelectionName: '', // 选择供应商名称
materialNameTypeValue: '', // 物料名称规格型号
materialNameType: [], // 物料名称规格型号数组
orderNumberTypeValue: '', // 订单号
orderNumberType: [], // 订单号数组
purchaseOrder: [],
purchaseOrderValue: '',
supplierSelectionValue: '',
supplierSelection: [],
typeValue: '', // 类型
DeliveryNumber: '', // 入库记录流水号
suppliPeople: '', // 供应商流水号
suppliPeoples: '', // 供应商
typeNumber: '', // 类型
purchaseContract: '', // 采购合同流水号
purchaseContracts: '', // 采购合同编号
materialSerialNumber: '', // 物料流水号
materialSerialName: '', // 物料名称
materialTool: '', // 图号或型号
purchaseOrNot: '', // 是否采购
purchaseContractDetailSerialNumber: '', // 采购合同明细流水号
batchNumber: '', // 批号
warehousingDate: '', // 入库日期
componentSerialVumber: '', // 组件流水号
NumberValue: '',
form: {
退货数量: '',
退货原因: ''
},
rules: {
退货数量: [{ required: true, message: '请输入数量' }]
},
type: [{
label: '自制',
value: '自制'
}, {
label: '采购',
value: '采购'
}, {
label: '通用',
value: '通用'
}, {
label: '耗材',
value: '耗材'
}, {
label: '退件',
value: '退件'
}, {
label: '备货',
value: '备货'
}], // 类型数组
multipleSelection: [],
materialNumber: '',
company: '',
dateRange: '', // 提交日期
dateRange1: '', // 提交日期
dateRange2: '', // 提交日期
loading: false, // 数据加载
total: 0, // 分页总数
tableData2: [],
tableData: [], // 合同信息表
tableData1: [], // 退货记录表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
orderName: '', // 排序列名
order: '', // 排序方式
dialogFormVisible: false, // 退货
dialogFormVisible1: false, // 退货
dialogFormVisible2: false // 退货
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout()
})
},
created() {
this.initWebpack()
this.searchTable()
this.getSupplierSelection()
this.getPurchaseOrder()
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val
},
async printReceiptDoc1() {
const aa = this.printReceiptDoc()
if (aa === 2) {
await this.sleep(500)
await this.exportTable()
} else if (aa === 1) {
this.$message.warning('所选的物料入库日期和供应商不同!!')
}
},
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
},
exportTable() {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
},
printReceiptDoc() {
this.returns = []
var time, number, caigou
if (this.multipleSelection.length !== 0) {
if (this.multipleSelection.length !== 1) {
for (let i = 0; i < this.multipleSelection.length; i++) {
if (i === 0) {
time = this.multipleSelection[i].入库日期
number = this.multipleSelection[i].供应商
caigou = this.multipleSelection[i].采购合同编号
} else {
if (time !== this.multipleSelection[i].入库日期 || number !== this.multipleSelection[i].供应商 || caigou !== this.multipleSelection[i].采购合同编号) {
return 1
}
}
}
}
this.supplierSelectionName = this.multipleSelection[0].供应商
this.contractNumber = this.multipleSelection[0].采购合同编号
this.totalAmount = 0
for (let i = 0; i < this.multipleSelection.length; i++) {
this.totalAmount = this.totalAmount + Number(this.multipleSelection[i].入库数)
this.returns.push({
物料编码: this.multipleSelection[i].物料编码,
物料名称: this.multipleSelection[i].物料名称,
规格型号: this.multipleSelection[i].图号或型号,
单位: this.multipleSelection[i].单位,
数量: this.multipleSelection[i].入库数,
采购备注: this.multipleSelection[i].备注,
库位: this.multipleSelection[i].货位名称
})
}
return 2
} else {
this.$message.warning('未勾选物料!!')
return 1
}
},
// 导出表 8.10
exportExcel() {
if (this.tableData.length !== 0) {
let dateRange_check, materialNameTypeValue_check, orderNumberTypeValue_check, typeValue_check,
purchaseOrderValue_check, supplierSelection_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.typeValue ? typeValue_check = 1 : typeValue_check = 0
this.purchaseOrderValue ? purchaseOrderValue_check = 1 : purchaseOrderValue_check = 0
this.supplierSelectionValue ? supplierSelection_check = 1 : supplierSelection_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['订单号_check', orderNumberTypeValue_check]
param[3] = ['订单号', this.orderNumberTypeValue]
param[4] = ['类型_check', typeValue_check]
param[5] = ['类型', this.typeValue]
param[6] = ['开始时间', this.dateRange[0]]
param[7] = ['结束时间', this.dateRange[1]]
param[8] = ['入库时间_check', dateRange_check]
param[9] = ['采购合同_check', purchaseOrderValue_check]
param[10] = ['采购合同流水号', this.purchaseOrderValue]
param[11] = ['供应商_check', supplierSelection_check]
param[12] = ['供应商名称', this.supplierSelectionValue]
var Data = this.CreateData('2001', '仓储管理_入库记录_导出表格_查询', param)
this.exportExcel_NPOI(Data)
} else {
this.$message.warning('暂无数据')
}
},
// 初始化websocket
initWebpack() {
this.websock = new WebSocket(wsuri)// 这里面的this都指向vue
this.websock.onopen = this.websocketopen
this.websock.onclose = this.websocketclose
this.websock.onerror = this.websocketerror
},
Pronter(row) {
let sendMessage
sendMessage = 'TOCS??JY_Warehouse?PDA~'
sendMessage = sendMessage + row.打印条码数 + this.getWord(row.打印条码数, row.物料名称, row.批次编号, row.货位名称)
this.websock.send(sendMessage)
},
Pronters() {
if (this.multipleSelection.length !== 0) {
let sendMessage, word, number
sendMessage = 'TOCS??JY_Warehouse?PDA~'
word = ''
number = 0
for (let i = 0; i < this.multipleSelection.length; i++) {
word = word + this.getWord(this.multipleSelection[i].打印条码数, this.multipleSelection[i].物料名称, this.multipleSelection[i].批次编号, this.multipleSelection[i].货位名称)
number = number + Number(this.multipleSelection[i].打印条码数)
}
sendMessage = sendMessage + number + word
this.websock.send(sendMessage)
} else {
this.$message.warning('请选择要打印的物料')
}
},
getWord(number, name, val, location) {
let word
word = ''
for (let i = 0; i < number; i++) {
word = word + '~JY_Batch|BarCode^Code0^' + val + '|TEXT^TEXT0^' + location + '|TEXT^TEXT1^' + name + '|TEXT^TEXT2^' + val
}
return word
},
// 打开
websocketopen() {
console.log('WebSocket连接成功')
},
// // 数据接收
// websocketonmessage(msg) {
// this.partNumberP = msg.data.split('|')[3]
// this.partNumber = this.partNumberP.slice(1)
// this.getscantable(this.partNumber)
// },
// 关闭
websocketclose() {
console.log('WebSocket关闭')
},
// 失败
websocketerror() {
console.log('WebSocket连接失败')
},
returnRecord() {
this.dialogFormVisible1 = true
this.searchTable1()
},
returnRecord1() {
this.dialogFormVisible2 = true
this.searchTable2()
},
MaterialReturn(row) {
console.log(row, 123)
Number(row.入库数) > Number(row.库存) ? this.NumberValue = Number(row.库存) : this.NumberValue = Number(row.入库数)
// this.NumberValue = Number(row.入库数)
this.DeliveryNumber = row.入库记录流水号
this.purchaseContract = Number(row.采购合同流水号)
this.suppliPeople = Number(row.供应商流水号)
this.materialSerialNumber = Number(row.物料流水号)
this.materialSerialName = row.物料名称
this.materialTool = row.图号或型号
this.materialNumber = row.物料编码
this.company = row.单位
this.purchaseOrNot = Number(row.是否采购)
this.purchaseContractDetailSerialNumber = Number(row.采购合同明细流水号)
this.batchNumber = Number(row.批号)
this.componentSerialVumber = Number(row.组件流水号)
this.dialogFormVisible = true
this.suppliPeoples = row.供应商
this.purchaseContracts = row.采购合同编号
this.typeNumber = row.类型
this.warehousingDate = row.入库日期
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var param = []
if (this.typeNumber === '采购' || this.typeNumber === '耗材') {
param[0] = ['退货数量', this.form.退货数量]
param[1] = ['物料流水号', this.materialSerialNumber]
param[2] = ['是否采购', this.purchaseOrNot]
param[3] = ['采购合同明细流水号', this.purchaseContractDetailSerialNumber]
param[4] = ['批号', this.batchNumber]
param[5] = ['入库时间', this.warehousingDate]
var Data = this.CreateData('11', '仓储管理_入库记录_退货入库_验证', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].数值 === 1) {
param[0] = ['入库记录流水号', this.DeliveryNumber]
param[1] = ['退货数量', this.form.退货数量]
param[2] = ['退货原因', this.form.退货原因]
param[3] = ['退货人', this.id]
param[4] = ['采购合同流水号', this.purchaseContract]
param[5] = ['供应商流水号', this.suppliPeople]
param[6] = ['物料流水号', this.materialSerialNumber]
param[7] = ['是否采购', this.purchaseOrNot]
param[8] = ['采购合同明细流水号', this.purchaseContractDetailSerialNumber]
param[9] = ['批号', this.batchNumber]
param[10] = ['组件流水号', this.componentSerialVumber]
param[11] = ['供应商', this.suppliPeoples]
param[12] = ['采购合同', this.purchaseContracts]
param[13] = ['类型', this.typeNumber]
param[14] = ['物料名称', this.materialSerialName]
param[15] = ['入库时间', this.warehousingDate]
param[16] = ['图号或型号', this.materialTool]
param[17] = ['物料编码', this.materialNumber]
param[18] = ['单位', this.company]
param[19] = ['库存', this.NumberValue]
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.error('退货失败')
}
})
} else {
this.$message.error('当前退货数量已超出该批物料库存')
}
})
}
if (this.typeNumber === '自制') {
param[0] = ['入库记录流水号', this.DeliveryNumber]
param[1] = ['退货数量', this.form.退货数量]
param[2] = ['退货原因', this.form.退货原因]
param[3] = ['退货人', this.id]
param[4] = ['物料流水号', this.materialSerialNumber]
param[5] = ['批号', this.batchNumber]
param[6] = ['组件流水号', this.componentSerialVumber]
param[7] = ['入库时间', this.warehousingDate]
var Data1 = this.CreateData('12', '仓储管理_自制件入库记录_退货入库', param)
this.ExecDatabase(Data1).then(response => {
if (response.data[0].result === '1') {
this.$message.success('退货成功')
this.searchTable()
this.dialogFormVisible = false
} else {
this.$message.error('退货失败')
}
})
}
}
})
},
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
getSupplierSelection() {
var param = []
var Data = this.CreateData('11', '仓储管理_入库记录_供应商_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.supplierSelection.push({
label: response.data[i].供应商,
value: response.data[i].供应商
})
}
})
},
getPurchaseOrder() {
var param = []
var Data = this.CreateData('11', '仓储管理_入库记录_采购合同_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.purchaseOrder.push({
label: response.data[i].采购合同编号,
value: 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 if (column.prop === '货位名称') {
this.orderName = 4
} else if (column.prop === '批次') {
this.orderName = 5
} else if (column.prop === '供应商') {
this.orderName = 6
} else if (column.prop === '采购合同') {
this.orderName = 7
} else {
this.orderName = 0
}
if (column.order === 'ascending') {
this.order = 1
} else if (column.order === 'descending') {
this.order = 2
} else {
this.order = ''
}
this.searchTable()
},
searchTable() {
this.loading = true
let dateRange_check, materialNameTypeValue_check, orderNumberTypeValue_check, typeValue_check,
purchaseOrderValue_check, supplierSelection_check
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
this.materialNameTypeValue ? materialNameTypeValue_check = 1 : materialNameTypeValue_check = 0
this.orderNumberTypeValue ? orderNumberTypeValue_check = 1 : orderNumberTypeValue_check = 0
this.typeValue ? typeValue_check = 1 : typeValue_check = 0
this.purchaseOrderValue ? purchaseOrderValue_check = 1 : purchaseOrderValue_check = 0
this.supplierSelectionValue ? supplierSelection_check = 1 : supplierSelection_check = 0
var param = []
param[0] = ['物料名称_check', materialNameTypeValue_check]
param[1] = ['物料名称', this.materialNameTypeValue]
param[2] = ['订单号_check', orderNumberTypeValue_check]
param[3] = ['订单号', this.orderNumberTypeValue]
param[4] = ['类型_check', typeValue_check]
param[5] = ['类型', this.typeValue]
param[6] = ['开始时间', this.dateRange[0]]
param[7] = ['结束时间', this.dateRange[1]]
param[8] = ['入库时间_check', dateRange_check]
param[9] = ['采购合同_check', purchaseOrderValue_check]
param[10] = ['采购合同流水号', this.purchaseOrderValue]
param[11] = ['供应商_check', supplierSelection_check]
param[12] = ['供应商名称', this.supplierSelectionValue]
param[13] = ['排序名称', this.orderName]
param[14] = ['排序方式', 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
this.loading = false
})
},
searchTable1() {
let dateRange_check
this.dateRange1 ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange1 = '')
var param = []
param[0] = ['退货时间_check', dateRange_check]
param[1] = ['开始时间', this.dateRange1[0]]
param[2] = ['结束时间', this.dateRange1[1]]
var Data = this.CreateData('11', '仓储管理_入库记录退货_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData1 = response.data
})
},
searchTable2() {
let dateRange_check
this.dateRange2 ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange2 = '')
var param = []
param[0] = ['退货时间_check', dateRange_check]
param[1] = ['开始时间', this.dateRange2[0]]
param[2] = ['结束时间', this.dateRange2[1]]
var Data = this.CreateData('11', '仓储管理_自制件入库记录退货_查询', param)
this.ExecDatabase(Data).then(response => {
this.tableData2 = response.data
})
},
handleDelete(row) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['入库记录流水号', row.入库记录流水号]
param[1] = ['类型', row.类型]
param[2] = ['供应商', 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,59 @@
<template>
<div>
<el-card>
<el-tabs v-model="activeName" type="border-card" @tab-click="Refresh">
<el-tab-pane label="入库记录" name="1"><WarehousingRecord ref="fresh1"/></el-tab-pane>
<el-tab-pane label="外协到货记录" name="2"><OutsourcingRecord ref="fresh2"/></el-tab-pane>
<el-tab-pane label="主轴入库记录" name="3"><SpindleStockRecord ref="fresh3"/></el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import WarehousingRecord from '@/views/WarehouseManagement/WarehousingRecord/WarehousingRecord.vue'
import OutsourcingRecord from '@/views/WarehouseManagement/WarehousingRecord/OutsourcingRecord.vue'
import SpindleStockRecord from '@/views/WarehouseManagement/WarehousingRecord/SpindleStockRecord.vue'
export default {
components: {
'WarehousingRecord': WarehousingRecord,
'OutsourcingRecord': OutsourcingRecord,
'SpindleStockRecord': SpindleStockRecord
},
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>