feat: 手工、拼箱关联修改

20240912_adapter
chenhc 9 months ago
parent 4b6cc4215a
commit ace8a4d295

@ -15,6 +15,13 @@ export function delRelCode(query) {
params: query params: query
}); });
} }
export function deleteDetail(query) {
return axios({
url: "/udiwms/relCode/batch/deleteDetail",
method: "get",
params: query
});
}
export function addRelCode(query) { export function addRelCode(query) {
return axios({ return axios({
@ -23,6 +30,13 @@ export function addRelCode(query) {
data: query data: query
}); });
} }
export function deleteAllDetail(query) {
return axios({
url: "/udiwms/relCode/batch/deleteAllDetail",
method: "post",
data: query
});
}
export function addRelCodeSpellBox(query) { export function addRelCodeSpellBox(query) {
return axios({ return axios({
url: "/udiwms/relCode/batch/addRelCodeSpellBox", url: "/udiwms/relCode/batch/addRelCodeSpellBox",

@ -16,11 +16,11 @@
</div> </div>
<div style="margin-left: auto;"> <div style="margin-left: auto;">
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>放弃 >清空
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>提交 >提交
</el-button> </el-button>
</div> </div>
@ -159,6 +159,16 @@
<el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column> <el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column>
<el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column> <el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column>
<el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column> <el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -184,7 +194,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCode,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCode,scanCodeRelCode,deleteDetail,deleteAllDetail} from "@/api/collect/relCode";
import sonRelCode from './sonRelCode.vue'; import sonRelCode from './sonRelCode.vue';
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
@ -304,6 +314,39 @@
sonRelCode sonRelCode
}, },
methods: { methods: {
deleteDetail(row) {
this.$confirm('确定删除该层级码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
let curCode = row.curCode
this.detailList = this.detailList.filter(row => row.curCode !== curCode)
this.syxjsl = this.syxjsl - 1
if (row.packLayer > 1) {
this.loading = true
//
deleteDetail({ curCode: curCode }).then((response) => {
this.loading = false
if (response.code === 20000) {
this.$message.success('删除成功!')
} else {
this.$message.error(response.message)
}
}).catch(() => {
this.loading = false
})
} else {
this.$message.success('删除成功!')
}
this.splitChange()
})
.catch(() => {
})
},
splitChange() { splitChange() {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}, },
@ -473,6 +516,24 @@
this.errVisible = false; this.errVisible = false;
}, },
giveUp() { giveUp() {
this.$confirm("确定清空当前操作的数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.loading = true;
deleteAllDetail(this.detailList).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("清空成功!");
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
this.relFormData = { this.relFormData = {
productCode: null, productCode: null,
subTypeNo: null, subTypeNo: null,
@ -494,6 +555,10 @@
this.bhxjsl = 0 this.bhxjsl = 0
this.syxjsl = 0 this.syxjsl = 0
this.packLayer = null this.packLayer = null
})
.catch(() => {
});
}, },
submit(val) { submit(val) {
if(this.detailList == null || this.detailList.length == 0){ if(this.detailList == null || this.detailList.length == 0){

@ -16,15 +16,15 @@
</div> </div>
<div style="margin-left: auto;"> <div style="margin-left: auto;">
<el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="spellBox()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>拼箱 >拼箱
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>放弃 >清空
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>提交 >提交
</el-button> </el-button>
</div> </div>
@ -51,7 +51,7 @@
v-model="relFormData.batchNo" v-model="relFormData.batchNo"
auto-complete="off" auto-complete="off"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode && this.detailList.length > 0" :disabled="this.inputDisabled"
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -65,7 +65,7 @@
clearable clearable
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode && this.detailList.length > 0" :disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -79,7 +79,7 @@
clearable clearable
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 90%" style="width: 90%"
:disabled="this.parentCode && this.detailList.length > 0" :disabled="this.inputDisabled"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -92,7 +92,7 @@
clearable clearable
style="width: 90%" style="width: 90%"
placeholder="请输入备注" placeholder="请输入备注"
:disabled="this.parentCode && this.detailList.length > 0" :disabled="this.inputDisabled"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -163,6 +163,16 @@
<el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column> <el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column>
<el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column> <el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column>
<el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column> <el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -188,7 +198,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCodeSpellBox,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCodeSpellBox,scanCodeRelCode,deleteDetail,deleteAllDetail} from "@/api/collect/relCode";
import sonRelCode from './sonRelCodeSpell.vue'; import sonRelCode from './sonRelCodeSpell.vue';
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
@ -311,6 +321,40 @@
sonRelCode sonRelCode
}, },
methods: { methods: {
deleteDetail(row) {
this.$confirm('确定删除该层级码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
let curCode = row.curCode
this.detailList = this.detailList.filter(row => row.curCode !== curCode)
this.detailListSpell = this.detailListSpell.filter(row => row.curCode !== curCode)
this.syxjsl = this.syxjsl - 1
if (row.packLayer > 1) {
this.loading = true
//
deleteDetail({ curCode: curCode }).then((response) => {
this.loading = false
if (response.code === 20000) {
this.$message.success('删除成功!')
} else {
this.$message.error(response.message)
}
}).catch(() => {
this.loading = false
})
} else {
this.$message.success('删除成功!')
}
this.splitChange()
})
.catch(() => {
})
},
splitChange() { splitChange() {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}, },
@ -483,6 +527,24 @@
this.errVisible = false; this.errVisible = false;
}, },
giveUp() { giveUp() {
this.$confirm("确定清空当前操作的数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.loading = true;
deleteAllDetail(this.detailList).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("清空成功!");
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
this.relFormData = { this.relFormData = {
productCode: null, productCode: null,
subTypeNo: null, subTypeNo: null,
@ -505,6 +567,11 @@
this.bhxjsl = 0 this.bhxjsl = 0
this.syxjsl = 0 this.syxjsl = 0
this.packLayer = null this.packLayer = null
})
.catch(() => {
});
}, },
spellBox() { spellBox() {
const temp = JSON.parse(JSON.stringify(this.relFormData)); const temp = JSON.parse(JSON.stringify(this.relFormData));

@ -15,12 +15,12 @@
<span v-if="parentCode" style="margin-left: 30px"><strong>{{ parentCode || '暂未录入'}}</strong> <strong> (<span style="color: #FF0000;">{{ syxjsl || 0}}</span>/<span >{{ bhxjsl || 0}}</span>)</strong></span> <span v-if="parentCode" style="margin-left: 30px"><strong>{{ parentCode || '暂未录入'}}</strong> <strong> (<span style="color: #FF0000;">{{ syxjsl || 0}}</span>/<span >{{ bhxjsl || 0}}</span>)</strong></span>
</div> </div>
<div style="margin-left: auto;"> <div style="margin-left: auto;">
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <!-- <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"-->
style="margin-right: 8px;border-radius: 5%;" <!-- style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"-->
>放弃 <!-- >清空-->
</el-button> <!-- </el-button>-->
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailList.length == 0"
>提交 >提交
</el-button> </el-button>
</div> </div>
@ -159,6 +159,16 @@
<el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column> <el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column>
<el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column> <el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column>
<el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column> <el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -169,7 +179,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCode,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCode,scanCodeRelCode,deleteDetail} from "@/api/collect/relCode";
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
name: "operateRelCode", name: "operateRelCode",
@ -286,6 +296,39 @@
}; };
}, },
methods: { methods: {
deleteDetail(row) {
this.$confirm('确定删除该层级码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
let curCode = row.curCode
this.detailList = this.detailList.filter(row => row.curCode !== curCode)
this.syxjsl = this.syxjsl - 1
if (row.packLayer > 1) {
this.loading = true
//
deleteDetail({ curCode: curCode }).then((response) => {
this.loading = false
if (response.code === 20000) {
this.$message.success('删除成功!')
} else {
this.$message.error(response.message)
}
}).catch(() => {
this.loading = false
})
} else {
this.$message.success('删除成功!')
}
this.splitChange()
})
.catch(() => {
})
},
splitChange() { splitChange() {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}, },
@ -591,6 +634,7 @@
this.syxjsl = 0; this.syxjsl = 0;
this.parentCode = null; this.parentCode = null;
this.refreshCodesPanel() this.refreshCodesPanel()
this.closeDialog()
}, },
init(){ init(){
if(this.opeParentCode != null){ if(this.opeParentCode != null){

@ -19,12 +19,12 @@
style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0"
>拼箱 >拼箱
</el-button> </el-button>
<el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading" <!-- <el-button size="mini" type="primary" @click.native="giveUp()" :loading="submitLoading"-->
style="margin-right: 8px;border-radius: 5%;" <!-- style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0"-->
>放弃 <!-- >清空-->
</el-button> <!-- </el-button>-->
<el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading" <el-button size="mini" type="primary" @click.native="submit()" :loading="submitLoading"
style="margin-right: 8px;border-radius: 5%;" style="margin-right: 8px;border-radius: 5%;" :disabled="this.detailListSpell.length == 0"
>提交 >提交
</el-button> </el-button>
</div> </div>
@ -163,6 +163,16 @@
<el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column> <el-table-column label="追溯码" width="250" prop="curCode" show-overflow-tooltip></el-table-column>
<el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column> <el-table-column label="层级" width="150" prop="packLayer" show-overflow-tooltip></el-table-column>
<el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column> <el-table-column label="父级编码" width="250" prop="parentCode" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="deleteDetail(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -173,7 +183,7 @@
<script> <script>
import {enterCodeWeb} from "@/api/inout/order"; import {enterCodeWeb} from "@/api/inout/order";
import {addRelCodeSpellBox,scanCodeRelCode} from "@/api/collect/relCode"; import {addRelCodeSpellBox,scanCodeRelCode,deleteDetail} from "@/api/collect/relCode";
import A from "@/plugins/KeyScaner"; import A from "@/plugins/KeyScaner";
export default { export default {
name: "operateRelCode", name: "operateRelCode",
@ -293,6 +303,40 @@
}; };
}, },
methods: { methods: {
deleteDetail(row) {
this.$confirm('确定删除该层级码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
let curCode = row.curCode
this.detailList = this.detailList.filter(row => row.curCode !== curCode)
this.detailListSpell = this.detailListSpell.filter(row => row.curCode !== curCode)
this.syxjsl = this.syxjsl - 1
if (row.packLayer > 1) {
this.loading = true
//
deleteDetail({ curCode: curCode }).then((response) => {
this.loading = false
if (response.code === 20000) {
this.$message.success('删除成功!')
} else {
this.$message.error(response.message)
}
}).catch(() => {
this.loading = false
})
} else {
this.$message.success('删除成功!')
}
this.splitChange()
})
.catch(() => {
})
},
splitChange() { splitChange() {
this.$refs.inputRef.focus(); this.$refs.inputRef.focus();
}, },
@ -640,6 +684,7 @@
this.parentCode = null; this.parentCode = null;
this.inputDisabled = false this.inputDisabled = false
this.refreshCodesPanel() this.refreshCodesPanel()
this.closeDialog()
}, },
init(){ init(){
if(this.opeParentCode != null){ if(this.opeParentCode != null){

Loading…
Cancel
Save