条码编辑相关
parent
9992dee11b
commit
52e91151b8
@ -0,0 +1,20 @@
|
|||||||
|
import axios from '@/utils/request'
|
||||||
|
|
||||||
|
export function saveCode(query) {
|
||||||
|
return axios({
|
||||||
|
url: "/warehouse/inout/saveTempCode",
|
||||||
|
method: "post",
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function findByCode(query) {
|
||||||
|
return axios(
|
||||||
|
{
|
||||||
|
url: "/udiwms/basic/findByCode",
|
||||||
|
method: "get",
|
||||||
|
params: query
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :model="editData" :rules="formRules" ref="dataForm" label-width="100px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-form-item label="UDI码:" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="editData.code"
|
||||||
|
clearable
|
||||||
|
disabled
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="productDate" label="生产日期">
|
||||||
|
<el-input v-model="editData.produceDate" auto-complete="off"
|
||||||
|
oninput="if(value.length>6)value=value.slice(0,6)"
|
||||||
|
type="number"
|
||||||
|
:disabled="false"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="expireDate" label="失效日期">
|
||||||
|
<el-input v-model="editData.expireDate" auto-complete="off"
|
||||||
|
oninput="if(value.length>6)value=value.slice(0,6)"
|
||||||
|
type="number"
|
||||||
|
:disabled="false"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="batchNo" label="批次号">
|
||||||
|
<el-input v-model="editData.batchNo" auto-complete="off" :disabled="false"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="serialNo" label="序列号">
|
||||||
|
<el-input v-model="editData.serialNo" auto-complete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="count" label="扫码数量">
|
||||||
|
<el-input v-model="editData.count" auto-complete="off"
|
||||||
|
type="number"
|
||||||
|
min="1"
|
||||||
|
:disabled="editData.serialNo!=null && editData.serialNo!='' "></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item>
|
||||||
|
<el-checkbox v-model="isUseDyCheck" disabled>是否以使用单元数量出入库</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="text-align: right;margin-top: 20px">
|
||||||
|
<el-button @click="cancelDialog">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="saveCode()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {
|
||||||
|
findByCode,
|
||||||
|
saveCode
|
||||||
|
} from "@/api/inout/code";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "editCode",
|
||||||
|
props: {
|
||||||
|
editTye: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
closeCodeDialog: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
repeatAddCode: {
|
||||||
|
type: Function,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
codeDetail: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
editData: null
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
xlhEnable: false,
|
||||||
|
isUseDyCheck: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
saveCode() {
|
||||||
|
if (this.editTye == 1) {
|
||||||
|
this.repeatAddCode(this.editData);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
saveCode(this.editData)
|
||||||
|
.then((response) => {
|
||||||
|
console.log(response)
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success("提交成功");
|
||||||
|
this.codeDetail = this.editData;
|
||||||
|
this.closeCodeDialog();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
,
|
||||||
|
cancelDialog() {
|
||||||
|
this.closeCodeDialog();
|
||||||
|
}
|
||||||
|
,
|
||||||
|
findByCode() {
|
||||||
|
let query = {udiCode: this.editData.code};
|
||||||
|
findByCode(query)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.code === 20000) {
|
||||||
|
if (response.data.scbssfbhxlh == "否") {
|
||||||
|
this.xlhEnable = true;
|
||||||
|
}
|
||||||
|
if (response.data.zxxsbzbhsydysl > 1) {
|
||||||
|
this.isUseDyCheck = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
,
|
||||||
|
created() {
|
||||||
|
|
||||||
|
this.editData = JSON.parse(JSON.stringify(this.codeDetail));
|
||||||
|
this.findByCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- <el-form :inline="true" :model="unitquery" class="query-form" size="mini">-->
|
||||||
|
<!-- <el-form-item class="query-form-item" label="关键字搜索:">-->
|
||||||
|
<!-- <el-input v-model="unitquery.key" placeholder="搜索"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item>-->
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="primary"-->
|
||||||
|
<!-- icon="el-icon-search"-->
|
||||||
|
<!-- @click.native.stop="getUnitList()"-->
|
||||||
|
<!-- >查询-->
|
||||||
|
<!-- </el-button-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-form>-->
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="unitlist"
|
||||||
|
style="width: 100%"
|
||||||
|
highlight-current-row
|
||||||
|
height="500"
|
||||||
|
border
|
||||||
|
@current-change="handleDetail"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="往来单位ID"
|
||||||
|
prop="erpId"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="往来单位名称"
|
||||||
|
prop="name"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="往来单位简写"
|
||||||
|
prop="spell"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="地址"
|
||||||
|
prop="addr"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column width="200" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="selectUnit(scope.row)"
|
||||||
|
>选入绑定
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getBasicUnitMaintains, getCorpFilter} from "@/api/basic/basicUnitMaintain";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "DialogSelectUnit",
|
||||||
|
props: {
|
||||||
|
codeId: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
fromCorp: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
unitquery: {key: "", page: 1, limit: 20},
|
||||||
|
unitlist: [],
|
||||||
|
unitUpdateQuery: {
|
||||||
|
id: "",
|
||||||
|
fromCorpId: "",
|
||||||
|
fromCorp: "",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getUnitList() {
|
||||||
|
this.loading = true;
|
||||||
|
getBasicUnitMaintains(this.unitquery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
this.unitlist = response.data.page.list || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getUnitListByCode(row) {
|
||||||
|
let query = {
|
||||||
|
udiRlIdFk: row.relId,
|
||||||
|
unitFk: this.fromCorp,
|
||||||
|
}
|
||||||
|
getCorpFilter(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.unitlist = response.data || [];
|
||||||
|
} else {
|
||||||
|
this.$message.warning(response.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDetail(row) {
|
||||||
|
this.curUnitRow = row;
|
||||||
|
},
|
||||||
|
selectUnit(row) {
|
||||||
|
this.$emit("selectSupUnit", row);
|
||||||
|
this.$emit("closeBindDialog", true);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log("this.codeId = " + this.codeId)
|
||||||
|
if (this.codeId != null) {
|
||||||
|
this.getUnitListByCode(this.codeId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue