Commit 0310130a authored by zhanglongbao's avatar zhanglongbao

feat

parent 3d531691
......@@ -8,7 +8,7 @@
<div class="formContent">
<formContentComp
:form_detail="form_detail"
v-model="data"
:modelValue="data"
@editData="editData" />
<div class="bottom bottom_button">
......@@ -48,11 +48,13 @@ const close = () => {
};
// 表单数据
const data = ref<object>({});
const edit = ref<object>({});
const editData = (data: object) => {
edit.value = { ...edit.value, ...data };
console.log("edit", edit.value);
const data = ref<any>({});
const edit = ref<any>({});
const editData = (edit_data: any) => {
edit.value = { ...edit.value, ...edit_data };
for (const key in edit_data) {
data.value[key] = edit_data[key];
}
};
// 表单信息
......@@ -71,7 +73,7 @@ const init = () => {
getFormDetail();
if (props.data) {
data.value = JSON.parse(JSON.stringify(props.data));
data.value = JSON.parse(JSON.stringify(props.data || {}));
}
};
init();
......
......@@ -30,12 +30,10 @@ const emit = defineEmits([
"sortFormItem",
"selectFormField",
"removeFormField",
"update:modelValue",
"editData",
]);
const edit = (editData: object) => {
emit("update:modelValue", { ...props.modelValue, ...editData });
emit("editData", editData);
};
......
......@@ -11,10 +11,17 @@ const routers: RouteRecordRaw[] = [
component: () => import("@/view/home/index.vue"),
},
{
// 产品扫码详情
path: "/code_product_detail",
name: "code_product_detail",
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({
......
......@@ -8,7 +8,8 @@
<div
class="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>
<span>
当前产品已有{{
......@@ -115,6 +116,9 @@ import api from "@/api";
import { File, hexToRgba } from "@/utils/public";
import { $createFormData } from "@/components/create_form_data/index";
import { $toast } from "@/components/toast/index";
import { useRouter } from "vue-router";
const router = useRouter();
// 产品详情
const product_detail = ref<{
......@@ -157,6 +161,16 @@ const getShowProductFields = (id: string) => {
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) => {
$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