|
|
@@ -27,7 +27,7 @@ |
|
|
|
<el-table-column prop="QueueInfo" :label="$t('resourcesManagement.resQueue')" align="center" |
|
|
|
header-align="center" min-width="100"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="SourceSpecId" :label="$t('resourcesManagement.sourceSpecId')" align="center" |
|
|
|
<el-table-column prop="SourceSpecId" :label="$t('resourcesManagement.sourceSpecCode')" align="center" |
|
|
|
header-align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="AccCardsNum" :label="$t('resourcesManagement.accCardsNum')" align="center" |
|
|
@@ -66,12 +66,12 @@ |
|
|
|
</span> |
|
|
|
<span v-if="scope.row.Status == '2'"> |
|
|
|
<span class="op-btn" @click="showDialog('edit', scope.row, true)">{{ $t('edit') }}</span> |
|
|
|
<span class="op-btn" @click="onOrOffShelf('off-shelf', scope.row)">{{ |
|
|
|
<span class="op-btn" @click="offShelfPrev(scope.row)">{{ |
|
|
|
$t('resourcesManagement.toOffShelf') |
|
|
|
}}</span> |
|
|
|
</span> |
|
|
|
<span v-if="scope.row.Status == '3' || scope.row.Status == '1' && scope.row.UnitPrice"> |
|
|
|
<span class="op-btn" @click="onOrOffShelf('on-shelf', scope.row)">{{ |
|
|
|
<span class="op-btn" @click="onShelf(scope.row)">{{ |
|
|
|
$t('resourcesManagement.toOnShelf') |
|
|
|
}}</span> |
|
|
|
</span> |
|
|
@@ -98,12 +98,29 @@ |
|
|
|
<SpecificationDialog :visible.sync="specificationDialogShow" :type="specificationDialogType" |
|
|
|
:editOr="specificationDialogEditOr" :data="specificationDialogData" @confirm="specificationDialogConfirm"> |
|
|
|
</SpecificationDialog> |
|
|
|
|
|
|
|
<BaseDialog :visible.sync="offShelfDialogShow" :width="`600px`" :title="$t('tips')"> |
|
|
|
<div class="form"> |
|
|
|
<div class="form-row" style="flex-direction:column;"> |
|
|
|
<div class="content" style="margin:8px 0">{{ $t('resourcesManagement.offShelfDlgTip1') }}</div> |
|
|
|
<div class="content" style="margin:8px 0;font-weight: bold;">{{ offSelfDialogContent }}</div> |
|
|
|
<div class="content" style="margin:8px 0">{{ $t('resourcesManagement.offShelfDlgTip2') }}</div> |
|
|
|
</div> |
|
|
|
<div class="form-row" style="margin-top: 20px"> |
|
|
|
<div class="content"> |
|
|
|
<el-button type="primary" class="btn confirm-btn" @click="offShelf">{{ $t('confirm') }}</el-button> |
|
|
|
<el-button class="btn" @click="offShelfDialogShow = false">{{ $t('cancel') }}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</BaseDialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import SpecificationDialog from '../components/SpecificationDialog.vue'; |
|
|
|
import { getResQueueCode, getResSpecificationList, updateResSpecification, syncResSpecification } from '~/apis/modules/resources'; |
|
|
|
import BaseDialog from '~/components/BaseDialog.vue'; |
|
|
|
import { getResQueueCode, getResSpecificationList, updateResSpecification, syncResSpecification, getResSpecificationScenes } from '~/apis/modules/resources'; |
|
|
|
import { SPECIFICATION_STATUS, CLUSTERS, ACC_CARD_TYPE } from '~/const'; |
|
|
|
import { getListValueWithKey } from '~/utils'; |
|
|
|
import { formatDate } from 'element-ui/lib/utils/date-util'; |
|
|
@@ -130,9 +147,13 @@ export default { |
|
|
|
specificationDialogType: 'add', |
|
|
|
specificationDialogEditOr: false, |
|
|
|
specificationDialogData: {}, |
|
|
|
|
|
|
|
offShelfDialogShow: false, |
|
|
|
offShelfDialogData: {}, |
|
|
|
offSelfDialogContent: '', |
|
|
|
}; |
|
|
|
}, |
|
|
|
components: { SpecificationDialog }, |
|
|
|
components: { BaseDialog, SpecificationDialog }, |
|
|
|
methods: { |
|
|
|
getQueueList() { |
|
|
|
getResQueueCode().then(res => { |
|
|
@@ -233,7 +254,8 @@ export default { |
|
|
|
this.specificationDialogShow = false; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
onOrOffShelf(type, data) { |
|
|
|
onShelf(data) { |
|
|
|
const type = 'on-shelf'; |
|
|
|
this.$confirm(type === 'on-shelf' ? this.$t('resourcesManagement.onShelfConfirm') : this.$t('resourcesManagement.offShelfConfirm'), this.$t('tips'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
@@ -252,10 +274,17 @@ export default { |
|
|
|
}); |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: this.$t('submittedFailed') |
|
|
|
}); |
|
|
|
if (type === 'on-shelf' && res.Code === 1001) { |
|
|
|
this.$message({ |
|
|
|
type: 'info', |
|
|
|
message: this.$t('resourcesManagement.onShelfCode1001') |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: this.$t('submittedFailed') |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
@@ -265,7 +294,59 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).catch(() => { }); |
|
|
|
} |
|
|
|
}, |
|
|
|
offShelfPrev(data) { |
|
|
|
this.$confirm(this.$t('resourcesManagement.offShelfConfirm'), this.$t('tips'), { |
|
|
|
confirmButtonText: this.$t('confirm'), |
|
|
|
cancelButtonText: this.$t('cancel'), |
|
|
|
type: 'warning', |
|
|
|
lockScroll: false, |
|
|
|
}).then(() => { |
|
|
|
this.offShelfDialogData = data; |
|
|
|
getResSpecificationScenes({ ID: data.ID }).then(res => { |
|
|
|
res = res.data; |
|
|
|
if (res.Code === 0) { |
|
|
|
if (res.Data.List.length) { |
|
|
|
this.offShelfDialogShow = true; |
|
|
|
this.offSelfDialogContent = res.Data.List.map((item) => `[${item.ID}]${item.SceneName}`).join(', '); |
|
|
|
} else { |
|
|
|
this.offShelf(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log(res); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
}).catch(() => { }); |
|
|
|
}, |
|
|
|
offShelf() { |
|
|
|
updateResSpecification({ |
|
|
|
ID: this.offShelfDialogData.ID, |
|
|
|
action: 'off-shelf' |
|
|
|
}).then(res => { |
|
|
|
res = res.data; |
|
|
|
if (res.Code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: this.$t('submittedSuccessfully') |
|
|
|
}); |
|
|
|
this.offShelfDialogShow = false; |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: this.$t('submittedFailed') |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: this.$t('submittedFailed') |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted: function () { |
|
|
|
this.getQueueList(); |
|
|
@@ -334,4 +415,36 @@ export default { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
} |
|
|
|
|
|
|
|
.form { |
|
|
|
margin: 5px 0 5px 0; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.form-row { |
|
|
|
display: flex; |
|
|
|
min-height: 42px; |
|
|
|
margin-bottom: 4px; |
|
|
|
|
|
|
|
.content { |
|
|
|
width: 500px; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.btn { |
|
|
|
color: rgb(2, 0, 4); |
|
|
|
background-color: rgb(194, 199, 204); |
|
|
|
border-color: rgb(194, 199, 204); |
|
|
|
|
|
|
|
&.confirm-btn { |
|
|
|
color: #fff; |
|
|
|
background-color: rgb(56, 158, 13); |
|
|
|
border-color: rgb(56, 158, 13); |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |