Merge branch 'feature-template2' into uat
This commit is contained in:
@@ -58,7 +58,15 @@
|
||||
<template v-slot:title>
|
||||
产品测试模块会同步该列表数据并作统计展示
|
||||
</template>
|
||||
<a-button type="primary" class="operChd custom-button" @click="syncData" :loading="syncDataLoading">同步数据</a-button>
|
||||
<a-button
|
||||
v-if="template_type === 100 || template_type === 101"
|
||||
type="primary"
|
||||
class="operChd custom-button"
|
||||
@click="syncData"
|
||||
:loading="syncDataLoading"
|
||||
>
|
||||
{{ other_send_status ? "更新数据" : "同步数据" }}
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<!-- 配置 -->
|
||||
@@ -86,7 +94,9 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
selectedSns: {}
|
||||
selectedSns: {},
|
||||
template_type: {},
|
||||
other_send_status: {},
|
||||
})
|
||||
const store = useStore()
|
||||
const { selectedSns } = toRefs(props)
|
||||
@@ -256,10 +266,13 @@ async function syncData() {
|
||||
syncDataLoading.value = true;
|
||||
try {
|
||||
await syncProductTest(sn.value);
|
||||
message.success('同步成功!');
|
||||
// message.success('同步成功,您还需在产品测试模块导入该问卷哦~');
|
||||
if (props.other_send_status) {
|
||||
return message.success("同步成功,您还需在产品测试模块导入该问卷哦~");
|
||||
}
|
||||
message.success("同步成功!");
|
||||
emit("update:other_send_status", 1);
|
||||
} catch (error) {
|
||||
console.error('同步数据错误', error)
|
||||
console.error("同步数据错误", error);
|
||||
}
|
||||
syncDataLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,23 @@
|
||||
<!-- 新的筛选 -->
|
||||
<newSearch ref="newSearchRef" @onSearch="onSearch" @openModal="openModal" @searchPlan="searchPlan" @saveVisOpen="saveVisOpen" :versions="versions" :logics="logics" :questions="questions" :count="dataCount" :publish_types="publish_types" :filterData="filterData" :isArt="isArt" :nowPlanVal="nowPlanVal" />
|
||||
<!-- 新的操作按钮 -->
|
||||
<newBtnList ref="newBtnListRef" v-if="total > 0" @noData="noData" @configOk="handleConfig" @downloadOk="handleDownload" @delOk="getData" @delFn="showDelMod" @cleanAllBtn="cleanAllBtn" @dataImport="dataImport" @dataExport="dataExport" @sign="onSign" :answer_columns="answer_columns" :selectedSns="selectedSns" />
|
||||
<newBtnList
|
||||
ref="newBtnListRef"
|
||||
v-if="total > 0"
|
||||
@noData="noData"
|
||||
@configOk="handleConfig"
|
||||
@downloadOk="handleDownload"
|
||||
@delOk="getData"
|
||||
@delFn="showDelMod"
|
||||
@cleanAllBtn="cleanAllBtn"
|
||||
@dataImport="dataImport"
|
||||
@dataExport="dataExport"
|
||||
@sign="onSign"
|
||||
:answer_columns="answer_columns"
|
||||
:selectedSns="selectedSns"
|
||||
:template_type="template_type"
|
||||
v-model:other_send_status="other_send_status"
|
||||
/>
|
||||
<!-- <newDataTable /> -->
|
||||
<div class="table-container" v-if="true" :style="total <= 0 ? 'margin: 20px 0 0 0;' : ''">
|
||||
<DataTable :has-selection="false" :params="searchParams" :per-page="per_page" :page="page" :sn="sn" :table-columns="columns" :table-source="tableData" :total="total" @change="onPageChange" @select="onSelectChange" @sign="Sign">
|
||||
@@ -188,6 +204,8 @@ const selectedSns = computed(() => {
|
||||
})
|
||||
|
||||
const answer_columns = ref([])
|
||||
const template_type = ref([])
|
||||
const other_send_status = ref([])
|
||||
|
||||
const isFilted = ref(false)
|
||||
// function onSearch(payload) {
|
||||
@@ -292,6 +310,9 @@ const getSurveysHead = async () => {
|
||||
columns.value = res.columns
|
||||
// 筛选条件
|
||||
questions.value = res?.filters?.answer_questions
|
||||
// 同步数据
|
||||
template_type.value = res.template_type;
|
||||
other_send_status.value = res.other_send_status;
|
||||
console.log('传', questions.value)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
showCount
|
||||
:maxlength="30"
|
||||
placeholder="请输入测试产品名称"
|
||||
@blur="validateFlavorInput(item)"
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="suffix">
|
||||
@@ -157,6 +158,7 @@
|
||||
showCount
|
||||
:maxlength="30"
|
||||
placeholder="请输入产品口味名称"
|
||||
@blur="validateFlavorInput(item)"
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="suffix">
|
||||
@@ -774,6 +776,17 @@ export default defineComponent({
|
||||
}
|
||||
};
|
||||
|
||||
// 输入框校验
|
||||
function validateFlavorInput(item) {
|
||||
if (
|
||||
(item.text === "产品名称不能为空" && item.productName) ||
|
||||
(item.text === "口味名称不能为空" && item.flavorName)
|
||||
) {
|
||||
item.status = false;
|
||||
item.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
// 校验包装测试
|
||||
function validatePacking() {
|
||||
const innerStatus = validatePackingCardList(packingData.value.inner);
|
||||
@@ -881,6 +894,7 @@ export default defineComponent({
|
||||
delFlavor,
|
||||
flavorBlur,
|
||||
packingData,
|
||||
validateFlavorInput,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -52,7 +52,12 @@
|
||||
<div class="p-right">
|
||||
<div class="label">
|
||||
<span class="l-title">产品名称:</span>
|
||||
<a-input v-model:value="item.packName" :maxlength="30" placeholder="请输入产品名称">
|
||||
<a-input
|
||||
v-model:value="item.packName"
|
||||
:maxlength="30"
|
||||
placeholder="请输入产品名称"
|
||||
@blur="validateInput(item)"
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="suffix">
|
||||
{{ `${item.packName.length}/30` }}
|
||||
@@ -62,7 +67,12 @@
|
||||
</div>
|
||||
<div class="label">
|
||||
<span class="l-title">包装类型:</span>
|
||||
<a-input v-model:value="item.packType" :maxlength="30" placeholder="请输入包装类型">
|
||||
<a-input
|
||||
v-model:value="item.packType"
|
||||
:maxlength="30"
|
||||
placeholder="请输入包装类型"
|
||||
@blur="validateInput(item)"
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="suffix">
|
||||
{{ `${item.packName.length}/30` }}
|
||||
@@ -236,8 +246,19 @@ export default defineComponent({
|
||||
item.text = "";
|
||||
}
|
||||
|
||||
// 输入框校验
|
||||
function validateInput(item) {
|
||||
if (
|
||||
(item.text === "产品名称不能为空" && item.packName) ||
|
||||
(item.text === "包装类型不能为空" && item.packType)
|
||||
) {
|
||||
item.status = false;
|
||||
item.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
// 图片上传校验
|
||||
function validateImg(item, index) {
|
||||
function validateImg(item) {
|
||||
if (item.text === "请上传产品图片" && item.packImg) {
|
||||
item.status = false;
|
||||
item.text = "";
|
||||
@@ -255,6 +276,7 @@ export default defineComponent({
|
||||
handlePreview,
|
||||
setVisible,
|
||||
validate,
|
||||
validateInput,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user