|
@@ -9,7 +9,7 @@
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<el-form-item label="时间">
|
|
<el-form-item label="时间">
|
|
<zj-timegran-date v-model="filterForm.data.clock" style="width: 100%;" :type="'daterange'"
|
|
<zj-timegran-date v-model="filterForm.data.clock" style="width: 100%;" :type="'daterange'"
|
|
- timegranId='MONTH' :oneFoo="getTableData" :defaultOffset="-1" :custom="1"></zj-timegran-date>
|
|
|
|
|
|
+ timegranId='MONTH' :oneFoo="getTableData" :defaultOffset="-1"></zj-timegran-date>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
@@ -40,7 +40,7 @@
|
|
</el-form>
|
|
</el-form>
|
|
<div class="box-top-gjl">
|
|
<div class="box-top-gjl">
|
|
<el-button class="button" type="primary" size="mini" icon="el-icon-save" v-privilege="activeMenu + 'PUT'"
|
|
<el-button class="button" type="primary" size="mini" icon="el-icon-save" v-privilege="activeMenu + 'PUT'"
|
|
- @click="but_more()">修改</el-button>
|
|
|
|
|
|
+ @click="but_more()">保存</el-button>
|
|
<div style="float:right; text-align: right;">
|
|
<div style="float:right; text-align: right;">
|
|
<el-button class="button" type="primary" size="mini" icon="el-icon-search"
|
|
<el-button class="button" type="primary" size="mini" icon="el-icon-search"
|
|
v-privilege="activeMenu + 'QUERY'" @click="getTableData(1)">查询</el-button>
|
|
v-privilege="activeMenu + 'QUERY'" @click="getTableData(1)">查询</el-button>
|
|
@@ -57,7 +57,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="box-bottom">
|
|
<div class="box-bottom">
|
|
<el-form size="mini" ref="dialog_form_arr" label-width="0px" :model="tableFormDataObj">
|
|
<el-form size="mini" ref="dialog_form_arr" label-width="0px" :model="tableFormDataObj">
|
|
- <el-table stripe id="singleTable" ref="singleTable" :data="tableData" v-loading="tableLoading"
|
|
|
|
|
|
+ <el-table stripe id="singleTable" ref="singleTable" :data="tableData.arr" v-loading="tableLoading"
|
|
style="width: 100%;" :height="singleTableHeight" border size="mini" highlight-current-row show-summary
|
|
style="width: 100%;" :height="singleTableHeight" border size="mini" highlight-current-row show-summary
|
|
:summary-method="getSummaries" @selection-change="handleSelectionChange" @cell-click="cellClick" :row-class-name="tableRowClassName">
|
|
:summary-method="getSummaries" @selection-change="handleSelectionChange" @cell-click="cellClick" :row-class-name="tableRowClassName">
|
|
>
|
|
>
|
|
@@ -177,7 +177,10 @@
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
total: 0,
|
|
total: 0,
|
|
singleTableHeight: 100,
|
|
singleTableHeight: 100,
|
|
- tableData: [],
|
|
|
|
|
|
+ tableData: {
|
|
|
|
+ obj: {},
|
|
|
|
+ arr:[]
|
|
|
|
+ },
|
|
nameObj: {
|
|
nameObj: {
|
|
timegranid: {
|
|
timegranid: {
|
|
obj: {
|
|
obj: {
|
|
@@ -462,7 +465,7 @@
|
|
})
|
|
})
|
|
.then(function(res) {
|
|
.then(function(res) {
|
|
if (res.code === '0') {
|
|
if (res.code === '0') {
|
|
- let arr = [];
|
|
|
|
|
|
+ let arr = [],obj = {};
|
|
let seq = 0;
|
|
let seq = 0;
|
|
for (let item of res.data.list) {
|
|
for (let item of res.data.list) {
|
|
arr.push({
|
|
arr.push({
|
|
@@ -483,10 +486,30 @@
|
|
UPMAN: item.UPMAN,
|
|
UPMAN: item.UPMAN,
|
|
TABLENAME: item.TABLENAME,
|
|
TABLENAME: item.TABLENAME,
|
|
seq: seq
|
|
seq: seq
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ obj[item.CLOCK + item.ITEMID] = {
|
|
|
|
+ clock: item.CLOCK,
|
|
|
|
+ itemid: item.ITEMID,
|
|
|
|
+ timegranid: item.TIMEGRANID,
|
|
|
|
+ workprocid: item.WORKPROCID,
|
|
|
|
+ materialid: item.CODE,
|
|
|
|
+ actualvalue: item.ACTUALVALUE,
|
|
|
|
+ correctvalue: item.CORRECTVALUE,
|
|
|
|
+ apportvalue: item.APPORTVALUE,
|
|
|
|
+ JTZ: item.JTZ,
|
|
|
|
+ unitid: item.UNITID,
|
|
|
|
+ bz: item.BZ,
|
|
|
|
+ USERID: item.USERID,
|
|
|
|
+ UPDATETIME: item.UPDATETIME,
|
|
|
|
+ UPTIME: item.UPTIME,
|
|
|
|
+ UPMAN: item.UPMAN,
|
|
|
|
+ TABLENAME: item.TABLENAME,
|
|
|
|
+ seq: seq
|
|
|
|
+ };
|
|
seq++;
|
|
seq++;
|
|
}
|
|
}
|
|
- that.tableData = arr;
|
|
|
|
|
|
+ that.tableData.arr = arr;
|
|
|
|
+ that.tableData.obj = obj;
|
|
that.total = res.data.total;
|
|
that.total = res.data.total;
|
|
} else {
|
|
} else {
|
|
that.$message.error(res.message);
|
|
that.$message.error(res.message);
|
|
@@ -525,7 +548,7 @@
|
|
arr.push(item.seq);
|
|
arr.push(item.seq);
|
|
}
|
|
}
|
|
this.seqArr = arr.sort(sortNumber);
|
|
this.seqArr = arr.sort(sortNumber);
|
|
- for (let item of that.tableData) {
|
|
|
|
|
|
+ for (let item of that.tableData.arr) {
|
|
item.isSelection = false;
|
|
item.isSelection = false;
|
|
}
|
|
}
|
|
for (let item of val) {
|
|
for (let item of val) {
|
|
@@ -548,7 +571,7 @@
|
|
but_more() {
|
|
but_more() {
|
|
let that = this;
|
|
let that = this;
|
|
let url = 'pass/ems/v1/ifmesemsswapfile/updateWorkprocInventory/';
|
|
let url = 'pass/ems/v1/ifmesemsswapfile/updateWorkprocInventory/';
|
|
- let submitData = [];
|
|
|
|
|
|
+ let submitData = [],sumVal = 0,clock = '';
|
|
for (let item in that.tableFormDataObj) {
|
|
for (let item in that.tableFormDataObj) {
|
|
submitData.push({
|
|
submitData.push({
|
|
itemid: that.tableFormDataObj[item].itemid,
|
|
itemid: that.tableFormDataObj[item].itemid,
|
|
@@ -558,6 +581,32 @@
|
|
bz: that.tableFormDataObj[item].bz,
|
|
bz: that.tableFormDataObj[item].bz,
|
|
tableName: that.tableFormDataObj[item].TABLENAME
|
|
tableName: that.tableFormDataObj[item].TABLENAME
|
|
})
|
|
})
|
|
|
|
+ if(that.tableFormDataObj[item].itemid === 'AT2004CP003R') {
|
|
|
|
+ if(sumVal > 0) {
|
|
|
|
+ sumVal = sumVal - Number(that.tableData.obj[that.tableFormDataObj[item].clock + 'AT2004CP003R'].JTZ) + Number(that.tableFormDataObj[item].JTZ);
|
|
|
|
+ } else{
|
|
|
|
+ sumVal = Number(that.tableFormDataObj[item].JTZ) + Number(that.tableData.obj[that.tableFormDataObj[item].clock + 'AT2004CP002R'].JTZ);
|
|
|
|
+ }
|
|
|
|
+ clock = that.tableFormDataObj[item].clock;
|
|
|
|
+ }
|
|
|
|
+ if(that.tableFormDataObj[item].itemid === 'AT2004CP002R') {
|
|
|
|
+ if(sumVal > 0) {
|
|
|
|
+ sumVal = sumVal - Number(that.tableData.obj[that.tableFormDataObj[item].clock + 'AT2004CP002R'].JTZ) + Number(that.tableFormDataObj[item].JTZ);
|
|
|
|
+ } else{
|
|
|
|
+ sumVal = Number(that.tableFormDataObj[item].JTZ) + Number(that.tableData.obj[that.tableFormDataObj[item].clock + 'AT2004CP003R'].JTZ);
|
|
|
|
+ }
|
|
|
|
+ clock = that.tableFormDataObj[item].clock;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(sumVal > 0) {
|
|
|
|
+ submitData.push({
|
|
|
|
+ itemid: 'AT2004CP054R',
|
|
|
|
+ clock: clock,
|
|
|
|
+ timegranid: that.filterForm.data.timegranid,
|
|
|
|
+ JTZ: sumVal,
|
|
|
|
+ bz: that.tableData.obj[clock + 'AT2004CP054R'].bz,
|
|
|
|
+ tableName: that.tableData.obj[clock + 'AT2004CP054R'].TABLENAME
|
|
|
|
+ })
|
|
}
|
|
}
|
|
that.axios.put(url, submitData)
|
|
that.axios.put(url, submitData)
|
|
.then(function(res) {
|
|
.then(function(res) {
|