自动数据更新功能添加拦截
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(1)">自动记录同步</el-button>
|
||||
<el-button :disabled="syncLoading" type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(1)">自动记录同步</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-warning" size="mini" @click="errorDialogShow = true">异常检测</el-button>
|
||||
@@ -185,7 +185,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="resetRecordQuery">搜索</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(2)">自动记录同步</el-button>
|
||||
<el-button :disabled="syncLoading" type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(2)">自动记录同步</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 数据区域 -->
|
||||
@@ -265,6 +265,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
syncLoading: false,
|
||||
labelWidth: '100px',
|
||||
formLabelWidth: '100px',
|
||||
// 选中id数组
|
||||
@@ -676,7 +677,8 @@ export default {
|
||||
})
|
||||
},
|
||||
handleRecordSync(actionType = 1) {
|
||||
let partnumber = ''
|
||||
this.syncLoading = true
|
||||
let _partnumber = this.RecordQueryParams.partnumber
|
||||
let startTime = this.$dayjs(this.MinStocktakingTime)
|
||||
// 1-全部 2-指定零件同步
|
||||
let params = {
|
||||
@@ -685,7 +687,7 @@ export default {
|
||||
endTime: this.$dayjs().endOf('month').format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
if (actionType === 2) {
|
||||
params.partnumber = this.RecordQueryParams.partnumber
|
||||
params.partnumber = _partnumber
|
||||
}
|
||||
// 执行同步操作
|
||||
generateWmOneTimeRecord(params).then((res) => {
|
||||
@@ -693,8 +695,14 @@ export default {
|
||||
this.msgSuccess('同步成功')
|
||||
this.getRecordList()
|
||||
this.getList()
|
||||
setTimeout(() => {
|
||||
this.syncLoading = false
|
||||
}, 2000)
|
||||
} else {
|
||||
this.msgError('同步异常')
|
||||
setTimeout(() => {
|
||||
this.syncLoading = false
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">库存清单导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(1)">自动记录同步</el-button>
|
||||
<el-button :disabled="syncLoading" type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(1)">自动记录同步</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -174,7 +174,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="resetRecordQuery">搜索</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(2)">自动记录同步</el-button>
|
||||
<el-button :disabled="syncLoading" type="primary" icon="el-icon-refresh" size="mini" @click="handleRecordSync(2)">自动记录同步</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 数据区域 -->
|
||||
@@ -250,6 +250,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
syncLoading: false,
|
||||
labelWidth: '100px',
|
||||
formLabelWidth: '100px',
|
||||
// 选中id数组
|
||||
@@ -672,7 +673,8 @@ export default {
|
||||
})
|
||||
},
|
||||
handleRecordSync(actionType = 1) {
|
||||
let partnumber = ''
|
||||
this.syncLoading = true
|
||||
let _partnumber = this.RecordQueryParams.partnumber
|
||||
let startTime = this.$dayjs(this.MinStocktakingTime)
|
||||
// 1-全部 2-指定零件同步
|
||||
let params = {
|
||||
@@ -681,7 +683,7 @@ export default {
|
||||
endTime: this.$dayjs().endOf('month').format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
if (actionType === 2) {
|
||||
params.partnumber = this.RecordQueryParams.partnumber
|
||||
params.partnumber = _partnumber
|
||||
}
|
||||
// 执行同步操作
|
||||
generateWmPolishRecord(params).then((res) => {
|
||||
@@ -689,8 +691,14 @@ export default {
|
||||
this.msgSuccess('同步成功')
|
||||
this.getRecordList()
|
||||
this.getList()
|
||||
setTimeout(() => {
|
||||
this.syncLoading = false
|
||||
}, 2000)
|
||||
} else {
|
||||
this.msgError('同步异常')
|
||||
setTimeout(() => {
|
||||
this.syncLoading = false
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user