|
|
@@ -15,14 +15,14 @@
|
|
|
</el-form-item>
|
|
|
<el-button style="margin-bottom: 10px;" type="success" size="small" @click="addRow">新增</el-button>
|
|
|
<el-table border :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
|
|
- :data="form.oaReceiveObjs" ref="table" style="width: 100%">
|
|
|
+ :data="form.oaPurchaseObjs" ref="table" style="width: 100%">
|
|
|
|
|
|
<el-table-column label="采购物资名称">
|
|
|
<template slot-scope="scope">
|
|
|
<!--表格里面嵌套表单-->
|
|
|
- <el-form-item :prop="'oaReceiveObjs.' + scope.$index + '.name'"
|
|
|
+ <el-form-item :prop="'oaPurchaseObjs.' + scope.$index + '.name'"
|
|
|
:rules="{ required: true, message: '采购物资名称不能为空', trigger: 'blur' }">
|
|
|
- <el-input maxlength="20" v-model="form.oaReceiveObjs[scope.$index].name" autocomplete="off" size="small"
|
|
|
+ <el-input maxlength="20" v-model="form.oaPurchaseObjs[scope.$index].name" autocomplete="off" size="small"
|
|
|
placeholder="采购物资名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -30,9 +30,9 @@
|
|
|
|
|
|
<el-table-column label="采购数量" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item :prop="'oaReceiveObjs.' + scope.$index + '.amount'"
|
|
|
+ <el-form-item :prop="'oaPurchaseObjs.' + scope.$index + '.amount'"
|
|
|
:rules="{ required: true, message: '采购数量不能为空', trigger: 'blur' }">
|
|
|
- <el-input v-model="form.oaReceiveObjs[scope.$index].amount" autocomplete="off" size="small" type='number'
|
|
|
+ <el-input v-model="form.oaPurchaseObjs[scope.$index].amount" autocomplete="off" size="small" type='number'
|
|
|
placeholder="采购数量"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -40,9 +40,9 @@
|
|
|
|
|
|
<el-table-column label="预算金额(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item :prop="'oaReceiveObjs.' + scope.$index + '.money'"
|
|
|
+ <el-form-item :prop="'oaPurchaseObjs.' + scope.$index + '.money'"
|
|
|
:rules="{ required: true, message: '预算金额不能为空', trigger: 'blur' }">
|
|
|
- <el-input v-model="form.oaReceiveObjs[scope.$index].money" autocomplete="off" size="small"
|
|
|
+ <el-input v-model="form.oaPurchaseObjs[scope.$index].money" autocomplete="off" size="small"
|
|
|
placeholder="预算金额" oninput="value=value.match(/\d+\.?\d{0,2}/,'')" @input="changeMoney(scope.$index)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -50,7 +50,7 @@
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button style="margin-bottom: 22px;" @click="handleDeleteRow(form.oaReceiveObjs[scope.$index])"
|
|
|
+ <el-button style="margin-bottom: 22px;" @click="handleDeleteRow(form.oaPurchaseObjs[scope.$index])"
|
|
|
type="text" size="small">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -181,7 +181,7 @@ export default {
|
|
|
deptName: undefined,
|
|
|
position: undefined,
|
|
|
employeePhone: undefined,
|
|
|
- oaReceiveObjs: [],
|
|
|
+ oaPurchaseObjs: [],
|
|
|
sunMoney: undefined,
|
|
|
supplier:undefined,
|
|
|
reason: undefined,
|
|
|
@@ -227,11 +227,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
changeMoney(index){
|
|
|
- if(this.form.oaReceiveObjs[index].money){
|
|
|
- let money = this.form.oaReceiveObjs[index].money;
|
|
|
- this.form.oaReceiveObjs[index].money = money;
|
|
|
- let arr = this.form.oaReceiveObjs;
|
|
|
- this.form.estimatedCost = this.sum(arr);
|
|
|
+ if(this.form.oaPurchaseObjs[index].money){
|
|
|
+ let money = this.form.oaPurchaseObjs[index].money;
|
|
|
+ this.form.oaPurchaseObjs[index].money = money;
|
|
|
+ let arr = this.form.oaPurchaseObjs;
|
|
|
+ this.form.sunMoney = this.sum(arr);
|
|
|
}
|
|
|
|
|
|
},
|
|
|
@@ -245,8 +245,8 @@ export default {
|
|
|
* 新增行
|
|
|
*/
|
|
|
addRow() {
|
|
|
- let index = this.form.oaReceiveObjs.length;
|
|
|
- this.form.oaReceiveObjs.push({
|
|
|
+ let index = this.form.oaPurchaseObjs.length;
|
|
|
+ this.form.oaPurchaseObjs.push({
|
|
|
key: index,
|
|
|
name: '',
|
|
|
amount: '',
|
|
|
@@ -259,14 +259,14 @@ export default {
|
|
|
* @param row
|
|
|
*/
|
|
|
handleDeleteRow(row) {
|
|
|
- let datas = this.form.oaReceiveObjs;
|
|
|
+ let datas = this.form.oaPurchaseObjs;
|
|
|
for (var i = 0; i < datas.length; i++) {
|
|
|
if (datas[i].key == row.key) {
|
|
|
datas.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
- let arr = this.form.oaReceiveObjs;
|
|
|
- this.form.estimatedCost = this.sum(arr);
|
|
|
+ let arr = this.form.oaPurchaseObjs;
|
|
|
+ this.form.sunMoney = this.sum(arr);
|
|
|
},
|
|
|
getDateStar(ms) {
|
|
|
return getDate(ms);
|