Merge branch 'master' of http://192.168.1.149:10010/r/高精2.0
This commit is contained in:
@@ -45,13 +45,14 @@
|
||||
{{ scope.row.领用人 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" min-width="100" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">修改</el-button>
|
||||
@click="handleEdit(scope.$index, scope.row, 'form')">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@@ -113,14 +114,15 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
<!--仓库表单-->
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="增加仓库" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="增加仓库" center width="450px">
|
||||
<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="WarehouseNumber">
|
||||
<el-input
|
||||
v-model="form.WarehouseNumber"
|
||||
size="small"
|
||||
clearable
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -131,6 +133,7 @@
|
||||
<el-input
|
||||
v-model="form.WarehouseName"
|
||||
size="small"
|
||||
clearable
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -141,6 +144,7 @@
|
||||
<el-input
|
||||
v-model="form.WarehouseDescription"
|
||||
size="small"
|
||||
clearable
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -150,6 +154,7 @@
|
||||
<el-form-item label="地址" prop="Address">
|
||||
<el-input
|
||||
v-model="form.Address"
|
||||
clearable
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
@@ -157,10 +162,10 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="领用者" prop="TotalContractAmount" label-width="100px">
|
||||
<el-select v-model="PeopleValue" filterable clearable size="small" placeholder="领用者" style="width: 200px;margin-right:10px" @change="searchGroupList()">
|
||||
<el-form-item label="联系人" prop="ContactpeopleValue">
|
||||
<el-select v-model="form.ContactpeopleValue" clearable filterable size="small" placeholder="领用者" style="width: 200px;margin-right:10px">
|
||||
<el-option
|
||||
v-for="item in People"
|
||||
v-for="item in Contactpeople"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
@@ -173,6 +178,7 @@
|
||||
<el-form-item label="备注" prop="Note">
|
||||
<el-input
|
||||
v-model="form.Note"
|
||||
clearable
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
@@ -209,7 +215,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="永久" prop="永久">
|
||||
<el-form-item label="是否永久" prop="永久">
|
||||
<el-input
|
||||
v-model="form2.永久"
|
||||
size="small"
|
||||
@@ -240,6 +246,8 @@ import { initWarehouse, addWarehouse, alterWarehouse, deleteWarehouse, searchLoc
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Contactpeople: [], // 联系人
|
||||
count2: 0, // 清表单验证计数器
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
wareHouse: '',
|
||||
@@ -250,10 +258,12 @@ export default {
|
||||
WarehouseName: '', // 仓库名称
|
||||
WarehouseDescription: '', // 仓库描述
|
||||
Address: '', // 地址
|
||||
ContactpeopleValue: '',
|
||||
Note: '' // 备注
|
||||
},
|
||||
rules: { // 表单验证规则
|
||||
WarehouseNumber: [{ required: true, message: '请输入仓库编号', trigger: 'change' }],
|
||||
WarehouseNumber: [{ required: true, message: '请输入仓库编号', trigger: 'blur' }],
|
||||
ContactpeopleValue: [{ required: true, message: '请选择联系人', trigger: 'change' }],
|
||||
WarehouseName: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
|
||||
WarehouseDescription: [{ required: true, message: '请输入仓库描述', trigger: 'blur' }],
|
||||
Address: [{ required: true, message: '请输入地址', trigger: 'blur' }],
|
||||
@@ -290,7 +300,6 @@ export default {
|
||||
this.listLoading = true
|
||||
initWarehouse().then(response => {
|
||||
this.listLoading = false
|
||||
console.log(response)
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.tableData.push({
|
||||
仓库流水号: response.data[i].仓库流水号,
|
||||
@@ -298,8 +307,9 @@ export default {
|
||||
仓库名称: response.data[i].仓库名称,
|
||||
仓库描述: response.data[i].仓库描述,
|
||||
地址: response.data[i].地址,
|
||||
联系人: response.data[i].联系人,
|
||||
备注: response.data[i].备注
|
||||
联系人: response.data[i].姓名,
|
||||
备注: response.data[i].备注,
|
||||
人员编号: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -309,11 +319,12 @@ export default {
|
||||
this.getLocate()
|
||||
},
|
||||
searchPeopleData() { // 查询人员
|
||||
this.Contactpeople = []
|
||||
searchPeople().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.People.push({
|
||||
this.Contactpeople.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].考勤编号
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -351,19 +362,20 @@ export default {
|
||||
this.form.WarehouseName = ''
|
||||
this.form.WarehouseDescription = ''
|
||||
this.form.Address = ''
|
||||
this.form.Contactpeople = ''
|
||||
this.form.ContactpeopleValue = ''
|
||||
this.form.Note = ''
|
||||
this.temp = null
|
||||
this.temp = ''
|
||||
} else if (this.temp === 2) {
|
||||
this.chaEdit()
|
||||
this.temp = null
|
||||
this.temp = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 执行增加仓库
|
||||
addTableData() {
|
||||
addWarehouse(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.PeopleValue, this.form.Note).then(response => {
|
||||
addWarehouse(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.ContactpeopleValue, this.form.Note).then(response => {
|
||||
console.log(this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.ContactpeopleValue, this.form.Note)
|
||||
this.dialogFormVisible = false
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
@@ -371,7 +383,7 @@ export default {
|
||||
this.form.WarehouseName = ''
|
||||
this.form.WarehouseDescription = ''
|
||||
this.form.Address = ''
|
||||
this.form.Contactpeople = ''
|
||||
this.form.ContactpeopleValue = ''
|
||||
this.form.Note = ''
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
@@ -380,29 +392,28 @@ export default {
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
handleEdit(row) {
|
||||
handleEdit(index, row, formName) {
|
||||
console.log(row)
|
||||
this.count2 = this.count2 + 1
|
||||
if (this.count2 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.temp = 2
|
||||
this.dialogFormVisible = true
|
||||
this.form.WarehouseNumber = row.仓库编号
|
||||
this.form.WarehouseName = row.仓库名称
|
||||
this.form.WarehouseDescription = row.仓库描述
|
||||
this.form.Address = row.地址
|
||||
this.form.Contactpeople = row.联系人
|
||||
this.form.ContactpeopleValue = row.人员编号
|
||||
this.form.Note = row.备注
|
||||
this.HouseNumber = row.仓库流水号
|
||||
},
|
||||
// 执行修改
|
||||
chaEdit() {
|
||||
alterWarehouse(this.HouseNumber, this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.Contactpeople, this.form.Note).then(response => {
|
||||
this.dialogFormVisible = false
|
||||
alterWarehouse(this.HouseNumber, this.form.WarehouseNumber, this.form.WarehouseName, this.form.WarehouseDescription, this.form.Address, this.form.ContactpeopleValue, this.form.Note).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.form.WarehouseNumber = ''
|
||||
this.form.WarehouseName = ''
|
||||
this.form.WarehouseDescription = ''
|
||||
this.form.Address = ''
|
||||
this.form.Contactpeople = ''
|
||||
this.form.Note = ''
|
||||
this.dialogFormVisible = false
|
||||
this.getTable()
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
@@ -428,7 +439,6 @@ export default {
|
||||
},
|
||||
// 重置表单
|
||||
callOff(formName) {
|
||||
console.log(1515)
|
||||
this.form = {}
|
||||
this.form2.ContractNumberValue = ''
|
||||
this.form2.EntryName = ''
|
||||
|
||||
Reference in New Issue
Block a user