|
@@ -59,7 +59,12 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <LjDrawerQuoteList ref="QuoteListDrawerRef" :iforigin="isShowOriginFormulaMattress" @closed="ifShowDrawer = false" />
|
|
|
+ <LjDrawerQuoteList
|
|
|
+ ref="QuoteListDrawerRef"
|
|
|
+ :iforigin="isShowOriginFormulaMattress"
|
|
|
+ @closed="ifShowDrawer = false"
|
|
|
+ @export="handleExportQuote"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="mattressQuote">
|
|
@@ -114,7 +119,7 @@ const {
|
|
|
getQuoteListMxData,
|
|
|
gotoHisprice
|
|
|
} = useHooks();
|
|
|
-const { toExcelQuote } = useHooksCpQuote();
|
|
|
+const { toExcelQuote, toExcelQuoteNew } = useHooksCpQuote();
|
|
|
const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
|
|
|
const { userInfo } = useUserStore();
|
|
|
|
|
@@ -213,6 +218,11 @@ const handleClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $colu
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * @description 记录当前行数据
|
|
|
+ */
|
|
|
+const currentRecord = reactive<any>({});
|
|
|
+
|
|
|
const funcShowQuoteList = (curRecord: any) => {
|
|
|
loadingStatus.showQd = !loadingStatus.showQd;
|
|
|
GetComputeMattressById({
|
|
@@ -221,20 +231,19 @@ const funcShowQuoteList = (curRecord: any) => {
|
|
|
})
|
|
|
.then(res => {
|
|
|
const isQuoteListMxData = getQuoteListMxData(funcChaifenTabPro(res.mattress, res.mattressMx));
|
|
|
- let _data = {
|
|
|
- data: res.mattress,
|
|
|
- mxdata: isQuoteListMxData,
|
|
|
- enumMap: vxeTableRef.value.enumMap,
|
|
|
- fabricMx: fabricMxTabList.value,
|
|
|
- formulakindenum: formulaKindEnum.value,
|
|
|
- dannum_type: res.mattress.dannum_type,
|
|
|
- formula: res.formulas, //
|
|
|
- replace: res.replace, //
|
|
|
- formula_ori: res.formulas_origin, //
|
|
|
- formula_bednet: res.formulas_bednet, //
|
|
|
- differ: res.differ //
|
|
|
- };
|
|
|
- QuoteListDrawerRef.value.show(_data);
|
|
|
+ currentRecord.data = res.mattress;
|
|
|
+ currentRecord.mxdata = isQuoteListMxData;
|
|
|
+ currentRecord.enumMap = vxeTableRef.value.enumMap;
|
|
|
+ currentRecord.fabricMx = fabricMxTabList.value;
|
|
|
+ currentRecord.formulakindenum = formulaKindEnum.value;
|
|
|
+ currentRecord.dannum_type = res.mattress.dannum_type;
|
|
|
+ currentRecord.formula = res.formulas;
|
|
|
+ currentRecord.replace = res.replace;
|
|
|
+ currentRecord.formula_ori = res.formulas_origin;
|
|
|
+ currentRecord.formula_bednet = res.formulas_bednet;
|
|
|
+ currentRecord.differ = res.differ;
|
|
|
+
|
|
|
+ QuoteListDrawerRef.value.show(currentRecord);
|
|
|
ifShowDrawer.value = true;
|
|
|
|
|
|
loadingStatus.showQd = !loadingStatus.showQd;
|
|
@@ -244,6 +253,21 @@ const funcShowQuoteList = (curRecord: any) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const handleExportQuote = async (ifExpandAll: any, ifShowOrigin: any, fields: any) => {
|
|
|
+ console.log("handleExportQuote ifExpandAll :>> ", ifExpandAll, ifShowOrigin);
|
|
|
+ if (ifShowOrigin) {
|
|
|
+ loadingStatus.download = true;
|
|
|
+ await toExcelQuote(currentRecord, "床垫报价单_" + currentRecord.data.mattresscode);
|
|
|
+ loadingStatus.download = false;
|
|
|
+ } else {
|
|
|
+ loadingStatus.download = true;
|
|
|
+
|
|
|
+ currentRecord.fields = fields;
|
|
|
+ await toExcelQuoteNew(currentRecord, "床垫报价单_" + currentRecord.data.mattresscode, ifExpandAll);
|
|
|
+ loadingStatus.download = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const rowClsNameFunc = (data: any) => {
|
|
|
const { row, rowIndex, $rowIndex } = data;
|
|
|
if (Number(row.flag) == 0) {
|