<template>
	<div class="main-container order-mc-bg">
		<div class="purchase-container">
			<prtMoled
				:printData="{
					tableData: multipleSelection,
					orderName: '采购订单管理',
				}"
				:theadDate="theadDate"
				v-show="false"
			></prtMoled>
			<toolBtn @actionhandel="actionhandel" :btnType="btnType"></toolBtn>
			<!-- 上下查 -->
			<div class="TopInfo" v-if="OrderNoNameslist.length > 0">
				关联查询：
				<strong>{{ OrderNoNameStr }}</strong>
				<strong>{{ OrderNoNameslist.length > 5 ? '等' : '' }}</strong>
				{{ $route.query.actionName ? $route.query.actionName : '' }}所选
				<strong>{{ OrderNoNameslist.length }}</strong
				>条明细行的 <strong>{{ CXaction }}</strong
				>结果
			</div>
			<div class="purchase-page-body">
				<div class="purchase-page-table-header">
					<el-form :inline="true">
						<el-row class="form-row1">
							<el-col :span="20">
								<el-row :gutter="2">
									<el-col :span="4">
										<el-form-item
											class="Iisshow"
											label="订单号"
										>
											<el-input
												v-model.trim="billNo"
												placeholder="请输入采购订单号"
												@keyup.enter="
													searchComS(
														billNo,
														'billNo',
														'ipt'
													)
												"
												@input="
													searchCom(
														billNo,
														'billNo',
														'ipt'
													)
												"
												class="f_12"
											></el-input>
											<div
												:data-clipboard-text="billNo"
												@click="saleOrderCopy"
												class="copyBtn"
											>
												<i
													class="el-icon-document-copy"
												/>
											</div>
										</el-form-item>
									</el-col>
									<el-col :span="4">
										<el-form-item label="单据状态">
											<el-select
												v-model="documentStatus"
												placeholder="选择状态"
												:clearable="true"
												@change="
													searchCom(
														documentStatus,
														'documentStatus',
														'opt'
													)
												"
											>
												<el-option
													class="f_12"
													v-for="item in statusForm.bills"
													:key="item.id"
													:label="item.name"
													:value="item.id"
												></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="4">
										<el-form-item label="确认状态">
											<el-select
												v-model="confirmStatus"
												placeholder="选择状态"
												:clearable="true"
												@change="
													searchCom(
														confirmStatus,
														'confirmStatus',
														'opt'
													)
												"
											>
												<el-option
													class="f_12"
													v-for="item in statusForm.confirmStatus"
													:key="item.id"
													:label="item.name"
													:value="item.id"
												></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="4">
										<el-form-item label="采购部门">
											<el-cascader
												ref="cascader"
												@change="
													searchCom(
														deptId,
														'deptId',
														'ipt',
														'type'
													)
												"
												style="font-size: 12px"
												v-model="deptId"
												placeholder="请选择部门"
												:options="
													statusForm.purchaseDepts
												"
												:props="optionProps"
												:show-all-levels="false"
												:clearable="true"
											></el-cascader>
										</el-form-item>
									</el-col>
									<el-col :span="4">
										<el-form-item
											class="Iisshow"
											label="产品"
										>
											<el-input
												v-model="productKey"
												@keyup.enter="
													searchComS(
														productKey,
														'productKey',
														'ipt'
													)
												"
												@input="
													searchCom(
														productKey,
														'productKey',
														'ipt'
													)
												"
												placeholder="请输入产品名称"
												class="f_12"
												:oninput="
													(productKey =
														productKey.replace(
															/(^\s*)|(\s*$)/g,
															''
														))
												"
											></el-input>
											<div
												:data-clipboard-text="
													productKey
												"
												@click="saleOrderCopy"
												class="copyBtn"
											>
												<i
													class="el-icon-document-copy"
												/>
											</div>
										</el-form-item>
									</el-col>
									<el-col :span="4"></el-col>
								</el-row>
							</el-col>
							<el-col :span="4" class="form-row-lastcol">
								<el-row :gutter="2">
									<el-col :span="24">
										<el-form-item class="form-group1">
											<div
												class="alias-open"
												@click="openRow"
											>
												<span
													class="iconfont"
													:class="[
														isDown
															? 'icon-shuangjiantouzhankai-xia'
															: 'icon-shuangjiantoushouqi-shang',
													]"
												></span>
											</div>
											<el-button
												size="small"
												@click="resetSearch"
												>重置</el-button
											>
											<el-button
												type="primary"
												size="small"
												@click="searchList"
												>搜索</el-button
											>
										</el-form-item>
									</el-col>
								</el-row>
							</el-col>
						</el-row>
						<el-row class="form-row2" v-show="rowShow">
							<el-col :span="21">
								<el-row :gutter="2">
									<el-col :span="4">
										<el-form-item label="订单类型">
											<el-select
												v-model="fillType"
												placeholder="选择订单类型"
												:clearable="true"
												@change="
													searchCom(
														fillType,
														'fillType',
														'opt'
													)
												"
											>
												<el-option
													class="f_12"
													v-for="item in statusForm.orders"
													:key="item.id"
													:label="item.name"
													:value="item.id"
												></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="4">
										<el-form-item label="供应商">
											<el-select
												v-model="supplierId"
												placeholder="选择供应商"
												filterable
												remote
												:clearable="true"
												@change="
													searchCom(
														supplierId,
														'supplierId',
														'opt'
													)
												"
											>
												<el-option
													class="f_12"
													v-for="item in statusForm.supplys"
													:key="item.id"
													:label="item.name"
													:value="item.id"
												></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="7">
										<el-form-item label="采购日期">
											<el-date-picker
												@change="dateCom"
												class="f_12"
												v-model="purchaseTime"
												value-format="YYYY-MM-DD"
												format="YYYY-MM-DD"
												type="daterange"
												:disabledDate="pickerOptions"
												start-placeholder="开始时间"
												end-placeholder="结束时间"
											></el-date-picker>
										</el-form-item>
									</el-col>
									<el-col :span="7">
										<el-form-item label="付款条件">
											<el-select
												v-model="payConditionId"
												placeholder="选择条件"
												:clearable="true"
												@change="
													searchCom(
														payConditionId,
														'payConditionId',
														'opt'
													)
												"
											>
												<el-option
													class="f_12"
													v-for="item in statusForm.reccondition"
													:key="item.id"
													:label="item.name"
													:value="item.id"
												></el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row :gutter="2" class="form-row2-row2">
									<el-col :span="8" class="form-r2-r2-col">
										<el-form-item label="自定义条件1">
											<CustomCondition
												:getCustomerItem="statusForm"
												@result="
													resultCom(
														$event,
														'customerSel1',
														'customerObj1',
														'tempObj1'
													)
												"
												:key="compKey1"
												:reset="reset"
											></CustomCondition>
										</el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="自定义条件2">
											<CustomCondition
												:getCustomerItem="statusForm"
												@result="
													resultCom(
														$event,
														'customerSel2',
														'customerObj2',
														'tempObj2'
													)
												"
												:key="compKey2"
												:reset="reset"
											></CustomCondition>
										</el-form-item>
									</el-col>
									<el-col :span="8">
										<el-form-item label="自定义条件3">
											<CustomCondition
												:getCustomerItem="statusForm"
												@result="
													resultCom(
														$event,
														'customerSel3',
														'customerObj3',
														'tempObj3'
													)
												"
												:key="compKey3"
												:reset="reset"
											></CustomCondition>
										</el-form-item>
									</el-col>
								</el-row>
							</el-col>
						</el-row>
					</el-form>
				</div>
				<div
					class="purchase-page-table-body"
					:style="{ height: heightNum + 'px' }"
				>
					<el-table
						class="table-box"
						:data="tableData"
						border
						ref="tableInfoRef"
						@cell-click="openDetails"
						@row-dblclick="openDetailsDB"
						v-loading="tableLoading"
						style="width: 100%; font-size: 12px"
						:max-height="heightNum"
						:header-cell-class-name="headerRigthMethod"
						:header-cell-style="headerBg"
						@selection-change="handleSelectionChange"
					>
						<el-table-column
							type="selection"
							align="center"
							fixed
							width="40"
						/>
						<el-table-column
							prop="purchaseorgName"
							label="采购组织"
							fixed
							align="left"
							width="220"
						/>
						<el-table-column
							prop="billNo"
							label="采购订单号"
							align="left"
							fixed
							width="136"
						>
							<template #default="scope">
								<span style="color: #4178d5">{{
									scope.row.billNo
								}}</span>
							</template>
						</el-table-column>
						<el-table-column
							prop="documentStatus"
							label="单据状态"
							align="center"
							width="72"
						/>
						<el-table-column
							prop="confirmStatus"
							label="确认状态"
							align="center"
							width="72"
						/>
						<el-table-column
							prop="mrpCloseStatus"
							label="关闭状态"
							align="center"
							width="72"
						/>
						<el-table-column
							prop="date"
							label="采购日期"
							align="left"
							width="83"
						/>
						<el-table-column
							prop="deliveryDate"
							label="期望交期"
							align="left"
							width="83"
						/>
						<el-table-column
							prop="supplierName"
							label="供应商"
							align="left"
							width="210"
						/>
						<el-table-column
							prop="materialNumber"
							label="物料编码"
							align="left"
							width="150"
						/>
						<el-table-column
							prop="specification"
							label="规格型号(SKU)"
							align="left"
							width="280"
						/>
						<el-table-column
							prop="materialName"
							label="物料名称"
							align="left"
							width="120"
						/>
						<el-table-column
							prop="qtyCount"
							label="采购数量"
							align="right"
							width="100"
						/>
						<el-table-column
							prop="producedCount"
							label="已生产"
							align="right"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.producedCount =
										scope.row.producedCount === null
											? 0
											: scope.row.producedCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="notProducedCount"
							label="未生产"
							align="right"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.notProducedCount =
										scope.row.notProducedCount === null
											? 0
											: scope.row.notProducedCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							align="right"
							label="累计已通知"
							prop="notified"
							width="100"
						></el-table-column>
						<el-table-column
							align="right"
							label="可通知"
							prop="notifiable"
							width="100"
						/>
						<el-table-column
							prop="deliveredCount"
							label="已送货"
							align="right"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.deliveredCount =
										scope.row.deliveredCount === null
											? 0
											: scope.row.deliveredCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="stockinQtyCount"
							label="已收货"
							align="right"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.stockinQtyCount =
										scope.row.stockinQtyCount === null
											? 0
											: scope.row.stockinQtyCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="remainStockinQtyCount"
							align="right"
							label="未交数量"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.remainStockinQtyCount =
										scope.row.remainStockinQtyCount === null
											? 0
											: scope.row.remainStockinQtyCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="deliverableCount"
							align="right"
							label="可送货"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.deliverableCount =
										scope.row.deliverableCount === null
											? 0
											: scope.row.deliverableCount)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="unitName"
							align="center"
							label="单位"
							width="81"
						/>
						<el-table-column
							prop="taxPrice"
							align="right"
							label="含税单价"
							width="100"
						/>
						<el-table-column
							prop="taxRate"
							align="right"
							label="税率%"
							width="100"
						>
							<template #default="scope">
								{{
									(scope.row.taxRate =
										scope.row.taxRate === null
											? 0
											: scope.row.taxRate)
								}}
							</template>
						</el-table-column>
						<el-table-column
							prop="localCurrAllAmount"
							align="right"
							label="价税合计（本位币)"
							width="126"
						/>
						<el-table-column
							prop="paymentConditionName"
							label="付款条件"
							align="left"
							width="83"
						/>
						<el-table-column
							prop="stockName"
							label="仓库"
							align="left"
							width="120"
						/>
						<el-table-column
							prop="note"
							label="备注"
							align="left"
							width="280"
						></el-table-column>
					</el-table>
				</div>
			</div>
			<!-- 操作结果 -->
			<el-dialog title="操作结果" v-model="dialogVisible" width="40%">
				<div class="sale-page-table-body">
					<el-table
						class="table-box"
						:data="tableInfo"
						height="300"
						border
						:header-cell-class-name="headerRigthMethod"
						id="tableInfo-table"
					>
						<el-table-column prop="date" label="序号" width="50">
							<template #default="scope">
								<span>{{ scope.$index + 1 }}</span>
							</template>
						</el-table-column>
						<el-table-column
							prop="orderNo"
							label="采购订单号"
							width="200"
						></el-table-column>
						<el-table-column prop="a" label="指令" width="110">
							<template #default>
								<span>
									{{
										actionType === 'submit'
											? '提交'
											: actionType === 'revoke'
											? '撤销'
											: actionType === 'audit'
											? '审核'
											: actionType === 'de-approval'
											? '反审'
											: actionType === 'delet'
											? '删除'
											: actionType === 'finish'
											? '完工'
											: actionType === 'close-case'
											? '结案'
											: actionType === 'de-excute-start'
											? '反执行至开工'
											: actionType === 'de-approval'
											? '反审'
											: actionType === 'delet'
											? '删除'
											: actionType === 'finish'
											? '完工'
											: actionType === 'close-case'
											? '结案'
											: actionType === 'de-excute-finish'
											? '反执行至完工'
											: ''
									}}
								</span>
							</template>
						</el-table-column>
						<el-table-column label="结果" width="80">
							<template #default="scope">
								<span
									:style="{ 'txt-Red': scope.row.isSuccess }"
									>{{
										scope.row.isSuccess ? '成功' : '失败'
									}}</span
								>
							</template>
						</el-table-column>
						<el-table-column prop="msg" label="信息">
							<template #default="scope">
								<span class="txt-Red">{{ scope.row.msg }}</span>
							</template>
						</el-table-column>
					</el-table>
				</div>
				<template #footer>
					<span class="dialog-footer">
						<span
							class="f-12 ext-black-light"
							style="margin-right: 25px"
						>
							共{{
								tableInfo && tableInfo.length > 0
									? tableInfo.length
									: 0
							}}条
						</span>
						<el-button
							size="small"
							@click="
								handelhtmlToExcel(
									'tableInfo-table',
									'操作结果'
								);
								dialogVisible = false;
							"
						>
							导 出
						</el-button>
						<el-button
							type="primary"
							size="small"
							@click="dialogVisible = false"
							>关 闭</el-button
						>
					</span>
				</template>
			</el-dialog>
			<!-- 选择 下推单据 -->
			<el-dialog
				title="选择下推单据"
				v-model="dialogxt"
				width="20%"
				top="15%"
			>
				<el-radio-group v-model="pushdownVal">
					<el-radio
						v-for="item in pushDownList"
						:key="item.id"
						:value="item.id"
						:label="item.id"
					>
						{{ item.value }}
					</el-radio>
				</el-radio-group>
				<template #footer>
					<span class="dialog-footer">
						<el-button size="small" @click="dialogxt = false"
							>取 消</el-button
						>
						<el-button
							type="primary"
							size="small"
							@click="sumitPushdown(pushdownVal)"
							>确 定</el-button
						>
					</span>
				</template>
			</el-dialog>
			<!-- 选择 上下查单据 -->
			<el-dialog
				:title="CXttile"
				v-model="dialogCX"
				width="20%"
				top="15%"
			>
				<div class="sale-page-table-body">
					<el-radio-group
						v-model="CXcheckVal"
						v-if="CXttile === '上查结果'"
					>
						<el-radio
							:label="it.orderType"
							v-for="(it, index) in upOrDownList"
							:key="index"
						>
							{{ it.orderName }}({{ it.orderCount }})
						</el-radio>
					</el-radio-group>
					<el-radio-group
						v-model="CXcheckVal"
						v-if="CXttile === '下查结果'"
					>
						<el-radio
							:label="it.orderType"
							v-for="(it, index) in upOrDownList"
							:key="index"
						>
							{{ it.orderName }}({{ it.orderCount }})
						</el-radio>
					</el-radio-group>
				</div>
				<template #footer>
					<span class="dialog-footer">
						<el-button size="small" @click="dialogCX = false"
							>取 消</el-button
						>
						<el-button type="primary" size="small" @click="submitCX"
							>确 定</el-button
						>
					</span>
				</template>
			</el-dialog>
			<!-- 底部 -->
			<div
				class="purchase-page-footer"
				:style="{ marginTop: footerMg + 'px' }"
			>
				<div class="footer-left">
					<div>
						<span>采购数量:</span>
						<span class="sale-number-color">{{ qtyTotal }}</span>
					</div>
					<div>
						<span>已生产:</span>
						<span class="sale-number-color">{{
							producedTotal
						}}</span>
					</div>
					<div>
						<span>已送货:</span>
						<span class="sale-number-color">{{
							deliveredTotal
						}}</span>
					</div>
					<div>
						<span>已收货:</span>
						<span class="sale-number-color">{{
							stockinQtyTotal
						}}</span>
					</div>
					<div>
						<span>可送货:</span>
						<span class="sale-number-color">{{
							deliverableTotal
						}}</span>
					</div>
					<div>
						<span>价税合计(本位币):</span>
						<span class="sale-number-color">{{
							allAmountTotal
						}}</span>
					</div>
				</div>
				<div class="footer-right">
					<el-pagination
						:page-sizes="pagingList"
						:page-size="pageSize"
						layout="slot,sizes,total, prev,pager, next,jumper"
						:total="totalItemNumber"
						popper-class="每页显示"
						:pager-count="5"
						@size-change="handleSizeChange"
						@current-change="handleCurrentChange"
					>
						<span class="total-select-item">
							共选中
							<text
								style="
									text-align: center;
									color: #4178d5;
									padding: 0 1px;
								"
								>{{ selectItem }}</text
							>行
						</span>
					</el-pagination>
				</div>
				<div class="footer-pagination-total-page">
					<span>共{{ totalPageNumber }}页</span>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { toRaw } from '@vue/reactivity';
import { orderCopy } from '@/utils/takeMethods';
import { ElMessageBox, ElMessage } from 'element-plus';
import {
	exporthandel,
	htmlToExcel,
	removeChildren,
	newprintPreview,
	dateData,
	resultComMethods,
	customChangeMethods,
} from '@/utils/pubulic.js';
import CustomCondition from '@/components/public/CustomCondition.vue';
import { purchaseOrderMangePrint } from '@/utils/printPagekey.js';
export default {
	name: 'DemandOrder',
	components: {
		CustomCondition,
	},
	data() {
		return {
			theadDate: JSON.parse(JSON.stringify(purchaseOrderMangePrint)), // 打印要的字段表
			optionProps: {
				expandTrigger: 'hover',
				checkStrictly: true,
				value: 'id',
				label: 'name',
				children: 'children',
				emitPath: false,
			},
			rowShow: false, // 搜索行显示
			isDown: true, // 搜索展开
			heightNum: 0, // 搜索高度
			windowHeight: 0, // 屏幕高度
			pagingList: [50, 100, 150], // 页码展示
			pageSize: 50, // 每页条数
			pageNo: 1, // 当前页
			totalItemNumber: 0, // 共计多少条
			totalPageNumber: 0, // 共多少页
			selectItem: 0, // 选择多少行
			multipleSelection: [], // 选择的行
			billNo: '', // 采购订单号
			documentStatus: '', // 单据状态
			fillType: '', // 单据类型 订单类型
			confirmStatus: '', // 确认状态
			purchaseorgId: '', // 采购组织
			deptId: '', // 采购部门
			purchaserId: '', // 采购员
			supplierId: '', // 供应商
			payConditionId: '', // 付款条件
			productKey: '', // 产品（关键字）：物料表中的->>编码、名称、规格型号
			purchaseTime: '', // 采购日期
			beginDate: '', // 采购开始日期
			endDate: '', // 采购结束日期
			qtyTotal: '', // 采购数量
			producedTotal: '', // 已生产
			deliveredTotal: '', // 已送货
			stockinQtyTotal: '', // 已收货
			deliverableTotal: '', // 可送货
			allAmountTotal: '', // 价税合计(本位币)
			tableLoading: false, // 列表加载
			reset: false,
			customerSel1: '',
			customerSel2: '',
			customerSel3: '',
			customerObj1: null,
			customerObj2: null,
			customerObj3: null,
			tempObj1: null,
			tempObj2: null,
			tempObj3: null,
			compKey1: 0,
			compKey2: 0,
			compKey3: 0,
			statusForm: {
				customCondition: [],
				orders: [], // 订单类型
				bills: [], // 单据状态
				supplys: [], // 供应商
				is211: [], // 是否211
				isFree: [], // 是否赠品
				cloStatus: [], // 关闭状态
				warehouse: [], // 仓库
				childWarehouse: [], // 仓位
				orgAllPerson: [], // 跟单员
				reccondition: [], // 收款条件
				settleType: [], // 结算方式
				settleOrg: [], // 结算组织
				dcurrency: [], // 结算币别
				purchaseOrgs: [], // 采购组织
				purchaseDepts: [], // 采购部门
				// salepersons: [], // 采购员
				supplyChainType: [], // 供应链
				confirmStatus: [], // 确认状态
			},
			indexArr: [], // 记录未关闭的条目
			tableData: [], // 表格
			btnType: [
				'exDetails',
				'save',
				'print-aterial-list',
				'split-order',
				'finish',
				'close-case',
				'de-excute-start',
				'de-excute-finish',
				's-p-t-g7',
				's-p-t-g8',
				's-p-t-g9',
				's-p-t-g10',
			], // 不需要显示的顶部按钮类型
			search: {
				// 搜索
				pageNo: 1,
				pageSize: 50,
				orgId:
					this.$store.state &&
					this.$store.state.org &&
					this.$store.state.org.orgId === ''
						? this.orgIdArr[0].id
						: this.$store.state.org.orgId,
				extention: {},
			},
			dialogVisible: false, // 操作弹框显示
			tableInfo: [], // 操作结果
			actionType: '', // 操作类型
			pushdownVal: null, // 下推选择
			dialogxt: false, // 选择下推单据弹框显示
			OrdedetailIds: [], // 勾选的明细id集合
			dialogCX: false, // 上下查弹框控制
			upOrDownList: [], // 上查下查弹窗可选数据
			OrderNoNameslist: [], // 上查下查的订单号
			OrderNoNameStr: '', // 上查下查的订单号str
			CXaction: '', // 判断是上查还是下查
			CXttile: '', // 查询弹框的名称
			CXcheckVal: '', // 选择的查询radio
			OrderNoNames: [], // 选择的单据订单号集合
			pushDownList: [
				// 下推集合
				{ id: 1, value: '采购入库单' },
				{ id: 2, value: '采购退料单' },
			],
			isTrue: false,
		};
	},
	methods: {
		Init() {
			// 初始化
			let vuexKey = [
				'settletype',
				'dcurrency',
				'warehouseAll',
				'paymentTerm',
				'supplierSelect',
				'dicPurOrder',
			];
			let setVuexData = [
				'setSettletype',
				'setDcurrency',
				'setWarehouseAll',
				'setPaymentTerm',
				'setSupplierSelect',
				'setDicPurOrder',
			];
			let requestQueryUrl = [
				'SysConfig/GetSettletype',
				'SysConfig/GetDcurrency',
				'SysConfig/GetWarehouse',
				'SysConfig/GetPaymentTerm',
				'SysConfig/supplier/select',
				'Dictionary/purchase',
			];
			let resDataQuery = [
				'settleType',
				'dcurrency',
				'warehouse',
				'reccondition',
				'supplys',
				'customCondition',
			];

			vuexKey.forEach((ele, ind) => {
				if (this[vuexKey[ind]] && this[vuexKey[ind]].length > 0) {
					if (typeof resDataQuery[ind] == 'string') {
						this.statusForm[resDataQuery[ind]] = JSON.parse(
							JSON.stringify(this[vuexKey[ind]])
						);
					} else {
						resDataQuery[ind].forEach((ele, index) => {
							this.statusForm[resDataQuery[ind][index]] =
								JSON.parse(JSON.stringify(this[vuexKey[ind]]));
						});
					}
					if (vuexKey[ind] == 'unitAll') {
						this.unitData = this.statusForm[resDataQuery[ind]];
					}
				} else {
					this.$http.get(requestQueryUrl[ind]).then((r) => {
						if (r.status === 200) {
							if (typeof resDataQuery[ind] == 'string') {
								this.statusForm[resDataQuery[ind]] = r.data;
								this[setVuexData[ind]](
									this.statusForm[resDataQuery[ind]]
								);
							} else {
								resDataQuery[ind].forEach((ele, index) => {
									this.statusForm[resDataQuery[ind][index]] =
										r.data;
									this[setVuexData[ind]](
										this.statusForm[
											resDataQuery[ind][index]
										]
									);
								});
							}
						}
					});
				}
			});
			// 获取单据的各种状态 单据状态 订单类型 关闭的状态 是否211 是否赠品 供应链
			if (
				this.purOrderStatus &&
				JSON.stringify(this.purOrderStatus) !== '{}'
			) {
				for (const key in this.purOrderStatus.documentStatus) {
					this.statusForm.bills.push({
						id: key,
						name: this.purOrderStatus.documentStatus[key],
					});
				}
				for (const key in this.purOrderStatus.purchaseBillType) {
					this.statusForm.orders.push({
						id: key,
						name: this.purOrderStatus.purchaseBillType[key],
					});
				}
				for (const key in this.purOrderStatus.closeStatus) {
					this.statusForm.cloStatus.push({
						id: key,
						name: this.purOrderStatus.closeStatus[key],
					});
				}
				for (const key in this.purOrderStatus.is211Type) {
					this.statusForm.is211.push({
						id: key,
						name: this.purOrderStatus.is211Type[key],
					});
				}
				for (const key in this.purOrderStatus.giveAwayType) {
					this.statusForm.isFree.push({
						id: key,
						name: this.purOrderStatus.giveAwayType[key],
					});
				}
				for (const key in this.purOrderStatus.supplyChainType) {
					this.statusForm.supplyChainType.push({
						id: key,
						name: this.purOrderStatus.supplyChainType[key],
					});
				}
				for (const key in this.purOrderStatus.confirmStatus) {
					this.statusForm.confirmStatus.push({
						id: key,
						name: this.purOrderStatus.confirmStatus[key],
					});
				}
			} else {
				this.$http.get('Purchase/status/get').then((req) => {
					if (req.status == 200) {
						this.setPurOrderStatus(req.data);
						for (const key in req.data.documentStatus) {
							this.statusForm.bills.push({
								id: key,
								name: req.data.documentStatus[key],
							});
						}
						for (const key in req.data.purchaseBillType) {
							this.statusForm.orders.push({
								id: key,
								name: req.data.purchaseBillType[key],
							});
						}
						for (const key in req.data.closeStatus) {
							this.statusForm.cloStatus.push({
								id: key,
								name: req.data.closeStatus[key],
							});
						}
						for (const key in req.data.is211Type) {
							this.statusForm.is211.push({
								id: key,
								name: req.data.is211Type[key],
							});
						}
						for (const key in req.data.giveAwayType) {
							this.statusForm.isFree.push({
								id: key,
								name: req.data.giveAwayType[key],
							});
						}
						for (const key in req.data.supplyChainType) {
							this.statusForm.supplyChainType.push({
								id: key,
								name: req.data.supplyChainType[key],
							});
						}
						for (const key in req.data.confirmStatus) {
							this.statusForm.confirmStatus.push({
								id: key,
								name: req.data.confirmStatus[key],
							});
						}
					}
				});
			}

			this.windowHeight = document.documentElement.clientHeight; // 计算表格高度和底部位置
			if (this.$route.query.detailsIds) {
				this.heightNum = this.windowHeight - 301; // 计算表格高度
			} else {
				this.heightNum = this.windowHeight - 258; // 计算表格高度
			}
			this.containerHeight = this.windowHeight - 102;
			this.footerMg = 0;
			if (
				this.$store.state &&
				this.$store.state.org &&
				this.$store.state.org.orgId
			) {
				this.search.orgId = this.$store.state.org.orgId;
				this.$http
					.post('SysConfig/GetDept/' + this.$store.state.org.orgId)
					.then((req) => {
						let deptArr = req.data;
						this.statusForm.purchaseDepts = removeChildren(deptArr);
					});
			}
			this.getList(this.search);
		},
		// 操作弹框导出
		handelhtmlToExcel(domid, title) {
			htmlToExcel(domid, title);
		},
		// 订单号 复制按钮
		saleOrderCopy() {
			orderCopy();
		},
		// 自定义条件赋值
		resultCom(result, fieldSale, fieldObj, tempObj) {
			let returnResult = resultComMethods(
				result,
				this[fieldSale],
				toRaw(result.outResult),
				this[tempObj],
				this.search.extention
			);
			this[fieldSale] = returnResult.fieldSale;
			this[fieldObj] = returnResult.fieldObj;
			this[tempObj] = returnResult.tempObj;
			this.search.extention = returnResult.search;
		},
		actionhandel(type) {
			// 顶部公共按钮操作
			this.actionType = type;
			if (type === 'add') {
				// 点击新增
				this.$router.push({
					path: '/purchase/demand/createPurchase',
					query: { type: 'add', id: '', sjtag: Math.random() * 36 },
				});
			}
			if (this.multipleSelection && this.multipleSelection.length > 0) {
				let nweArysize = 0;
				let newArry = [
					...new Set(
						this.multipleSelection.map((item) => {
							return item.id;
						})
					),
				];
				let orderNoArry = [
					// 取单据订单号
					...new Set(
						this.multipleSelection.map((item) => {
							return item.billNo;
						})
					),
				];
				this.OrderNoNames = [];
				this.OrderNoNames = orderNoArry;
				let detailsIds = [
					// 提取明细id
					...new Set(
						this.multipleSelection.map((item) => {
							return item.detailsId;
						})
					),
				];
				let closArr = [
					...new Set(
						this.multipleSelection.map((item) => {
							return item.documentStatus;
						})
					),
				];
				this.OrdedetailIds = [];
				this.OrdedetailIds = detailsIds; // 勾选的明细id集合
				nweArysize = new Set(
					this.multipleSelection.map((item) => {
						return item.id;
					})
				).size;
				if (type === 'copy') {
					// 点击复制
					if (nweArysize !== 1 && nweArysize > 0) {
						this.$message.error({
							message: '只能克隆单号相同的生产订单',
							showClose: true,
						});
					} else {
						this.$router.push({
							path: '/purchase/demand/createPurchase',
							query: {
								type: 'copy',
								id: this.multipleSelection[0].id,
								detailsIds: detailsIds,
								sjtag: Math.random() * 36,
							},
						});
					}
				}
				if (type === 'submit') {
					// 点击提交
					this.toolarFn('Purchase/submit/status', newArry);
				}
				if (type === 'revoke') {
					// 点击撤销
					this.toolarFn('Purchase/revoke', newArry);
				}
				if (type === 'audit') {
					// 点击审核
					this.toolarFn('Purchase/check', newArry);
				}
				if (type === 'de-approval') {
					// 点击反审核
					this.toolarFn('Purchase/recheck', newArry);
				}
				if (type === 'delet') {
					// 点击删除
					this.toolarFn('Purchase/delete', newArry);
				}
				if (type === 'close') {
					// 点击关闭
					this.closeOrder(
						'Purchase/close',
						newArry,
						detailsIds,
						type,
						closArr,
						'关闭'
					);
				}
				if (type === 'de-close') {
					// 点击反关闭
					this.closeOrder(
						'Purchase/reclose',
						newArry,
						detailsIds,
						type,
						closArr,
						'反关闭'
					);
				}
				if (type === 'push-down') {
					// 点击下推
					if (detailsIds.length <= 20) {
						if (
							this.multipleSelection.filter((it) => {
								return it.documentStatus !== '已审核';
							}).length > 0
						) {
							this.$message.error({
								message:
									'单据状态错误，只能选择单据状态为已审核单据，请重新选择！',
								showClose: true,
							});
						} else {
							this.dialogxt = true;
						}
					} else {
						this.$message.warning({
							message: '最多一次性下推二十条明细',
							showClose: true,
						});
					}
				}
				if (type === 'up-check') {
					// 点击查询--上查
					if (detailsIds.length > 0) {
						this.$http
							.post('Purchase/upper', { ids: detailsIds })
							.then((res) => {
								if (res.status === 200) {
									if (
										res.data.length === 0 ||
										res.data === []
									) {
										this.$message.warning({
											message: '没有可上查的单据！',
											showClose: true,
										});
									} else {
										this.upOrDownList = res.data;
										this.dialogCX =
											res.data && res.data.length > 0
												? true
												: false;
										this.CXttile = '上查结果';
										this.CXcheckVal =
											res.data && res.data.length === 1
												? res.data[0].orderType
												: null; //只有一个，就个默认值
									}
								}
							});
					} else {
						this.$message.warning({
							message:
								'请先勾选明细,并确认勾选的信息是否有保存提交,只有有效明细信息才能上查',
							showClose: true,
						});
					}
				}
				if (type === 'down-check') {
					// 点击查询--下查
					this.$http
						.post('Purchase/lower', { ids: detailsIds })
						.then((res) => {
							if (res.status === 200) {
								if (res.data.length === 0 || res.data === []) {
									this.$message.warning({
										message: '没有可下查的单据!',
										showClose: true,
									});
								} else {
									this.upOrDownList = res.data;
									this.dialogCX =
										res.data && res.data.length > 0
											? true
											: false;
									this.CXttile = '下查结果';
									this.CXcheckVal =
										res.data && res.data.length === 1
											? res.data[0].orderType
											: null; //只有一个，就个默认值
								}
							}
						});
				}
				// 打印预览
				if (type === 'print-brower') {
					if (
						this.multipleSelection.filter((it) => {
							return it.documentStatus !== '已审核';
						}).length > 0
					) {
						this.$message.error({
							message: '仅可打印已审核的单据',
							showClose: true,
						});
					} else {
						this.multipleSelection = this.multipleSelection.sort(
							dateData('date', false)
						);
						setTimeout(() => {
							newprintPreview('采购订单管理');
						}, 200);
					}
				}
			} else {
				//按列表字段导出,点击全部导出
				if (
					type !== 'add' &&
					type !== 'refresh' &&
					type !== 'list-export' &&
					type !== 'all-export'
				) {
					console.log('走到这里了？');
					this.$message.error({
						message: '请先勾选',
						showClose: true,
					});
				}
			}
			if (type === 'list-export' || type === 'all-export') {
				exporthandel(
					type === 'list-export'
						? 'Purchase/Export'
						: 'Purchase/ExportAll',
					this.search
				);
			}
			if (type === 'refresh') {
				// 点击刷新
				this.getList(this.search);
			}
		},
		async closeOrder(path, newArry, detailsIds, type, closArr, val) {
			if (type === 'close' || type === 'de-close') {
				this.isTrue = true;
				await closArr.forEach((element) => {
					if (element != '已审核') {
						this.$message.warning({
							message: '请选择已审核的单据行进行关闭!',
							showClose: true,
						});
						this.isTrue = false;
					}
				});
				if (this.isTrue) {
					let formdata = detailsIds
						? { ids: detailsIds }
						: { ids: newArry };
					ElMessageBox.confirm(
						'你确认要' + val + '所选单据行',
						'操作确认',
						{
							confirmButtonText: '确认',
							cancelButtonText: '取消',
							type: 'Success',
						}
					).then(() => {
						this.$http.post(path, formdata).then((res) => {
							if (res.status === 200) {
								if (res.data[0].isSuccess === false) {
									ElMessage({
										type: 'error',
										message: res.data[0].msg,
										showClose: true,
									});
								} else {
									ElMessage({
										type: 'success',
										message: val + '成功',
										showClose: true,
									});
								}
								this.getList(this.search);
							}
						});
					});
				}
			}
		},
		toolarFn(path, newArry, detailsIds, type) {
			// 顶部操作方法
			let formdata = detailsIds ? { ids: detailsIds } : { ids: newArry };
			this.$http.post(path, formdata).then((res) => {
				if (res.status === 200) {
					if (type === 'close' || type === 'de-close') {
						this.getList(this.search);
					} else {
						this.dialogVisible = true;
						this.tableInfo = res.data;
						this.getList(this.search);
					}
				}
			});
		},
		sumitPushdown(id) {
			// 下推确定
			this.CXcheckVal = id;
			if (id) {
				let pathName = '';
				let routerName = '';
				let typeId = '';
				if (this.CXcheckVal === 1) {
					// "采购入库单"
					pathName = 'Purchase/push/instock';
					routerName = '/warehouse/purchase/activeWareHouse';
				}
				if (this.CXcheckVal === 2) {
					// "采购退料单"
					pathName = 'Purchase/push/return';
					routerName = '/warehouse/purchase/activeReturnOrder';
				}
				this.$http
					.post(pathName, { ids: this.OrdedetailIds })
					.then((res) => {
						if (res.status === 200) {
							this.dialogxt = false;
							this.$router.push({
								path: routerName,
								query: {
									type: 'pushDown',
									pushDownData: JSON.stringify(res.data),
									sjtag: Math.random() * 36,
								},
							});
						} else if (res.status === 99999) {
							this.$message.error({
								message: '已关闭单据无法下推，请重新选择再试',
								showClose: true,
							});
						}
						this.dialogxt = false;
					});
			} else {
				this.$message.error({
					message: '请先选中在确认',
					showClose: true,
				});
			}
		},
		submitCX() {
			// 确定上下查
			if (this.CXcheckVal) {
				let pathName = '';
				if (this.CXcheckVal === 8) {
					// "采购入库单"
					pathName = 'WarehousePurchaseWarehouse';
				}
				if (this.CXcheckVal === 9) {
					// "采购退料单"
					pathName = 'WarehousePurchaseReturnOrder';
				}
				if (this.CXcheckVal === 7) {
					// "销售订单"
					pathName = 'SaleOrder';
				}
				if (this.CXcheckVal === 10) {
					// "组织间需求单"
					pathName = 'OrgNeeds';
				}
				if (this.CXcheckVal === 3) {
					// "委外"
					pathName = 'OutsourcOrder';
				}
				let ary = [];
				ary = this.upOrDownList.filter((it) => {
					return it.orderType === this.CXcheckVal;
				});
				if (pathName) {
					this.dialogCX = false;
					this.$router.push({
						name: pathName,
						query: {
							detailsIds: JSON.stringify(
								ary.length > 0 ? ary[0].detailsIds : []
							),
							actionType:
								this.CXttile === '上查结果' ? 'up' : 'down',
							actionName: '采购订单',
							OrderNoNames: JSON.stringify(ary[0].billNos),
						},
					});
					this.dialogCX = false;
				}
			} else {
				this.$message.error({
					message: '请先选择在确认',
					showClose: true,
				});
			}
		},
		getcheckInfo() {
			// 上下查数据
			if (this.$route.query) {
				let ordNostr = '';
				this.search.detailsIds = this.$route.query.detailsIds
					? JSON.parse(
							decodeURIComponent(this.$route.query.detailsIds)
					  )
					: [];
				this.CXaction =
					this.$route.query.actionType === 'up' ? '上查' : '下查';
				this.OrderNoNameslist = this.$route.query.OrderNoNames
					? JSON.parse(
							decodeURIComponent(this.$route.query.OrderNoNames)
					  )
					: [];
				if (this.OrderNoNameslist.length > 0) {
					this.heightNum = this.heightNum - 36;
				}
				if (this.OrderNoNameslist) {
					this.OrderNoNameslist.forEach((it, index) => {
						if (index < 5) {
							ordNostr = ordNostr + it + ',';
						}
					});
				}
				this.OrderNoNameStr = ordNostr;
			}
		},
		handleSelectionChange(val) {
			// 表格选中条目发生改变
			this.selectItem = val.length;
			this.multipleSelection = val;
		},
		handleSizeChange(val) {
			// 每页条数
			this.pageSize = val;
			this.totalPageNumber = Math.ceil(
				this.totalItemNumber / this.pageSize
			);
			this.search.pageSize = val;
			this.getList(this.search);
		},
		handleCurrentChange(val) {
			// 分页当前页切换
			this.pageNo = val;
			this.search.pageNo = val;
			this.getList(this.search);
		},
		headerBg({ columnIndex }) {
			// 表头居右
			if (columnIndex === 17 || columnIndex === 18) {
				return `text-align:right!important;`;
			}
		},
		headerRigthMethod() {
			// 表头class
			return 'headerRight';
		},
		openRow() {
			// 搜索展开
			this.isDown = !this.isDown;
			this.rowShow = !this.rowShow;
			if (this.rowShow) {
				this.heightNum = this.heightNum - 80;
			} else {
				this.heightNum = this.heightNum + 80;
			}
		},
		openDetails(row, column) {
			// 详情跳转
			if (column.property == 'billNo') {
				this.$router.push({
					path: '/purchase/demand/createPurchase',
					query: {
						type: 'details',
						id: row.id,
						status: row.documentStatus,
						sjtag: Math.random() * 36,
					},
				});
			}
		},
		openDetailsDB(row, column) {
			this.$router.push({
				path: '/purchase/demand/createPurchase',
				query: {
					type: 'details',
					id: row.id,
					status: row.documentStatus,
					sjtag: Math.random() * 36,
				},
			});
		},
		getList(query) {
			// 获取列表信息
			this.tableLoading = true;
			this.$http.post('Purchase/List', query).then((req) => {
				if (req.status == 200) {
					this.tableLoading = false;
					this.tableData = req.data.list;
					this.qtyTotal = req.data.qtyTotal;
					this.producedTotal = req.data.producedTotal;
					this.deliveredTotal = req.data.deliveredTotal;
					this.stockinQtyTotal = req.data.stockinQtyTotal;
					this.deliverableTotal = req.data.deliverableTotal;
					this.allAmountTotal = req.data.allAmountTotal;
					this.totalItemNumber = req.data.totalCount;
					this.totalPageNumber = Math.ceil(
						this.totalItemNumber / this.pageSize
					);
					if (
						this.multipleSelection.length &&
						this.multipleSelection.length > 0
					) {
						console.log(
							'this.multipleSelection',
							this.multipleSelection
						);
						let detailsIds = [
							...new Set(
								this.multipleSelection.map((item) => {
									return item.detailsId;
								})
							),
						];
						this.tableData.forEach((el, ind) => {
							if (detailsIds.indexOf(el.detailsId) !== -1) {
								this.$refs.tableInfoRef.toggleRowSelection(
									this.tableData[ind],
									true
								);
							}
						});
					}
				}
			});
		},
		searchCom(val, key, type, ipt) {
			if (type == 'ipt' && ipt) {
				this.$refs.cascader.togglePopperVisible(); // 选择之后将下拉框界面收起
			}
			// 搜索公共
			if (val && val != ' ') {
				this.search[key] = val;
				// this.searchList()
			} else {
				delete this.search[key];
				// this.searchList()
			}
		},
		searchComS(val, key, type, ipt) {
			if (type == 'ipt' && ipt) {
				this.$refs.cascader.togglePopperVisible(); // 选择之后将下拉框界面收起
			}
			// 搜索公共
			if (val && val != ' ') {
				this.search[key] = val;
				this.searchList();
			} else {
				delete this.search[key];
				this.searchList();
			}
		},
		dateCom(val) {
			// 日期公共
			this.purchaseTime = val;
			if (this.purchaseTime == null) {
				delete this.search.beginDate;
				delete this.search.endDate;
			} else {
				this.search.beginDate = this.purchaseTime[0];
				this.search.endDate = this.purchaseTime[1];
			}
			// this.searchList()
		},
		searchList() {
			// 搜索
			this.getList(this.search);
		},
		getStatusTypeObject() {
			this.statusForm.purchaseOrgs = this.orgIdArr; // 采购组织
			this.statusForm.settleOrg = this.orgIdArr; // 结算组织
		},
		resetSearch() {
			// 重置
			let arr = [
				'billNo',
				'documentStatus',
				'confirmStatus',
				'purchaseorgId',
				'deptId',
				'productKey',
				'fillType',
				'supplierId',
				'purchaseTime',
				'payConditionId',
			];
			for (let index = 0; index < arr.length; index++) {
				this[arr[index]] = '';
			}
			this.reset = true;
			this.search = {
				pageNo: this.pageNo,
				pageSize: this.pageSize,
				orgId: this.$store.state.org
					? this.$store.state.org.orgId
					: null,
			};
			this.search.detailsIds = [];
			this.search.extention = {};
			this.customerSel1 = '';
			this.customerSel2 = '';
			this.customerSel3 = '';
			if (this.$route.query.detailsIds) {
				this.search.detailsIds = JSON.parse(
					decodeURIComponent(this.$route.query.detailsIds)
				);
			}
			setTimeout(() => {
				this.reset = false;
			}, 200);
			this.searchList();
		},
		// pickerOptions (date) {
		//   // 禁止时间
		//   return date.getTime() < new Date().getTime()
		// },
		...mapActions({
			setPaymentTerm: 'storeData/setPaymentTerm',
			setSettletype: 'storeData/setSettletype',
			setDcurrency: 'storeData/setDcurrency',
			setWarehouseAll: 'storeData/setWarehouseAll',
			setSupplierSelect: 'storeData/setSupplierSelect',
			setStatusGetType: 'storeData/setStatusGetType',
			setPurOrderStatus: 'storeData/setPurOrderStatus',
			setDicPurOrder: 'storeData/setDicPurOrder',
		}),
		addListDeman(event) {
			if (event.keyCode === 13) {
				this.searchList();
			}
		},
	},
	computed: {
		...mapState({
			orgIdArr: (state) => (state ? state.user.orgIdArr : null),
			getorgId: (state) =>
				state && state.org && state.org.orgId ? state.org.orgId : null,
			orgIdChange() {
				// 监听ID
				return this.$store.state.org
					? this.$store.state.org.orgId
					: null;
			},
			paymentTerm: (state) => state.storeData.paymentTerm,
			settletype: (state) => state.storeData.settletype,
			dcurrency: (state) => state.storeData.dcurrency,
			warehouseAll: (state) => state.storeData.warehouseAll,
			supplierSelect: (state) => state.storeData.supplierSelect,
			statusGetType: (state) => state.storeData.statusGetType,
			purOrderStatus: (state) => state.storeData.purOrderStatus,
			dicPurOrder: (state) => state.storeData.dicPurOrder,
		}),
	},
	mounted: function () {},
	created: function () {
		this.getcheckInfo();
		this.Init();
		this.getStatusTypeObject();
	},
	activated() {
		document.addEventListener('keyup', this.addListDeman, false);
	},
	deactivated() {
		document.removeEventListener('keyup', this.addListDeman, false);
	},
	watch: {
		// 监听组织
		orgIdChange: function () {
			this.deptId = '';
			this.statusForm.purchaseDepts = [];
			if (
				this.$store.state &&
				this.$store.state.org &&
				this.$store.state.org.orgId
			) {
				this.$http
					.post('SysConfig/GetDept/' + this.$store.state.org.orgId)
					.then((req) => {
						this.statusForm.purchaseDepts = removeChildren(
							req.data
						);
					});
			}
			this.search.orgId = this.$store.state.org
				? this.$store.state.org.orgId
				: null;
			// if (!this.search.orgId) {
			// 	return;
			// }
			this.getList(this.search);
			this.resetSearch();
		},
		customerSel1: function () {
			let returnR = customChangeMethods(
				this.customerSel1,
				this.customerSel2,
				this.customerSel3,
				'x',
				this.compKey1
			);
			this.customerSel1 = returnR.selfVal;
			this.customerSel2 = returnR.otherO;
			this.customerSel3 = returnR.otherT;
			this.compKey1 = returnR.keyRsf;
		},
		customerSel2: function () {
			let returnR = customChangeMethods(
				this.customerSel2,
				this.customerSel1,
				this.customerSel3,
				'y',
				this.compKey2
			);
			this.customerSel2 = returnR.selfVal;
			this.customerSel1 = returnR.otherO;
			this.customerSel3 = returnR.otherT;
			this.compKey2 = returnR.keyRsf;
		},
		customerSel3: function () {
			let returnR = customChangeMethods(
				this.customerSel3,
				this.customerSel1,
				this.customerSel2,
				'z',
				this.compKey3
			);
			this.customerSel3 = returnR.selfVal;
			this.customerSel1 = returnR.otherO;
			this.customerSel2 = returnR.otherT;
			this.compKey3 = returnR.keyRsf;
		},
	},
};
</script>
<style lang="scss" scoped>
@import '@/assets/style/purchase/purchaseCommon.scss';
@import '@/assets/style/purchase/purchaseList.scss';
@import '@/assets/style/saleOrder/common.scss';
</style>
