抛光仓库完成入库,查询功能
This commit is contained in:
79
src/api/wmsManagement/wmPolishInventory.js
Normal file
79
src/api/wmsManagement/wmPolishInventory.js
Normal file
@@ -0,0 +1,79 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 工艺路线-抛光 库存表分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listWmPolishInventory(query) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工艺路线-抛光 库存表
|
||||
* @param data
|
||||
*/
|
||||
export function addWmPolishInventory(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 修改工艺路线-抛光 库存表
|
||||
* @param data
|
||||
*/
|
||||
export function updateWmPolishInventory(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取工艺路线-抛光 库存表详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getWmPolishInventory(id) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工艺路线-抛光 库存表
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function delWmPolishInventory(pid) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 物料下拉菜单查看
|
||||
* @param data
|
||||
*/
|
||||
export function getMaterialSelectOption(params) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory/getMaterialSelectOption',
|
||||
method: 'get',
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 抛光库手动入库
|
||||
* @param data
|
||||
*/
|
||||
export function doWmPolishWarehousing(data) {
|
||||
return request({
|
||||
url: '/mes/wm/WmPolishInventory/doWmPolishWarehousing',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 27 KiB |
BIN
src/assets/logo/logo1.png
Normal file
BIN
src/assets/logo/logo1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -16,5 +16,13 @@ export default {
|
||||
Vue.prototype.$modal = modal
|
||||
// 下载文件
|
||||
// Vue.prototype.$download = download
|
||||
// element-ui table 隐藏
|
||||
Array.prototype.showColumn = function (column) {
|
||||
var item = this.find((x) => x.key == column)
|
||||
if (item) {
|
||||
return item.checked
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-select
|
||||
style="width: 400px"
|
||||
@change="selectChange"
|
||||
v-bind="$attrs"
|
||||
v-model="value"
|
||||
filterable
|
||||
remote
|
||||
placeholder="请输入零件号或描述"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="loading"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.key" :label="item.label" :value="item.value"> </el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaterialSelectOption } from '@/api/wmsManagement/wmPolishInventory.js'
|
||||
export default {
|
||||
name: 'ThePartNumberSelect',
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
loading: false,
|
||||
value: '',
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
init() {
|
||||
this.options = []
|
||||
this.value = ''
|
||||
this.loading = false
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
this.loading = true
|
||||
getMaterialSelectOption({ query }).then((res) => {
|
||||
this.loading = false
|
||||
if (res.code === 200) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange(value) {
|
||||
this.$emit('selected', value)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
523
src/views/wmsManagement/WmPolishInventory/index.vue
Normal file
523
src/views/wmsManagement/WmPolishInventory/index.vue
Normal file
@@ -0,0 +1,523 @@
|
||||
<!--
|
||||
* @Descripttion: (工艺路线-抛光 库存表/wm_polish_inventory)
|
||||
* @version: (1.0)
|
||||
* @Author: (admin)
|
||||
* @Date: (2024-07-25)
|
||||
* @LastEditors: (admin)
|
||||
* @LastEditTime: (2024-07-25)
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- :model属性用于表单验证使用 比如下面的el-form-item 的 prop属性用于对表单值进行验证操作 -->
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
size="small"
|
||||
label-position="right"
|
||||
inline
|
||||
ref="queryForm"
|
||||
:label-width="labelWidth"
|
||||
v-show="showSearch"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="零件号" prop="partnumber">
|
||||
<el-input v-model.trim="queryParams.partnumber" placeholder="请输入零件号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品描述" prop="description">
|
||||
<el-input v-model.trim="queryParams.description" placeholder="请输入产品描述" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择类别" @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="parseInt(item.dictValue)"
|
||||
></el-option>
|
||||
<el-option label="全部" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:wmpolishinventory:add']" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
>抛光零件入库</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
:disabled="single"
|
||||
v-hasPermi="['business:wmpolishinventory:edit']"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleUpdate"
|
||||
>修改基本数据</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="multiple"
|
||||
v-hasPermi="['business:wmpolishinventory:delete']"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="handleDelete"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 数据区域 -->
|
||||
<el-table
|
||||
:data="dataList"
|
||||
v-loading="loading"
|
||||
ref="table"
|
||||
border
|
||||
highlight-current-row
|
||||
@sort-change="sortChange"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column prop="id" label="主键" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('id')" />
|
||||
<el-table-column prop="blankNum" label="毛坯号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('blankNum')" />
|
||||
<el-table-column
|
||||
min-width="160"
|
||||
prop="partnumber"
|
||||
label="零件号"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('partnumber')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="handleShowInfo(scope.row)">{{scope.row.partnumber}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
label="产品描述"
|
||||
align="center"
|
||||
min-width="280"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('description')"
|
||||
/>
|
||||
<el-table-column prop="color" label="颜色" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('color')" />
|
||||
<el-table-column
|
||||
prop="specification"
|
||||
label="规格"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('specification')"
|
||||
/>
|
||||
<el-table-column prop="quantity" label="库存数量" align="center" v-if="columns.showColumn('quantity')" />
|
||||
<el-table-column prop="maxNum" label="最大库存" align="center" v-if="columns.showColumn('maxNum')" />
|
||||
<el-table-column prop="minNum" label="最小库存" align="center" v-if="columns.showColumn('minNum')" />
|
||||
<el-table-column prop="warnNum" label="预警库存" align="center" v-if="columns.showColumn('warnNum')" />
|
||||
<el-table-column prop="type" label="类别" align="center" v-if="columns.showColumn('type')">
|
||||
<template slot-scope="scope">
|
||||
<el-tag effect="plain" v-if="scope.row.type === 1" type="primary">正常</el-tag>
|
||||
<el-tag effect="plain" v-if="scope.row.type === 2" type="warning">返工件</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column
|
||||
prop="createdTime"
|
||||
label="创建时间"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('createdTime')"
|
||||
/>
|
||||
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column
|
||||
prop="updatedTime"
|
||||
label="更新时间"
|
||||
align="center"
|
||||
min-width="160px"
|
||||
:show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('updatedTime')"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
v-hasPermi="['business:wmpolishinventory:edit']"
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
title="编辑"
|
||||
@click="handleUpdate(scope.row)"
|
||||
></el-button> -->
|
||||
<el-button size="mini" v-hasPermi="['business:wmpolishinventory:edit']" type="success" @click="handleShowInfo(scope.row)"
|
||||
>记录</el-button
|
||||
>
|
||||
<el-button size="mini" v-hasPermi="['business:wmpolishinventory:edit']" type="warning" @click="handleInventory(scope.row)"
|
||||
>盘点</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-hasPermi="['business:wmpolishinventory:delete']"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
title="删除"
|
||||
@click="handleDelete(scope.row)"
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
class="mt10"
|
||||
background
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改工艺路线-抛光 库存表对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open" @opened="dialogOpened">
|
||||
<el-form ref="form" :model="form" :rules="rules" :label-width="formLabelWidth">
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="毛坯号" prop="blankNum">
|
||||
<el-input v-model="form.blankNum" placeholder="请输入毛坯号" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="物料搜索">
|
||||
<ThePartNumberSelect ref="ThePartNumberSelectRef" @selected="PartNumberSelect"></ThePartNumberSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="零件号" prop="partnumber">
|
||||
<el-input v-model="form.partnumber" placeholder="请输入零件号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12" v-if="opertype === 1">
|
||||
<el-form-item label="库存数量" prop="quantity">
|
||||
<el-input-number v-model="form.quantity" :min="0" label="请输入库存数量"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="最大库存" prop="maxNum">
|
||||
<el-input v-model="form.maxNum" placeholder="请输入最大库存" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="最小库存" prop="minNum">
|
||||
<el-input v-model="form.minNum" placeholder="请输入最小库存" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="预警库存" prop="warnNum">
|
||||
<el-input v-model="form.warnNum" placeholder="请输入预警库存" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="类别" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择类别">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="parseInt(item.dictValue)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="item in statusOptions" :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||
item.dictLabel
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="入库时间" prop="actionTime">
|
||||
<el-date-picker
|
||||
v-model="form.actionTime"
|
||||
type="datetime"
|
||||
:clearable="false"
|
||||
placeholder="选择日期时间"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listWmPolishInventory,
|
||||
addWmPolishInventory,
|
||||
delWmPolishInventory,
|
||||
updateWmPolishInventory,
|
||||
getWmPolishInventory,
|
||||
doWmPolishWarehousing,
|
||||
} from '@/api/wmsManagement/wmPolishInventory.js'
|
||||
import ThePartNumberSelect from './ThePartNumberSelect.vue'
|
||||
export default {
|
||||
name: 'wmpolishinventory',
|
||||
components: {
|
||||
ThePartNumberSelect,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelWidth: '100px',
|
||||
formLabelWidth: '100px',
|
||||
// 选中id数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
status: 1,
|
||||
type: 1,
|
||||
sort: 'updatedTime',
|
||||
sortType: 'desc',
|
||||
},
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 操作类型 1、add 2、edit
|
||||
opertype: 0,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
type: 1,
|
||||
status: 1,
|
||||
actionTime: new Date(),
|
||||
},
|
||||
columns: [
|
||||
{ index: 0, key: 'id', label: `主键`, checked: false },
|
||||
{ index: 1, key: 'blankNum', label: `毛坯号`, checked: false },
|
||||
{ index: 2, key: 'partnumber', label: `零件号`, checked: true },
|
||||
{ index: 2, key: 'description', label: `产品描述`, checked: true },
|
||||
{ index: 2, key: 'color', label: `颜色`, checked: true },
|
||||
{ index: 2, key: 'specification', label: `规格`, checked: true },
|
||||
{ index: 3, key: 'quantity', label: `库存数量`, checked: true },
|
||||
{ index: 4, key: 'maxNum', label: `最大库存`, checked: false },
|
||||
{ index: 5, key: 'minNum', label: `最小库存`, checked: false },
|
||||
{ index: 6, key: 'warnNum', label: `预警库存`, checked: false },
|
||||
{ index: 7, key: 'type', label: `类别`, checked: true },
|
||||
{ index: 8, key: 'status', label: `状态`, checked: true },
|
||||
{ index: 9, key: 'remark', label: `备注`, checked: false },
|
||||
{ index: 10, key: 'createdBy', label: `创建人`, checked: false },
|
||||
{ index: 11, key: 'createdTime', label: `创建时间`, checked: false },
|
||||
{ index: 12, key: 'updatedBy', label: `更新人`, checked: false },
|
||||
{ index: 13, key: 'updatedTime', label: `更新时间`, checked: true },
|
||||
],
|
||||
// 类别(1-正常 2-返工件)选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
typeOptions: [
|
||||
{ dictLabel: '正常', dictValue: 1 },
|
||||
{ dictLabel: '返工件', dictValue: 2 },
|
||||
],
|
||||
// 状态(0-停用1-启用)选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
statusOptions: [],
|
||||
// 数据列表
|
||||
dataList: [],
|
||||
// 总记录数
|
||||
total: 0,
|
||||
// 提交按钮是否显示
|
||||
btnSubmitVisible: true,
|
||||
// 表单校验
|
||||
rules: {
|
||||
partnumber: [{ required: true, message: '零件号不能为空', trigger: 'blur' }],
|
||||
quantity: [{ required: true, message: '库存数量不能为空', trigger: 'blur' }],
|
||||
},
|
||||
ThePartNumberSelectRef: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 列表数据查询
|
||||
this.getList()
|
||||
|
||||
var dictParams = []
|
||||
},
|
||||
methods: {
|
||||
// 查询数据
|
||||
getList() {
|
||||
this.loading = true
|
||||
listWmPolishInventory(this.queryParams).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.dataList = res.data.result
|
||||
this.total = res.data.totalNum
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 重置数据表单
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
blankNum: undefined,
|
||||
partnumber: undefined,
|
||||
quantity: 0,
|
||||
maxNum: 0,
|
||||
minNum: 0,
|
||||
warnNum: 0,
|
||||
type: 1,
|
||||
status: 1,
|
||||
actionTime: new Date(),
|
||||
remark: undefined,
|
||||
createdBy: undefined,
|
||||
createdTime: undefined,
|
||||
updatedBy: undefined,
|
||||
updatedTime: undefined,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
// 重置查询操作
|
||||
resetQuery() {
|
||||
this.timeRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// 自定义排序
|
||||
sortChange(column) {
|
||||
if (column.prop == null || column.order == null) {
|
||||
this.queryParams.sort = undefined
|
||||
this.queryParams.sortType = undefined
|
||||
} else {
|
||||
this.queryParams.sort = column.prop
|
||||
this.queryParams.sortType = column.order
|
||||
}
|
||||
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '抛光零件入库'
|
||||
this.opertype = 1
|
||||
},
|
||||
dialogOpened() {
|
||||
this.$refs.ThePartNumberSelectRef.init()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const Ids = row.id || this.ids
|
||||
|
||||
this.$confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return delWmPolishInventory(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
this.handleQuery()
|
||||
this.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getWmPolishInventory(id).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
this.open = true
|
||||
this.title = '修改数据'
|
||||
this.opertype = 2
|
||||
|
||||
this.form = {
|
||||
...data,
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 类别(1-正常 2-返工件)字典翻译
|
||||
// typeFormat(row, column) {
|
||||
// return this.selectDictLabel(this.typeOptions, row.type)
|
||||
// },
|
||||
// 状态(0-停用1-启用)字典翻译
|
||||
// statusFormat(row, column) {
|
||||
// return this.selectDictLabel(this.statusOptions, row.status)
|
||||
// },
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(JSON.stringify(this.form))
|
||||
|
||||
if (this.form.id != undefined && this.opertype === 2) {
|
||||
updateWmPolishInventory(this.form)
|
||||
.then((res) => {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
.catch((err) => {
|
||||
//TODO 错误逻辑
|
||||
})
|
||||
} else {
|
||||
doWmPolishWarehousing(this.form)
|
||||
.then((res) => {
|
||||
this.msgSuccess('入库成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
.catch((err) => {
|
||||
//TODO 错误逻辑
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
PartNumberSelect(value) {
|
||||
this.form.partnumber = value
|
||||
},
|
||||
handleShowInfo(row) {},
|
||||
handleInventory(row) {},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user