生产上线
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
</el-form>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="1.5"> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="warning" size="mini" @click="importworkorder">导入工单</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="info" size="mini" @click="download_workorder">导出工单</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="danger" size="mini" @click="handleAllworkorder">删除工单</el-button> </el-col>
|
||||
@@ -85,11 +84,12 @@
|
||||
ref="xTable"
|
||||
v-loading="loading_1"
|
||||
height="800"
|
||||
:row-config="{ isHover: true }"
|
||||
:row-config="{ isHover: true, useKey: true, keyField: 'sort' }"
|
||||
:data="workorder_table_data"
|
||||
>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="sort" title="序号"></vxe-column>
|
||||
<!-- <vxe-column field="sort" title="序号"></vxe-column>
|
||||
<vxe-column field="id" title="工单号"></vxe-column> -->
|
||||
<vxe-column field="blankNumber" title="毛坯号"></vxe-column>
|
||||
<vxe-column field="finishedPartNumber" title="成品零件号"></vxe-column>
|
||||
<vxe-column field="productDescription" title="产品描述"></vxe-column>
|
||||
@@ -117,8 +117,14 @@
|
||||
<vxe-button size="mini" type="text" status="danger" content="删除" @click="deleteitem(row)"></vxe-button
|
||||
></el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
|
||||
<vxe-button v-show="row.status == 0" size="mini" type="text" status="warning" content="插入工单" @click="addworkorder(row)"></vxe-button
|
||||
<vxe-button
|
||||
v-show="row.status == 0"
|
||||
size="mini"
|
||||
type="text"
|
||||
status="warning"
|
||||
content="插入工单"
|
||||
@click="addworkorder(row)"
|
||||
></vxe-button
|
||||
></el-dropdown-item>
|
||||
<el-dropdown-item> <i class="el-icon-arrow-up el-icon--right"></i><span>上移</span></el-dropdown-item>
|
||||
<el-dropdown-item> <i class="el-icon-arrow-up el-icon--right"></i><span>下移</span></el-dropdown-item>
|
||||
@@ -228,7 +234,9 @@ import {
|
||||
addNewworkorder,
|
||||
deleteworkorder,
|
||||
updateworkorder,
|
||||
updateSort,
|
||||
} from '@/api/productManagement/workoder_v2.js'
|
||||
import Sortable from 'sortablejs'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
@@ -290,7 +298,7 @@ export default {
|
||||
cylinderNumber: null,
|
||||
remark1: '',
|
||||
remark2: '',
|
||||
sort:0,
|
||||
sort: 0,
|
||||
year: new Date().getFullYear(),
|
||||
week: null,
|
||||
date: null,
|
||||
@@ -302,8 +310,41 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.drag()
|
||||
},
|
||||
methods: {
|
||||
//todo 拖拽
|
||||
drag() {
|
||||
// 首先获取需要拖拽的dom节点
|
||||
const el1 = document.querySelectorAll('.vxe-table--body-wrapper')[0].querySelectorAll('table > tbody')[0]
|
||||
Sortable.create(el1, {
|
||||
disabled: false, // 是否开启拖拽
|
||||
dragClass: 'sortable-ghost', //拖拽样式
|
||||
chosenClass: 'sortable-ghost',
|
||||
animation: 150, // 拖拽延时,效果更好看
|
||||
dataIdAttr: 'rowid',
|
||||
group: {
|
||||
// 是否开启跨表拖拽
|
||||
pull: false,
|
||||
put: false,
|
||||
},
|
||||
onEnd: ({ newIndex, oldIndex }) => {
|
||||
// 获取新的排序值,然后剩余的累加即可
|
||||
this.$nextTick(function () {
|
||||
const query = {}
|
||||
query.sort = this.workorder_table_data[newIndex].sort
|
||||
query.id = this.workorder_table_data[oldIndex].id
|
||||
//发起请求 排序持久化
|
||||
updateSort(query).then((res) => {
|
||||
if (res.code == 200 && res.data > 0) {
|
||||
this.$notify.success('修改成功')
|
||||
}
|
||||
}).catch
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
handleClick() {
|
||||
this.getList()
|
||||
},
|
||||
@@ -522,4 +563,8 @@ export default {
|
||||
.el-icon-arrow-down {
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
background-color: #409eff;
|
||||
}
|
||||
</style>
|
||||
|
||||
159
src/views/productManagement/workorder_online.vue
Normal file
159
src/views/productManagement/workorder_online.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-form :model="search" inline>
|
||||
<el-form-item label="年">
|
||||
<el-input v-model="search.year" placeholder="输入年份"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="周">
|
||||
<el-input v-model="search.week" placeholder="输入周"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="日">
|
||||
<el-select v-model="search.date" placeholder="请选择日">
|
||||
<el-option label="周一" value="1"> </el-option>
|
||||
<el-option label="周二" value="2"> </el-option>
|
||||
<el-option label="周三" value="3"> </el-option>
|
||||
<el-option label="周四" value="4"> </el-option>
|
||||
<el-option label="周五" value="5"> </el-option>
|
||||
<el-option label="周六" value="6"> </el-option>
|
||||
<el-option label="周日" value="7"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleClick">搜索</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
show-overflow
|
||||
ref="xTable"
|
||||
v-loading="loading_1"
|
||||
height="800"
|
||||
:row-config="{ isHover: true, useKey: true, keyField: 'sort' }"
|
||||
:data="workorder_table_data"
|
||||
>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="clientWorkorder" title="工单号" width="130"></vxe-column>
|
||||
<vxe-column field="blankNumber" title="毛坯号"></vxe-column>
|
||||
<vxe-column field="finishedPartNumber" title="成品零件号"></vxe-column>
|
||||
<vxe-column field="productDescription" title="产品描述"></vxe-column>
|
||||
<vxe-column field="colour" title="颜色"></vxe-column>
|
||||
<vxe-column field="specifications" title="规格"></vxe-column>
|
||||
<vxe-column field="codeNumber" title="编码号"></vxe-column>
|
||||
<vxe-column field="vehicleNumber" title="车数"></vxe-column>
|
||||
<vxe-column field="hangNumber" title="挂具摆放数"></vxe-column>
|
||||
<vxe-column field="previousNumber" title="上件数"></vxe-column>
|
||||
<vxe-column field="cylinderNumber" title="双组号缸号"></vxe-column>
|
||||
<vxe-column field="remark1" title="备注1"></vxe-column>
|
||||
<vxe-column field="remark2" title="备注2"></vxe-column>
|
||||
<vxe-column title="操作" width="150" show-overflow>
|
||||
<template #default="{ row }">
|
||||
<div v-show="row.remark3 == '是'">
|
||||
<vxe-button size="mini" type="text" status="primary" content="开始上线" @click="updateitem(row)"></vxe-button>
|
||||
<vxe-button size="mini" type="text" status="danger" content="取消上线" @click="cancelitem(row)"></vxe-button>
|
||||
</div>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<pagination
|
||||
v-show="pagination.total > 0"
|
||||
:total="pagination.total"
|
||||
:page.sync="pagination.pageNum"
|
||||
:limit.sync="pagination.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWorkoderList, startOnline, cancelOnline } from '@/api/productManagement/workorder_online.js'
|
||||
|
||||
export default {
|
||||
name: 'workorder_online',
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
year: new Date().getFullYear(),
|
||||
week: null,
|
||||
date: null,
|
||||
},
|
||||
pagination: {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
// 新增修改工单模态框
|
||||
dialog: {
|
||||
title: '',
|
||||
open: false,
|
||||
form: {},
|
||||
},
|
||||
loading_1: true,
|
||||
workorder_table_data: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.getList()
|
||||
},
|
||||
//todo 获取生产工单列表
|
||||
getList() {
|
||||
const query = { ...this.search, ...this.pagination }
|
||||
if (query.week == null || query.week == undefined || query.week == '') query.week = -1
|
||||
if (query.year == null || query.year == undefined || query.year == '') query.year = -1
|
||||
getWorkoderList(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.loading_1 = false
|
||||
this.workorder_table_data = res.data.item1
|
||||
this.pagination.total = res.data.item2
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//todo 开始上线
|
||||
updateitem(row) {
|
||||
startOnline(row.id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('上线成功')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
//todo 取消上线
|
||||
cancelitem(row) {
|
||||
|
||||
this.$modal
|
||||
.confirm('是否确认取消生产工单名称为' + row.productDescription + '"的数据项?')
|
||||
.then(function () {
|
||||
return cancelOnline(row.id)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('取消成功')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: #409eff;
|
||||
}
|
||||
.el-icon-arrow-down {
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
background-color: #409eff;
|
||||
}
|
||||
</style>
|
||||
@@ -63,6 +63,8 @@
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-tag type="warning">上传导入时间:{{ upload.time }}</el-tag>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
@@ -291,6 +293,7 @@ export default {
|
||||
flag: '', //判断新增还是修改
|
||||
|
||||
upload: {
|
||||
time:null,
|
||||
// 用户导入参数
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
@@ -373,6 +376,8 @@ export default {
|
||||
handleClick() {
|
||||
this.getList()
|
||||
this.getWeekSummary()
|
||||
|
||||
|
||||
},
|
||||
//todo 获取生产计划列表
|
||||
getList() {
|
||||
@@ -526,6 +531,7 @@ export default {
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
this.upload.time=new Date();
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user