|
@@ -125,17 +125,8 @@
|
|
|
prop="exprStatus"
|
|
|
width="">
|
|
|
<template slot-scope="scope">
|
|
|
-<!-- <span v-if="daysLater(scope.row.exprTime)">-->
|
|
|
-<!-- -->
|
|
|
-<!-- 正常-->
|
|
|
-<!-- </span>-->
|
|
|
- <span>
|
|
|
- {{ scope.row.exprStatus }}
|
|
|
- </span>
|
|
|
-
|
|
|
-<!-- <span v-if="!daysLater(scope.row.exprTime)">-->
|
|
|
-<!-- 过期-->
|
|
|
-<!-- </span>-->
|
|
|
+ <span v-if="daysLater(scope.row.exprTime)">正常</span>
|
|
|
+ <span v-else>过期</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column :label="$t('btMaterial.material.mtWeight')" :show-overflow-tooltip="true" align="center"-->
|
|
@@ -150,7 +141,7 @@
|
|
|
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width"
|
|
|
width="100px">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <i @click="changeMtrInBar(row)" class="el-icon-edit table-operation" :title="$t('common.edit')"
|
|
|
+ <i @click="changeMtr(row)" class="el-icon-edit table-operation" :title="$t('common.edit')"
|
|
|
style="color: #2db7f5;"/>
|
|
|
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
|
|
style="color: #f50;"/>
|
|
@@ -172,7 +163,7 @@
|
|
|
@close="addMtrClose"
|
|
|
@success="editSuccess"
|
|
|
ref="addMtr"
|
|
|
- />
|
|
|
+ />
|
|
|
<el-dialog
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="true"
|
|
@@ -209,17 +200,14 @@ export default {
|
|
|
type: {
|
|
|
type: String,
|
|
|
default: "addEquBarrel",
|
|
|
- },
|
|
|
- equId: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
}
|
|
|
},
|
|
|
filters: {},
|
|
|
data() {
|
|
|
return {
|
|
|
tenant: this.initTenant(),
|
|
|
- threeDaysLater:this.daysLater(),
|
|
|
+ equId: '',
|
|
|
+ //threeDaysLater:this.daysLater(),
|
|
|
// 编辑
|
|
|
addBarrelDialog: {
|
|
|
isVisible: false,
|
|
@@ -301,8 +289,9 @@ export default {
|
|
|
},
|
|
|
daysLater(val){
|
|
|
let dqTime = new Date(val);
|
|
|
+ let nTime = dqTime.setDate(dqTime.getDate()+3)
|
|
|
let now = new Date();
|
|
|
- console.log("开始比较时间"+dqTime+"当前时间"+now)
|
|
|
+ return (nTime>now)? true : false;
|
|
|
},
|
|
|
setTenant(val = {}) {
|
|
|
const vm = this;
|
|
@@ -314,11 +303,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getEquMtr(equId) {
|
|
|
+ getEquMtr(equId) {
|
|
|
this.loading = true;
|
|
|
this.queryParams.sort="updateTime";
|
|
|
this.queryParams.model.equId=equId;
|
|
|
- EquBarrelApi.query({'equId': equId}).then(response => {
|
|
|
+ EquBarrelApi.query(this.queryParams).then(response => {
|
|
|
|
|
|
let res = response.data
|
|
|
if (res.isSuccess) {
|
|
@@ -348,8 +337,10 @@ export default {
|
|
|
editClose() {
|
|
|
this.dialog.isVisible = false;
|
|
|
},
|
|
|
- editSuccess() {
|
|
|
- this.getEquMtr();
|
|
|
+ editSuccess() {
|
|
|
+ this.selection = []
|
|
|
+ this.clearSelections();
|
|
|
+ this.getEquMtr(this.equId);
|
|
|
},
|
|
|
|
|
|
addBarrelClose() {
|
|
@@ -364,9 +355,7 @@ export default {
|
|
|
this.selection = selection;
|
|
|
},
|
|
|
search() {
|
|
|
- this.fetch({
|
|
|
- ...this.queryParams
|
|
|
- });
|
|
|
+ this.getEquMtr(this.equId)
|
|
|
},
|
|
|
close() {
|
|
|
this.$emit("close");
|
|
@@ -440,7 +429,7 @@ export default {
|
|
|
this.$refs.table.clearSelection();
|
|
|
},
|
|
|
delete(ids) {
|
|
|
- materialApi.delete({ids: ids}).then(response => {
|
|
|
+ EquBarrelApi.delete({ids: ids}).then(response => {
|
|
|
const res = response.data;
|
|
|
if (res.isSuccess) {
|
|
|
this.$message({
|
|
@@ -482,10 +471,13 @@ export default {
|
|
|
|
|
|
this.$refs.addMtr.addMtr(this.selection[0]);
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
+ changeMtr(row){
|
|
|
+ console.log(row)
|
|
|
+ this.addMtrDialog.type = "changeMtrInBar";
|
|
|
+ this.addMtrDialog.isVisible = true;
|
|
|
+ this.$refs.addMtr.addMtr(row);
|
|
|
+ },
|
|
|
changeMtrInBar() {
|
|
|
-
|
|
|
if (!this.selection.length) {
|
|
|
this.$message({
|
|
|
message: this.$t("tips.unSelected"),
|
|
@@ -501,22 +493,13 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
this.addMtrDialog.type = "changeMtrInBar";
|
|
|
this.addMtrDialog.isVisible = true;
|
|
|
|
|
|
this.$refs.addMtr.addMtr(this.selection[0]);
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
rectifyMtr() {
|
|
|
-
|
|
|
if (!this.selection.length) {
|
|
|
this.$message({
|
|
|
message: this.$t("tips.unSelected"),
|