Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Feature:
Browse files Browse the repository at this point in the history
1.Fix when changing producstatus in admin pages the result will show error(even though it's working).
2.Add all features to admin, now can create / update /stop / changing the status of the logistics form.
3.Add all product features to admin. Now admin can manage the status the product / add product info.
4.Fix some small issues of the WeBase.js.
5.Refactoring the status function in goods and user interface
6.Add a popup when clicking the product barcode.
Note:This version will be the first release version.
  • Loading branch information
xpxxy committed May 13, 2024
1 parent 8c43ca7 commit 5cec7f9
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 33 deletions.
608 changes: 608 additions & 0 deletions client/src/components/content/admin/adminCreateProduct.vue

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<el-col :span="24">
<el-table
v-loading="loading"
:data="tableData"
:data="paginatedData"
style="width: 100%"
height="750px"
stripe
Expand Down Expand Up @@ -153,7 +153,7 @@
</div>
</template>
<el-tag v-if="props.row.status==='on'" type="success">正在进行当中</el-tag>
<el-tag v-if="props.row.status==='off'" type="info">正在进行当中</el-tag>
<el-tag v-if="props.row.status==='off'" type="info">表单已完成</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template #label>
Expand Down Expand Up @@ -282,7 +282,7 @@
import axios from "axios";
import { aesDecrypt, aesEncrypt } from "@/utils/utils";
import { ElMessage } from "element-plus";
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted ,computed} from "vue";
const emptyText = ref("");
Expand Down Expand Up @@ -310,6 +310,17 @@ onMounted(() => {
ElMessage.error("超时")
});
});
const totalItems = computed(() => tableData.value.length);
const pageSize = ref(8); // 每页显示的条目数
const currentPage = ref(1); // 当前页码
const paginatedData = computed(() => {
const start = (currentPage.value - 1) * pageSize.value;
const end = start + pageSize.value;
return tableData.value.slice(start, end);
});
function handleCurrentChange(newPage) {
currentPage.value = newPage;
}
</script>
<style scoped lang="less">
.content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
>正在进行当中</el-tag
>
<el-tag v-if="props.row.status === 'off'" type="info"
>正在进行当中</el-tag
>表单已完成</el-tag
>
</el-descriptions-item>
<el-descriptions-item>
Expand All @@ -194,9 +194,12 @@
更新中转数据
</div>
</template>
<el-button type="primary" @click="dialogVisible = true"
<el-button v-if="props.row.status==='on'" type="primary" @click="dialogVisible = true"
>更新</el-button
>
<el-button v-if="props.row.status==='off'" type="primary" disabled
>不可更新</el-button
>
</el-descriptions-item>
</el-descriptions>

Expand Down Expand Up @@ -373,7 +376,7 @@
import axios from "axios";
import { aesDecrypt, aesEncrypt } from "@/utils/utils";
import { pcaTextArr } from "element-china-area-data"
import { ElMessage} from "element-plus";
import { ElLoading, ElMessage} from "element-plus";
import { reactive, ref } from "vue";
const info = JSON.parse(
aesDecrypt(localStorage.getItem("userSession"), "xpxxy")
Expand Down Expand Up @@ -438,7 +441,8 @@ function handleCascaderChange(value){
function show(){
// console.log(tableData.value)
transitForm.transitAddrInfo = transitForm.transitAddrInfo+transitForm.transitAddrInfo2
transitForm.formAddr = tableData.value[0].formAddr
transitForm.formAddr = tableData.value[0].formAddr;
transitForm.logisticsInfoAddr = searchContent.searchData;
transitFormRef.value.validate(async (valid) => {
if(valid){
submit()
Expand All @@ -448,35 +452,63 @@ function show(){
}
});
}
function emptyForm(){
transitForm.formAddr="",
transitForm.transitAddr="",
transitForm.transitAddrInfo="",
transitForm.transitContact="",
transitForm.transitAddrInfo1=[],
transitForm.transitAddrInfo2="",
transitForm.logisticsInfoAddr=""
}
const submit = () => {
ElMessageBox.confirm(
'请再次确认数据无误,一旦提交将被保存且无法修改!',
'Warning',
{
confirmButtonText: '确认并提交',
cancelButtonText: '取消我需要修改',
type: 'warning',
ElMessageBox.confirm('请再次确认您的数据正确无误,一旦更新将存储且不可修改!','提示',{
confirmButtonText:'确定并提交',
cancelButtonText:'不,我还需要修改',
type:"warning",
showClose:'false',
beforeClose:(action, instance, done)=>{
if(action ==='cancel'){
ElMessage.info("取消")
};
done();
}
)
.then(() => {
loading.value=true;
console.log(transitForm)
const res = axios.post("/api/updateForm",transitForm)
if(res.data.code==='4007'){
loading.value=false;
ElMessage.success("表单更新成功!")
}else{
loading.value=false;
ElMessage.error("更新失败,请稍后再试")
}
})
.catch(() => {
ElMessage.info('操作取消')
})
}).then(action=>{
if(action === 'confirm'){
const loadingInstance = ElLoading.service({text:"正在更新中"})
dialogVisible.value = false;
axios.post('/api/updateForm', transitForm).then(res=>{
if(res.data.code==='4007'){
axios.post("/api/searchForm", searchContent).then(response=>{
if(response.data.code == '4000'){
tableData.value = response.data.data;
loadingInstance.close()
ElMessage.success("更新成功!")
emptyForm()
}else{
loadingInstance.close();
ElMessage.error("更新列表时出错!")
}
})
}else{
loadingInstance.close()
ElMessage.error("服务器出错了")
}
}).catch(err=>{
// console.log(err)
loadingInstance.close();
ElMessage.error("出错了")
})
}
})
}
function get(value){
window.open("https://www.gds.org.cn/#/barcodeList/index?type=barcode&keyword="+value)
// console.log(value)
}
</script>
<style scoped lang="less">
.content {
Expand Down

0 comments on commit 5cec7f9

Please sign in to comment.