|
|
|
|
@@ -84,14 +84,14 @@
|
|
|
|
|
<el-table-column prop="customName" label="客户名称" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="customAddress" label="客户地址" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="remarks" label="备注" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="type" label="状态" align="center">
|
|
|
|
|
<el-table-column prop="type" label="出库状态" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag v-if="scope.row.status === 1">出库中</el-tag>
|
|
|
|
|
<el-tag type="success" v-if="scope.row.status === 2">出库完成</el-tag>
|
|
|
|
|
<el-tag type="info" v-if="scope.row.status === 3">弃用</el-tag>
|
|
|
|
|
<el-tag v-if="scope.row.type === 1">出库中</el-tag>
|
|
|
|
|
<el-tag type="success" v-if="scope.row.type === 2">出库完成</el-tag>
|
|
|
|
|
<el-tag type="info" v-if="scope.row.type === 3">弃用</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="status" label="状态" align="center">
|
|
|
|
|
<el-table-column prop="status" label="显示状态" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag type="success" v-if="scope.row.status === 1">启用</el-tag>
|
|
|
|
|
<el-tag type="info" v-if="scope.row.status === 0">停用</el-tag>
|
|
|
|
|
@@ -99,21 +99,29 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="year" label="年周日" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.year + '-' + scope.row.week + '-' + scope.row.date }}
|
|
|
|
|
<span v-if="scope.row.year">{{ scope.row.year + '-' + scope.row.week + '-' + scope.row.date }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center" width="140">
|
|
|
|
|
<el-table-column label="操作" align="center" width="200">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
v-hasPermi="['business:wmoutorder:print']"
|
|
|
|
|
type="success"
|
|
|
|
|
icon="el-icon-printer"
|
|
|
|
|
title="打印"
|
|
|
|
|
:disabled="scope.row.status === 3"
|
|
|
|
|
@click="handlePrint(scope.row)"
|
|
|
|
|
></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
v-hasPermi="['business:wmoutorder:edit']"
|
|
|
|
|
type="success"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
title="编辑"
|
|
|
|
|
:disabled="!(scope.row.status === 1)"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
></el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
@@ -122,7 +130,6 @@
|
|
|
|
|
type="danger"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
title="删除"
|
|
|
|
|
:disabled="!(scope.row.status === 1)"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
></el-button>
|
|
|
|
|
</template>
|
|
|
|
|
@@ -144,17 +151,17 @@
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
<el-col :lg="8">
|
|
|
|
|
<el-form-item label="年" prop="year">
|
|
|
|
|
<el-input v-model="form.year" placeholder="请输入年" />
|
|
|
|
|
<el-input v-model="form.year" placeholder="请输入年" :disabled="form.type === 2" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="8">
|
|
|
|
|
<el-form-item label="周" prop="week">
|
|
|
|
|
<el-input v-model="form.week" placeholder="请输入周" />
|
|
|
|
|
<el-input v-model="form.week" placeholder="请输入周" :disabled="form.type === 2" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="8">
|
|
|
|
|
<el-form-item label="日" prop="date">
|
|
|
|
|
<el-input v-model="form.date" placeholder="请输入日" />
|
|
|
|
|
<el-input v-model="form.date" placeholder="请输入日" :disabled="form.type === 2" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
@@ -162,7 +169,13 @@
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="客户选择" prop="customId">
|
|
|
|
|
<el-select v-model="selectCustomInfo" filterable placeholder="请选择一个客户" @change="handleCustomSelectChange">
|
|
|
|
|
<el-select
|
|
|
|
|
:disabled="form.type === 2"
|
|
|
|
|
v-model="selectCustomInfo"
|
|
|
|
|
filterable
|
|
|
|
|
placeholder="请选择一个客户"
|
|
|
|
|
@change="handleCustomSelectChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(item, index) in customOptions"
|
|
|
|
|
:key="index"
|
|
|
|
|
@@ -175,17 +188,17 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="客户代码" prop="customNo">
|
|
|
|
|
<el-input v-model="form.customNo" placeholder="请输入客户代码" />
|
|
|
|
|
<el-input :disabled="form.type === 2" v-model="form.customNo" placeholder="请输入客户代码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="客户名称" prop="customName">
|
|
|
|
|
<el-input v-model="form.customName" placeholder="请输入客户名称" />
|
|
|
|
|
<el-input :disabled="form.type === 2" v-model="form.customName" placeholder="请输入客户名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="客户地址" prop="customAddress">
|
|
|
|
|
<el-input v-model="form.customAddress" placeholder="请输入客户地址" />
|
|
|
|
|
<el-input :disabled="form.type === 2" v-model="form.customAddress" placeholder="请输入客户地址" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
@@ -193,12 +206,12 @@
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="备注" prop="remarks">
|
|
|
|
|
<el-input v-model="form.remarks" placeholder="请输入备注" />
|
|
|
|
|
<el-input :disabled="form.type === 2" v-model="form.remarks" placeholder="请输入备注" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="出库单状态" prop="type">
|
|
|
|
|
<el-select v-model="form.type" placeholder="请选择出库单状态">
|
|
|
|
|
<el-form-item label="出库状态" prop="type">
|
|
|
|
|
<el-select v-model="form.type" placeholder="请选择出库状态">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in typeOptions"
|
|
|
|
|
:key="item.dictValue"
|
|
|
|
|
@@ -209,8 +222,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="12">
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
|
<el-form-item label="显示状态" prop="status">
|
|
|
|
|
<el-radio-group :disabled="form.type === 2" v-model="form.status">
|
|
|
|
|
<el-radio v-for="item in statusOptions" :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
|
|
|
|
item.dictLabel
|
|
|
|
|
}}</el-radio>
|
|
|
|
|
@@ -222,14 +235,22 @@
|
|
|
|
|
<!-- 物料信息 -->
|
|
|
|
|
<div>
|
|
|
|
|
<div class="action-box flex-row flex-row-right">
|
|
|
|
|
<el-button size="medium" type="success" icon="el-icon-plus" @click="handlerOpenChouseMaterial">添加物料</el-button>
|
|
|
|
|
<el-button size="medium" type="danger" icon="el-icon-delete" @click="handlerDeleteMaterial" :disabled="materialIds.length === 0"
|
|
|
|
|
<el-button :disabled="form.type === 2" size="medium" type="success" icon="el-icon-plus" @click="handlerOpenChouseMaterial"
|
|
|
|
|
>添加物料</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="medium"
|
|
|
|
|
type="danger"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handlerDeleteMaterial(null)"
|
|
|
|
|
:disabled="materialIds.length === 0 || form.type === 2"
|
|
|
|
|
>批量删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="form.materialDataList"
|
|
|
|
|
:disabled="form.type === 2"
|
|
|
|
|
:data="form.materialList"
|
|
|
|
|
v-loading="materialLoading"
|
|
|
|
|
ref="table"
|
|
|
|
|
border
|
|
|
|
|
@@ -239,12 +260,12 @@
|
|
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
<el-table-column prop="partnumber" label="物料号" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="u8InventoryCode" label="U8编码" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="需求量" prop="num" align="center" width="100">
|
|
|
|
|
<el-table-column label="需求量" prop="requireOutNum" align="center" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.num" placeholder="请输入物料需求量" />
|
|
|
|
|
<el-input :disabled="form.type === 2" v-model.number="scope.row.requireOutNum" placeholder="请输入物料需求量" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="nowNum" label="现有库存" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="stockQuantity" label="现有库存" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="unit" label="单位" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="description" label="显示描述" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column prop="version" label="版本号" align="center" :show-overflow-tooltip="true" />
|
|
|
|
|
@@ -252,21 +273,22 @@
|
|
|
|
|
<el-table-column label="操作" align="center" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
:disabled="form.type === 2"
|
|
|
|
|
size="mini"
|
|
|
|
|
v-hasPermi="['business:wmmaterial:delete']"
|
|
|
|
|
type="danger"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
title="删除"
|
|
|
|
|
@click="handlerDeleteMaterial([scope.row.id])"
|
|
|
|
|
></el-button>
|
|
|
|
|
>删除此物料</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="text" @click="cancel">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm">创建出库单</el-button>
|
|
|
|
|
<el-button type="info" @click="cancel">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitForm">确定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<TheChouseMaterial :visible.sync="TheChouseMaterialDialogVisible" @materialChoused="handlerMaterialChoused"></TheChouseMaterial>
|
|
|
|
|
@@ -313,7 +335,7 @@ export default {
|
|
|
|
|
form: {
|
|
|
|
|
status: 1,
|
|
|
|
|
type: 1,
|
|
|
|
|
materialDataList: [],
|
|
|
|
|
materialList: [],
|
|
|
|
|
},
|
|
|
|
|
// 缓存记录数据
|
|
|
|
|
columns: [
|
|
|
|
|
@@ -422,8 +444,11 @@ export default {
|
|
|
|
|
createdTime: undefined,
|
|
|
|
|
updatedBy: undefined,
|
|
|
|
|
updatedTime: undefined,
|
|
|
|
|
materialDataList: [],
|
|
|
|
|
materialList: [],
|
|
|
|
|
}
|
|
|
|
|
// this.customOptions = []
|
|
|
|
|
this.selectCustomInfo = null
|
|
|
|
|
this.materialIds = []
|
|
|
|
|
this.resetForm('form')
|
|
|
|
|
},
|
|
|
|
|
// 重置查询操作
|
|
|
|
|
@@ -483,7 +508,7 @@ export default {
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = '修改出库单数据'
|
|
|
|
|
this.title = '编辑出库单数据'
|
|
|
|
|
this.opertype = 2
|
|
|
|
|
|
|
|
|
|
this.form = {
|
|
|
|
|
@@ -511,24 +536,28 @@ export default {
|
|
|
|
|
// 出库单物料表多选框选中数据
|
|
|
|
|
handleMaterialSelectionChange(selection) {
|
|
|
|
|
this.materialIds = selection.map((item) => item.id)
|
|
|
|
|
console.log(this.materialIds)
|
|
|
|
|
// this.single = selection.length != 1
|
|
|
|
|
// this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
// 删除某项
|
|
|
|
|
handlerDeleteMaterial(ids = null) {
|
|
|
|
|
let that = this
|
|
|
|
|
const Ids = ids || this.materialIds
|
|
|
|
|
console.log(that.form, Ids)
|
|
|
|
|
this.$confirm('是否确认移除数据项?')
|
|
|
|
|
.then(function () {
|
|
|
|
|
const list = JSON.parse(JSON.stringify(this.form.materialDataList))
|
|
|
|
|
.then(() => {
|
|
|
|
|
const list = JSON.parse(JSON.stringify(that.form.materialList))
|
|
|
|
|
const len = list.length
|
|
|
|
|
for (let index = 0; index < len; index++) {
|
|
|
|
|
if (Ids.includes(list[index])) {
|
|
|
|
|
this.form.materialDataList.splice(index, 1)
|
|
|
|
|
console.log(list[index].id, list, len)
|
|
|
|
|
if (Ids.includes(list[index].id)) {
|
|
|
|
|
that.form.materialList.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.msgSuccess('删除成功')
|
|
|
|
|
that.msgSuccess('删除成功')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 打开物料选择弹窗
|
|
|
|
|
@@ -536,8 +565,19 @@ export default {
|
|
|
|
|
this.TheChouseMaterialDialogVisible = true
|
|
|
|
|
},
|
|
|
|
|
// 物料已选择
|
|
|
|
|
handlerMaterialChoused(list){
|
|
|
|
|
this.form.materialDataList = list;
|
|
|
|
|
handlerMaterialChoused(list) {
|
|
|
|
|
//TODO 需要筛选未选择的
|
|
|
|
|
console.log('handlerMaterialChoused', list,this.form)
|
|
|
|
|
const _list = JSON.parse(JSON.stringify(list))
|
|
|
|
|
for (let index = 0; index < _list.length; index++) {
|
|
|
|
|
console.log('push',_list[index],this.form);
|
|
|
|
|
this.form.materialList.push(_list[index])
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 打印出库单
|
|
|
|
|
handlePrint(row) {
|
|
|
|
|
console.log(row)
|
|
|
|
|
this.$message('打印出库单功能待完善!')
|
|
|
|
|
},
|
|
|
|
|
// ====================================================
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
@@ -545,7 +585,7 @@ export default {
|
|
|
|
|
this.$refs['form'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log(JSON.stringify(this.form))
|
|
|
|
|
|
|
|
|
|
console.log('add', this.form)
|
|
|
|
|
if (this.form.shipmentNum != undefined && this.opertype === 2) {
|
|
|
|
|
updateWmOutOrder(this.form)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
@@ -557,14 +597,28 @@ export default {
|
|
|
|
|
//TODO 错误逻辑
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
console.log('addWmOutOrder')
|
|
|
|
|
// const postData = {
|
|
|
|
|
// customNo: 'BBBB',
|
|
|
|
|
// customName: 'BBB',
|
|
|
|
|
// customAddress: 'BBB',
|
|
|
|
|
// remarks: '123',
|
|
|
|
|
// type: 1,
|
|
|
|
|
// status: 1,
|
|
|
|
|
// year: '123',
|
|
|
|
|
// week: '1231',
|
|
|
|
|
// date: '231123',
|
|
|
|
|
// }
|
|
|
|
|
addWmOutOrder(this.form)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log('addWmOutOrder', res)
|
|
|
|
|
this.msgSuccess('新增成功')
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
//TODO 错误逻辑
|
|
|
|
|
console.log('addWmOutOrder', err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|