| | |
| | | </basic-container> |
| | | <el-dialog title="同步IFS" :visible.sync="dialogVisible" width="30%" :before-close="handleClose"> |
| | | <el-row> |
| | | <el-col :span="6""> |
| | | <el-col :span="6" style="height: 40px;line-height: 30px;"> |
| | | 同步日期: |
| | | </el-col> |
| | | <el-col :span="18"> |
| | | <el-date-picker style="width: 100%;" v-model="selectDate" type="date" placeholder="选择日期"> |
| | | <el-date-picker style="width: 100%;height: 100%;" v-model="selectDate" type="date" placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | fun: this.addOrUpdateHandle |
| | | }, |
| | | { |
| | | text: '同步IFS', |
| | | text: '获取IFS零件', |
| | | type: 'primary', |
| | | fun: this.syncISDate, |
| | | loading: false |
| | |
| | | // }, |
| | | syncISDate() { |
| | | this.dialogVisible = true |
| | | this.selectDate=null |
| | | }, |
| | | syncIfs() { |
| | | this.table.toolbar.find((e) => e.text === '同步IFS').loading = true |
| | | this.handleClose() |
| | | let data=new FormData() |
| | | data.append("date",this.selectDatethis.selectDate) |
| | | console.log(data); |
| | | syncPart(data) |
| | | this.dialogVisible = false |
| | | let datas=new FormData() |
| | | datas.set("date",this.selectDate) |
| | | // console.log(datas.get("date")); |
| | | |
| | | // console.log(this.selectDate); |
| | | // return |
| | | syncPart(datas) |
| | | .then((res) => { |
| | | const data = res.data |
| | | console.log(data); |
| | | if (data.code === 0) { |
| | | this.$message.success('开始同步') |
| | | if(data.data>0){ |
| | | this.$message.success('同步成功'+data.data+"条数据") |
| | | } |
| | | if(data.data<1){ |
| | | this.$message.warning("该日期没有新的零件数据"); |
| | | } |
| | | this.table.toolbar.find((e) => e.text === '同步IFS').loading = false |
| | | this.getData() |
| | | } else { |
| | | this.$message.error('同步IFS失败') |
| | | this.table.toolbar.find((e) => e.text === '同步IFS').loading = false |
| | | this.getData() |
| | | } |
| | | }) |
| | | .catch((e) => { |