Commit 31f4e7e1 authored by 张伯涛's avatar 张伯涛

Merge remote-tracking branch 'origin/master'

parents d2dd403b 9838e398
// 生产模型api
import request from '@/utils/request'
import Qs from 'qs'
// 分页查询列表
export function listModel(query) {
......@@ -17,3 +18,32 @@ export function deleteLogicalId(data) {
method: 'delete',
})
}
// 复制
export function queryCopyNltModels(params) {
return request({
url: '/nltmodel/queryCopyNltModels',
method: 'get',
params
})
}
// 查询物料列表
export function queryNltIfsMaterialCopyByPagination(query) {
return request({
url: '/nltifsmaterial/queryNltIfsMaterialCopyByPagination',
method: 'get',
params: query
})
}
// 修改生产模型状态
export function updateStatus(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/nltmodel/updateStatus/' + businessId,
method: 'put',
data
})
}
// 同步数据api
import request from '@/utils/request'
export function getSync(query) {
return request({
url: '/nltscheduledresult/queryNltScheduledResultByPagination',
method: 'get',
params: query
})
}
export function onSchedule() {
return request({
url: '/nltscheduledresult/onSchedule',
method: 'get'
})
}
// 删除同步数据(逻辑删除)
export function delSchedule(businessId) {
return request({
url: '/nltscheduledresult/delete/' + businessId,
method: 'delete'
})
}
......@@ -515,7 +515,7 @@ export default {
this.$router.push({
path: '/ProductionProcess/ModelDetails',
query: {
businessId: row.businessId,
businessId: row.orderModelId,
type: '2'
}
})
......
......@@ -181,63 +181,50 @@
</div>
<el-input style="width: 90%" :maxlength="50" show-word-limit v-model.trim="form.softwareVer" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div>配置SN规则</div>
<div style="margin-top: 20px; border: 1px solid gray; padding: 10px" v-for="(item, index) in form.nltMaterialEditList">
<el-form ref="form1" :rules="rules1" :model="item" size="small" label-width="120px">
<el-row>
<el-col :span="13">
<el-form-item class="labelHeight" label="总位数" prop="totalDigits">
<div slot="label" class="labelClass">
<div class="labelName">总位数</div>
</div>
<el-input :maxlength="2" v-model.trim="item.totalDigits" placeholder="请输入总位数" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item style="position: relative; right: 80px" class="labelHeight" label="分组" prop="group">
<div slot="label" class="labelClass">
<div class="labelName">分组</div>
</div>
<el-select v-model.trim="item.editGroup" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.value"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row class="rowMini" v-for="(item1, index1) in item.nltMaterialEditRules">
<el-form ref="form2" :rules="rules2" :model="item1" size="small" label-width="120px">
<el-col :span="13">
<el-form-item class="labelHeight" label="规则设置" prop="ruleByte">
<div slot="label" class="labelClass">
<div class="labelName">规则设置</div>
</div>
<el-input :maxlength="2" v-model.trim="item1.ruleByte"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="labelHeight1" prop="rules">
<el-input :maxlength="1" v-model.trim="item1.rules"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-link v-if="index1 === 0" style="margin-top: 20px" type="primary" @click="addSNRule(item, index)">增加一行</el-link>
<el-link v-if="index1 != 0" style="margin-top: 20px" type="primary" @click.prevent="delSNRule(item, index1)">删除</el-link>
</el-col>
</el-form>
</el-row>
<el-row>
<el-col :span="24">
<el-button style="float: right;" size="small" class="resetBtn" @click.prevent="delSNRules(item,index)">删除</el-button>
</el-col>
</el-row>
</el-form>
<div style="margin-top: 20px; border: 1px solid gray; padding: 10px" v-for="(item, index) in form.nltMaterialEditList" :key="index">
<el-row>
<el-col :span="13">
<el-form-item label="总位数" :prop="'nltMaterialEditList.' + index + '.totalDigits'" :rules="[{ required: true, validator: totalDigitsRule, trigger: 'blur' }]">
<el-input :maxlength="2" v-model.trim="item.totalDigits" placeholder="请输入总位数" />
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item style="position: relative; right: 80px" label="分组" :prop="'nltMaterialEditList.' + index + '.editGroup'">
<el-select v-model.trim="item.editGroup" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.value"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row class="rowMini" v-for="(item1, index1) in item.nltMaterialEditRules" :key="index1">
<el-col :span="13">
<el-form-item label="规则设置" :prop="'nltMaterialEditList.' + index + '.nltMaterialEditRules.' + index1 + '.ruleByte'" :rules="[{ required: true, validator: ruleByteRule, trigger: 'blur' }]">
<el-input :maxlength="2" v-model.trim="item1.ruleByte"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item class="labelHeight1" :prop="'nltMaterialEditList.' + index + '.nltMaterialEditRules.' + index1 + '.rules'" :rules="[{ required: true, validator: rulesRule, trigger: 'blur' }]">
<el-input :maxlength="1" v-model.trim="item1.rules"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-link v-if="index1 === 0" style="margin-top: 20px" type="primary" @click="addSNRule(item, index)">增加一行</el-link>
<el-link v-if="index1 !== 0" style="margin-top: 20px" type="primary" @click.prevent="delSNRule(item, index1)">删除</el-link>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-button style="float: right;" size="small" class="resetBtn" @click.prevent="delSNRules(item,index)">删除</el-button>
</el-col>
</el-row>
</div>
</el-form>
<div style="text-align: center">
<el-link type="primary" @click="addSNRules">+ 添加SN规则</el-link>
</div>
......@@ -261,22 +248,36 @@ import {
export default {
name: 'MaterialFile',
data() {
// 中文校验
const validQC = (rule, value, callback) => {
if (value) {
if (/[\u4E00-\u9FA5]/g.test(value)) {
callback(new Error('不能输入汉字'))
} else if (this.form.configurationRules === '') {
callback(new Error('不能输入汉字'))
} else {
callback()
}
callback()
}
}
return {
// 分组下拉框数据
options: [{value:'A'}, {value:'B'}, {value:'C'}, {value:'D'}, {value:'E'}, {value:'F'}, {value:'G'}, {value:'H'}, {value:'I'}, {value:'J'}, {value:'K'}, {value:'L'}, {value:'M'}, {value:'N'}, {value:'O'}, {value:'P'}, {value:'Q'}, {value:'R'}, {value:'S'}, {value:'T'}, {value:'U'}, {value:'V'}, {value:'W'}, {value:'X'}, {value:'Y'}, {value:'Z'},],
options: [
{ value: 'A' },
{ value: 'B' },
{ value: 'C' },
{ value: 'D' },
{ value: 'E' },
{ value: 'F' },
{ value: 'G' },
{ value: 'H' },
{ value: 'I' },
{ value: 'J' },
{ value: 'K' },
{ value: 'L' },
{ value: 'M' },
{ value: 'N' },
{ value: 'O' },
{ value: 'P' },
{ value: 'Q' },
{ value: 'R' },
{ value: 'S' },
{ value: 'T' },
{ value: 'U' },
{ value: 'V' },
{ value: 'W' },
{ value: 'X' },
{ value: 'Y' },
{ value: 'Z' }
],
// 搜索栏隐藏判断,默认显示
showSearch: true,
// 查询参数
......@@ -297,17 +298,36 @@ export default {
// 遮罩开启标志
open: false,
// 表单数据
form: {},
form: {
softwareVer: '',
nltMaterialEditList: [
{
totalDigits: '',
editGroup: 'A',
nltMaterialEditRules: [
{
ruleByte: '',
rules: ''
}
]
}
]
},
// 表单2数据
form1: {
totalDigits: '',
editGroup: 'A',
nltMaterialEditRules: [
{ruleByte: '', rules: ''}
{
ruleByte: '',
rules: ''
}
]
},
// 表单3数据
form2: {
ruleByte: '', rules: ''
ruleByte: '',
rules: ''
},
rules: {},
// 表单校验规则2
......@@ -318,21 +338,6 @@ export default {
message: '请输入正整数',
trigger: 'blur'
}
],
},
// 表单校验规则3
rules2: {
ruleByte: [
{
pattern: /^([1-9]\d*|[0]{1,1})$/,
message: '请输入正整数',
trigger: 'blur'
}
],
rules: [
{
validator: validQC, trigger: 'blur'
}
]
},
// 存储当前物料信息
......@@ -408,7 +413,7 @@ export default {
this.Loading1 = false
this.form.nltMaterialEditList.forEach(item => {
if (item.nltMaterialEditRules.length === 0) {
item.nltMaterialEditRules = [{ruleByte: '', rules: ''}]
item.nltMaterialEditRules = [{ ruleByte: '', rules: '' }]
}
})
console.log(this.form)
......@@ -450,32 +455,76 @@ export default {
this.reset()
},
// 对话框确定按钮
compare(prop) {
return function(obj1, obj2) {
const val1 = obj1[prop]
const val2 = obj2[prop]
if (val1 < val2) {
return -1
} else if (val1 > val2) {
return 1
} else {
return 0
}
}
},
submitForm() {
let rules = true
const EditList = []
let ruleList = []
this.form.nltMaterialEditList.forEach((item, index) => {
ruleList = []
item.nltMaterialEditRules.forEach((item1, index1) => {
ruleList.push({
ruleByte: item1.ruleByte,
rules: item1.rules
})
})
ruleList.sort(this.compare('ruleByte'))
EditList.push(ruleList)
})
for (let x = 0; x < EditList.length; x++) {
if (rules === false) {
continue
}
for (let y = 0; y < EditList.length; y++) {
if (rules === false) {
continue
}
if (x !== y) {
if (JSON.stringify(EditList[x]) === JSON.stringify(EditList[y])) {
rules = false
}
}
}
}
this.$refs['form'].validate(valid => {
if (valid) {
console.log(this.form, '这是修改后的form')
updateMaterial(this.form).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.open = false
this.getMatTable()
}
})
if (rules) {
updateMaterial(this.form).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.open = false
this.getMatTable()
}
})
} else {
this.$message.error('该规则已使用')
}
}
})
},
// 增加SN规则方法
addSNRules() {
let temp = JSON.parse(JSON.stringify(this.form1))
const temp = JSON.parse(JSON.stringify(this.form1))
this.form.nltMaterialEditList.push(temp)
},
// 增加SN规则方法2
addSNRule(item, index) {
console.log(item,index)
let temp = JSON.parse(JSON.stringify(this.form2))
const temp = JSON.parse(JSON.stringify(this.form2))
item.nltMaterialEditRules.push(temp)
},
// 删除SN规则方法
......@@ -492,16 +541,52 @@ export default {
softwareVer: undefined,
}
this.form1 = {
totalDigits: undefined,
totalDigits: '',
editGroup: 'A',
nltMaterialEditRules: [
{
ruleByte: undefined,
rules: undefined
ruleByte: '',
rules: ''
}
]
}
this.resetForm('form','form1','form2')
},
totalDigitsRule(rule, value, callback) {
if (!value) {
callback(new Error('请输入正整数'))
} else {
const reg = /(^[1-9][0-9]$)|(^100&)|(^[1-9]$)$/
if (reg.test(value)) {
callback();
} else {
return callback(new Error('请输入正整数'))
}
}
},
ruleByteRule(rule, value, callback) {
if (!value) {
callback(new Error('请输入正整数'))
} else {
const reg = /^([1-9]\d*|[0]{1,1})$/
if (reg.test(value)) {
callback();
} else {
return callback(new Error('请输入正整数'))
}
}
},
rulesRule(rule, value, callback) {
if (!value) {
callback(new Error('请输入规则'))
} else {
const reg = /[\u4E00-\u9FA5]/g
if (!reg.test(value)) {
callback()
} else {
return callback(new Error('不能输入汉字'))
}
}
}
}
}
</script>
......@@ -556,7 +641,6 @@ export default {
}
}
.el-form-item--small .el-form-item__label{
line-height: 17px;
}
.labelName{
display: flex;
......
<template>
<div class="model_details">
<div class="detailsSearch" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="form" :model="form" :rules="rules" style="padding: 0 0 0 20px" class="formClass" :inline="true" label-width="auto">
<el-form ref="form" :model="form" :rules="rules" style="padding: 0 0 0 20px" class="formClass" :inline="true">
<el-form-item class="labelHeight" label="模型类型" prop="modelType">
<div slot="label" class="labelClassRequired">
<div class="labelName">模型类型</div>
......@@ -120,7 +120,7 @@
</el-row>
<!-- 添加工站-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPosition" width="70%" :append-to-body="false">
<el-form ref="form1" :model="queryParams" label-width="auto" :inline="true">
<el-form ref="form1" :model="queryParams" :inline="true">
<el-form-item label="工站名称" prop="staName">
<div slot="label">
<div class="labelName">工站名称</div>
......@@ -199,7 +199,7 @@
</el-dialog>
<!-- 选择成品料号 物料料号-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPartNo" width="70%" :append-to-body="false">
<el-form ref="form2" :model="queryParams" label-width="auto" :inline="true">
<el-form ref="form2" :model="queryParams" :inline="true">
<el-form-item label="成品料号" prop="materCode">
<div slot="label">
<div class="labelName">成品料号</div>
......@@ -457,7 +457,7 @@ export default {
// 替换物料时 禁用自己的id判断
disabledId: '',
// 物料已被选中但是可编辑多选且提前查的id组 用于回显替换物料 状态1的时候传值
selectMaterIdStr: ''
selectMaterIList: []
}
},
watch: {
......@@ -594,7 +594,7 @@ export default {
this.queryParams.materCode = ''
this.queryParams.page = 1
this.queryParams.rows = 10
this.selectMaterIdStr = ''
this.selectMaterIList = []
this.openPartNo = true
this.title = '选择成品料号'
this.type = '3'
......@@ -607,7 +607,7 @@ export default {
this.queryParams.page = 1
this.queryParams.rows = 10
this.materQueryType = ''
this.selectMaterIdStr = ''
this.selectMaterIList = []
if (row) {
this.type = '1'
this.materQueryType = (row.configureOrNot === null || row.configureOrNot === undefined || row.configureOrNot === '') ? '0' : '1'
......@@ -625,7 +625,7 @@ export default {
this.disabledId = row.businessId
this.replaceMaterialList.forEach(item => {
this.materIdList.push(item.businessId)
this.selectMaterIdStr += item.businessId
this.selectMaterIList.push(item.businessId)
})
} else {
this.materIdList = []
......@@ -657,12 +657,15 @@ export default {
if (this.type === '2') {
this.materQueryType = ''
}
if (this.type === '1') {
str = this.materIdListType1.join(',')
}
const params = {
...this.queryParams,
businessIdList: str,
totalType: this.materQueryType,
type: '',
selectMaterIdStr: this.selectMaterIdStr
selectMaterIdStr: this.selectMaterIList.join(',')
}
if (this.type === '3') {
params.type = '3'
......@@ -997,9 +1000,15 @@ export default {
},
// 返回模型页面
cancelPosition() {
this.$router.push({
name: '/productionInfo/ProductionModel'
})
if (this.htmlType === '2') {
this.$router.push({
name: '/ProductionProcess/workOrder'
})
} else {
this.$router.push({
name: '/productionInfo/ProductionModel'
})
}
},
// 确定返回模型页面
submitPosition() {
......@@ -1045,7 +1054,6 @@ export default {
})
},
initData() {
for (let i = 0; i < this.positionList.length; i++) {
console.log(i)
this.positionList[i].sort = i
......
......@@ -108,7 +108,7 @@
</el-table-column>
<el-table-column
align="center"
width="300"
width="200"
class-name="small-padding fixed-width"
>
<template slot="header">
......@@ -122,12 +122,6 @@
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
<el-link
size="mini"
type="danger"
style="margin-left: 10px"
@click="handleDelete(scope.row)"
>复制</el-link>
<el-link
size="mini"
type="danger"
......@@ -136,10 +130,10 @@
>删除</el-link>
<el-link
size="mini"
type="danger"
type="success"
style="margin-left: 10px"
@click="handleQueryInfo(scope.row)"
>详情</el-link>
@click="handleCopy(scope.row)"
>复制</el-link>
</template>
</el-table-column>
</el-table>
......@@ -153,25 +147,113 @@
</el-col>
</el-row>
</div>
<!-- 选择成品料号 物料料号-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="'选择复制料号'" :visible.sync="openPartNo" width="70%" :append-to-body="false">
<el-form ref="form2" :model="queryParam" label-width="auto" :inline="true">
<el-form-item label="成品料号" prop="materCode">
<div slot="label">
<div class="labelName">成品料号</div>
<div class="labelName">Part Number</div>
</div>
<el-input
v-model="queryParam.materCode"
placeholder="请输入料号名称"
clearable
:maxlength="30"
size="small"
style="width: 200px"
/>
</el-form-item>
<el-form-item>
<el-button class="redBtn" type="danger" size="small" @click="queryCode">查询 Query</el-button>
<el-button class="resetBtn" size="small" @click="resetCode">重置 Reset</el-button>
</el-form-item>
<el-row :gutter="20">
<!--选择成品料号数据-->
<el-col :span="24" :xs="24" style="height: 300px">
<el-table
v-loading="loadingCode"
border
ref="materTable"
:header-row-class-name="cellClassMater"
style="padding-right: 10px;padding-left: 10px;margin-top: 10px"
:data="selectPartNum"
@selection-change="handleSelectionChangeMaterial"
@select="handleSelectionMaterial"
>
<el-table-column type="selection" width="50"/>
<el-table-column type="index" label="序号" width="50" />
<el-table-column align="center" prop="materCode" width="200" :show-overflow-tooltip="true">
<template slot="header">
<div>料号</div>
<div>Part No.</div>
</template>
<template v-slot:default="scope">
{{ scope.row.materCode || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="materDesc" :show-overflow-tooltip="true">
<template slot="header">
<div>物料描述</div>
<div>Description</div>
</template>
<template slot-scope="scope">
{{ scope.row.materDesc || '-' }}
</template>
</el-table-column>
<el-table-column align="center" width="200" prop="materUnit" :show-overflow-tooltip="true">
<template slot="header">
<div>单位</div>
<!-- <div>Position Type</div>-->
</template>
<template slot-scope="scope">
{{ scope.row.materUnit || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="totalMater>0"
:total="totalMater"
:page.sync="queryParam.page"
:limit.sync="queryParam.rows"
@pagination="partNum"
/>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="canleBtn" @click="cancelChoicePart">取 消 Cancel</el-button>
<el-button class="redBtn" type="danger" @click="submitChoicePart">确 定 Confirm</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listModel, deleteLogicalId } from '@/api/model'
import { listModel, deleteLogicalId, queryCopyNltModels, queryNltIfsMaterialCopyByPagination, updateStatus } from '@/api/model'
export default {
name: 'ProductionModel',
data() {
return {
addMaterialList: [],
loadingCode: false,
loading: false,
selectPartNum: [],
modelList: [],
total: 0,
totalMater: 0,
queryParams: {
page: 1,
rows: 10,
modelType: undefined,
partNo: undefined
},
queryParam: {
page: 1,
rows: 10,
materCode: ''
},
openPartNo: false,
// 新增模型弹窗
openModel: false,
// 添加工站弹窗
......@@ -183,6 +265,64 @@ export default {
this.getList()
},
methods: {
handleStatusChange(row) {
const params = {
businessId: row.businessId,
flag: row.flag
}
this.$confirm('确定' + (row.flag === '1' ? '启用' : '停用') + '该生产模型?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateStatus(params).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch(_ => {
row.flag = row.flag === '1' ? '0' : '1'
})
}).catch(() => {
row.flag = row.flag === '1' ? '0' : '1'
})
},
// 确定关闭选择成品料号弹窗
submitChoicePart() {
if (this.addMaterialList.length < 1) {
this.$message.error('请选择一条物料')
return
}
const params = {
businessId: this.businessId,
materId: this.addMaterialList[0].businessId
}
queryCopyNltModels(params).then(res => {
this.$message.success('复制成功')
this.openPartNo = false
this.getList()
})
},
// 关闭选择成品料号弹窗
cancelChoicePart() {
this.openPartNo = false
},
// 工单表样式
cellClassMater(row) {
return 'disabledSelection'
},
// 配置物料选择框
handleSelectionChangeMaterial(data) {
this.addMaterialList = data
},
// 单选
handleSelectionMaterial(selection, row) {
if (selection.length > 1) {
const del_row = selection.shift()
this.$refs.materTable.toggleRowSelection(del_row, false)//
}
},
/** 列表获取 */
getList() {
this.loading = true
......@@ -224,6 +364,26 @@ export default {
}
})
},
handleCopy(row) {
this.businessId = row.businessId
this.queryParam.materCode = ''
this.queryParam.page = 1
this.queryParam.rows = 10
this.openPartNo = true
this.partNum()
},
partNum() {
this.loadingCode = true
const params = {
...this.queryParam,
}
queryNltIfsMaterialCopyByPagination(this.queryParam).then(res => {
this.selectPartNum = res.rows
this.totalMater = res.total
this.loadingCode = false
})
},
// 删除生产模型
handleDelete(row) {
this.$confirm('确定删除该生产模型?', '提示', {
......@@ -250,13 +410,29 @@ export default {
type: '4'
}
})
}
},
// 成品料号表格查询
queryCode() {
this.queryParam.page = 1
this.partNum()
},
// 重置按钮
resetCode() {
this.queryParam.materCode = ''
this.queryParam.page = 1
this.queryParam.rows = 10
this.partNum()
},
}
}
</script>
<style lang="scss" scoped>
.product_model {
::v-deep .el-table .disabledSelection .cell .el-checkbox__inner {
display: none;
position: relative;
}
font-size: 18px;
.placeholder{
height:14px;
......
......@@ -4,11 +4,11 @@
<el-form ref="queryForm" style="padding: 0 0 0 10px" class="formClass" :model="queryParams" :inline="true" label-width="auto">
<el-form-item label="时间">
<div slot="label" class="labelClass">
<div>时间</div>
<div>Synchronization Time</div>
<div>执行时间</div>
<div>Create Time</div>
</div>
<el-date-picker
v-model="queryParams.synchronizationTime"
v-model="dateRange"
size="small"
style="width: 300px"
value-format="yyyy-MM-dd"
......@@ -26,7 +26,7 @@
</div>
<div>
<el-row :gutter="20">
<!--不良定义数据-->
<!--同步数据数据-->
<el-col :span="24" :xs="24">
<div style="float: right;margin: 10px">
<el-button
......@@ -48,33 +48,34 @@
border
style="padding-right: 10px;padding-left: 10px"
:data="badList"
:default-sort="{prop: 'createTime', order: 'descending'}"
>
<el-table-column type="index" label="序号" width="50" />
<el-table-column align="center" prop="synchronizationTime" width="200" :show-overflow-tooltip="true">
<el-table-column align="center" prop="createTime" width="200" :show-overflow-tooltip="true">
<template slot="header">
<div>时间</div>
<div>Synchronization Time</div>
<div>执行时间</div>
<div>Create Time</div>
</template>
<template v-slot:default="scope">
{{ scope.row.synchronizationTime || '-' }}
{{ scope.row.createTime || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="type" :show-overflow-tooltip="true">
<template slot="header">
<div>类型</div>
<div>执行类型</div>
<div>Type</div>
</template>
<template slot-scope="scope">
{{ scope.row.type || '-' }}
</template>
</el-table-column>
<el-table-column align="center" width="200" prop="result" :show-overflow-tooltip="true">
<el-table-column align="center" width="200" prop="status" :show-overflow-tooltip="true">
<template slot="header">
<div>结果</div>
<div>Result</div>
<div>执行结果</div>
<div>Status</div>
</template>
<template slot-scope="scope">
{{ scope.row.result || '-' }}
{{ scope.row.status || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="remarks" :show-overflow-tooltip="true">
......@@ -119,18 +120,19 @@
</template>
<script>
import { delSchedule, getSync, onSchedule } from '@/api/synchronization'
export default {
name: 'Index',
data() {
return {
loading: false,
badList: [],
// 日期范围
dateRange: [],
queryParams: {
page: 1,
rows: 10,
synchronizationTime: '',
startTime: '',
endTime: ''
rows: 10
},
total: 0
}
......@@ -155,7 +157,12 @@ export default {
},
methods: {
getList() {
console.log('查询成功')
this.loading = true
getSync(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.badList = res.rows
this.total = res.total
this.loading = false
})
},
handleQuery() {
this.queryParams.page = 1
......@@ -164,26 +171,40 @@ export default {
resetQuery() {
this.queryParams.rows = 10
this.queryParams.page = 1
this.queryParams.synchronizationTime = undefined
this.dateRange = []
this.handleQuery()
},
handleDelete() {
handleDelete(row) {
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', {
confirmButtonText: '确定 Confirm',
cancelButtonText: '取消 Cancel',
cancelButtonClass: 'btn-custom-cancel',
type: 'warning'
}).then(function() {
console.log('删除')
})
}).then(() => {
return delSchedule(row.businessId)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch()
},
// 同步物料
handleMaterial() {
console.log('同步物料')
const type = 1
onSchedule(type).then(res => {
this.$message.success('操作成功,请稍后查看结果')
this.getList()
})
},
// 同步工单
handleOrder() {
console.log('同步工单')
const type = 2
onSchedule(type).then(res => {
this.$message.success('操作成功,请稍后查看结果')
this.getList()
})
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment