Commit 0310130a authored by zhanglongbao's avatar zhanglongbao

feat

parent 3d531691
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="formContent"> <div class="formContent">
<formContentComp <formContentComp
:form_detail="form_detail" :form_detail="form_detail"
v-model="data" :modelValue="data"
@editData="editData" /> @editData="editData" />
<div class="bottom bottom_button"> <div class="bottom bottom_button">
...@@ -48,11 +48,13 @@ const close = () => { ...@@ -48,11 +48,13 @@ const close = () => {
}; };
// 表单数据 // 表单数据
const data = ref<object>({}); const data = ref<any>({});
const edit = ref<object>({}); const edit = ref<any>({});
const editData = (data: object) => { const editData = (edit_data: any) => {
edit.value = { ...edit.value, ...data }; edit.value = { ...edit.value, ...edit_data };
console.log("edit", edit.value); for (const key in edit_data) {
data.value[key] = edit_data[key];
}
}; };
// 表单信息 // 表单信息
...@@ -71,7 +73,7 @@ const init = () => { ...@@ -71,7 +73,7 @@ const init = () => {
getFormDetail(); getFormDetail();
if (props.data) { if (props.data) {
data.value = JSON.parse(JSON.stringify(props.data)); data.value = JSON.parse(JSON.stringify(props.data || {}));
} }
}; };
init(); init();
......
...@@ -30,12 +30,10 @@ const emit = defineEmits([ ...@@ -30,12 +30,10 @@ const emit = defineEmits([
"sortFormItem", "sortFormItem",
"selectFormField", "selectFormField",
"removeFormField", "removeFormField",
"update:modelValue",
"editData", "editData",
]); ]);
const edit = (editData: object) => { const edit = (editData: object) => {
emit("update:modelValue", { ...props.modelValue, ...editData });
emit("editData", editData); emit("editData", editData);
}; };
......
...@@ -11,10 +11,17 @@ const routers: RouteRecordRaw[] = [ ...@@ -11,10 +11,17 @@ const routers: RouteRecordRaw[] = [
component: () => import("@/view/home/index.vue"), component: () => import("@/view/home/index.vue"),
}, },
{ {
// 产品扫码详情
path: "/code_product_detail", path: "/code_product_detail",
name: "code_product_detail", name: "code_product_detail",
component: () => import("@/view/code_product_detail/index.vue"), component: () => import("@/view/code_product_detail/index.vue"),
}, },
{
// 产品历史工单
path: "/product_history_work_order",
name: "product_history_work_order",
component: () => import("@/view/product_history_work_order/index.vue"),
},
]; ];
const router = createRouter({ const router = createRouter({
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<div <div
class="order" class="order"
v-if="product_detail.have_dealing_order" v-if="product_detail.have_dealing_order"
:style="{ background: hexToRgba('#f5a034', 0.15) }"> :style="{ background: hexToRgba('#f5a034', 0.15) }"
@click="toOrderList">
<i class="icon-131"></i> <i class="icon-131"></i>
<span> <span>
当前产品已有{{ 当前产品已有{{
...@@ -115,6 +116,9 @@ import api from "@/api"; ...@@ -115,6 +116,9 @@ import api from "@/api";
import { File, hexToRgba } from "@/utils/public"; import { File, hexToRgba } from "@/utils/public";
import { $createFormData } from "@/components/create_form_data/index"; import { $createFormData } from "@/components/create_form_data/index";
import { $toast } from "@/components/toast/index"; import { $toast } from "@/components/toast/index";
import { useRouter } from "vue-router";
const router = useRouter();
// 产品详情 // 产品详情
const product_detail = ref<{ const product_detail = ref<{
...@@ -157,6 +161,16 @@ const getShowProductFields = (id: string) => { ...@@ -157,6 +161,16 @@ const getShowProductFields = (id: string) => {
return (detail_config.value.show_product_fields || []).includes(id); return (detail_config.value.show_product_fields || []).includes(id);
}; };
// 工单列表
const toOrderList = () => {
router.push({
path: "/product_history_work_order",
query: {
product_id: product_detail.value.product_info.id,
},
});
};
// 创建 // 创建
const createFormData = (button: ButtonType) => { const createFormData = (button: ButtonType) => {
$createFormData({ $createFormData({
......
<template>
<div class="product_history_work_order">
<div class="header">
<div>
历史工单记录
<span>{{ count }}</span>
</div>
</div>
<div class="list">
<div class="order" v-for="it in list">
<span class="title">{{ it.order_title }}</span>
<div>
<span class="label">工单标签</span>
<span style="color: var(--blue)">
{{ it.order_number }}
</span>
</div>
<div>
<span class="label">负责人</span>
<span>
<nameComp :name="it.fuze_user.nickname" />
</span>
</div>
<div>
<span class="label">派单时间</span>
<span>{{ it.create_time }}</span>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { computed } from "vue";
import { useRoute } from "vue-router";
import api from "@/api";
import { useDataList } from "@/utils/hook";
const route = useRoute();
// 数据列表
const params = computed(() => ({
api: api.order.listOrder,
params: {
product_id: [route.query.product_id],
},
}));
const { list, count, getList } = useDataList(params);
getList();
</script>
<style lang="less" scoped>
.product_history_work_order {
width: 100vw;
height: 100vh;
overflow: hidden;
background-color: var(--bg_gray);
display: flex;
flex-direction: column;
.header {
display: flex;
align-items: center;
height: 50px;
flex-shrink: 0;
background-color: white;
padding: 0 12px;
box-sizing: border-box;
div {
font-weight: bold;
}
}
.list {
display: flex;
flex-direction: column;
flex: 1;
overflow: auto;
padding: 12px;
box-sizing: border-box;
.order {
display: flex;
flex-direction: column;
background-color: white;
margin-bottom: 10px;
box-sizing: border-box;
padding: 14px;
border-radius: 6px;
.title {
font-size: 16px;
font-weight: 500;
}
> div {
display: flex;
align-items: center;
margin-top: 10px;
font-size: 14px;
.label {
width: 80px;
flex-shrink: 0;
color: var(--gray);
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment