|
@@ -0,0 +1,968 @@
|
|
|
+<template>
|
|
|
+ <div style="width: 100%; padding: 0px 15px">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
+
|
|
|
+ <template #contractDetail>
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-button type="primary" @click="openSelectContrct=true" plain style="margin-bottom: 16px" v-if="!judgeStatus()">选择</el-button>
|
|
|
+ <el-table :data="formData.data.invoiceApplyContractDetailList" style="width: 100%;">
|
|
|
+ <el-table-column label="合同号" prop="contractCode" />
|
|
|
+ <el-table-column label="收款金额" prop="sumClaimMoney" />
|
|
|
+ <el-table-column label="已开票金额" prop="invoiceAmount" />
|
|
|
+ <el-table-column label="未开票金额" prop="unInvoiceAmount" />
|
|
|
+ <el-table-column label="开票金额" prop="amount" width="130">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyContractDetailList.' + $index + '.amount'" :rules="rules.amount" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.amount" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="amountChange" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleRemove($index,1)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #customer>
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-select v-model="formData.data.customerId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
|
|
|
+ :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer">
|
|
|
+ <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #detail>
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-button type="primary" @click="handleAdd()" plain style="margin-bottom: 16px" v-if="!judgeStatus()">添加</el-button>
|
|
|
+ <el-table :data="formData.data.invoiceApplyDetailList" style="width: 100%;">
|
|
|
+ <el-table-column label="货物或应税劳务名称、服务名称" prop="name">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.name'" :rules="rules.name" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.name" placeholder="请输入" style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="规格型号" prop="spec" width="160">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.spec'" :rules="rules.spec" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.spec" placeholder="请输入" style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单位" prop="unit" width="140">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.unit'" :rules="rules.unit" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.unit" placeholder="请输入" style="width: 100%" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数量" prop="quantity" width="130">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
+ :controls="false" :min="0" @change="totalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="priceIncludingTax" label="单价(含税)" width="120" />
|
|
|
+ <el-table-column label="金额(含税)" prop="amountIncludingTax" width="120">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'invoiceApplyDetailList.' + $index + '.amountIncludingTax'" :rules="rules.amountIncludingTax"
|
|
|
+ :inline-message="true" class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.amountIncludingTax" placeholder="请输入" style="width: 100%"
|
|
|
+ :precision="2" :controls="false" :min="0" @change="totalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="taxRate" label="税率(%)" width="100" />
|
|
|
+ <el-table-column prop="taxAmount" label="税额" width="100" />
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleRemove($index,2)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <el-dialog v-if="openSelectContrct" v-model="openSelectContrct" title="合同选择" width="90%" append-to-body>
|
|
|
+ <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openSelectContrct = false" size="defualt" v-debounce>关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const route = useRoute();
|
|
|
+// 接收父组件的传值
|
|
|
+const props = defineProps({
|
|
|
+ queryData: Object,
|
|
|
+});
|
|
|
+const openSelectContrct = ref(false);
|
|
|
+const internalOrderChannels = computed(
|
|
|
+ () => proxy.useUserStore().allDict["internal_order_channels"]
|
|
|
+);
|
|
|
+const applicatioScenario = computed(
|
|
|
+ () => proxy.useUserStore().allDict["applicatio_scenario"]
|
|
|
+);
|
|
|
+const paymentSituation = computed(
|
|
|
+ () => proxy.useUserStore().allDict["payment_situation"]
|
|
|
+);
|
|
|
+const customerList = ref([]);
|
|
|
+const accountList = ref([]);
|
|
|
+const userList = ref([]);
|
|
|
+const deptData = ref([]);
|
|
|
+const isData = ref([
|
|
|
+ {
|
|
|
+ label: "是",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "否",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const invoiceType = ref([
|
|
|
+ {
|
|
|
+ label: "1%电子普票",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "1%纸质普票",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+]);
|
|
|
+
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ invoiceApplyContractDetailList: [],
|
|
|
+ invoiceApplyDetailList: [],
|
|
|
+ fileList: [],
|
|
|
+ jstOrderFileList: [],
|
|
|
+ shopTradeFileList: [],
|
|
|
+ invoicerFileList: [],
|
|
|
+ },
|
|
|
+});
|
|
|
+const formDom = ref(null);
|
|
|
+const judgeStatus = () => {
|
|
|
+ if (route.query.processType == 20 || route.query.processType == 10) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (props.queryData.recordList && props.queryData.recordList.length > 0) {
|
|
|
+ let data = props.queryData.recordList.filter(
|
|
|
+ (item) => item.status === 2 && item.nodeType !== 1
|
|
|
+ );
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelPosition: "top",
|
|
|
+ labelWidth: 150,
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+});
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "基本信息",
|
|
|
+ haveLine: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "code",
|
|
|
+ label: "申请单号",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "createUser",
|
|
|
+ label: "申请人",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: userList.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "treeSelect",
|
|
|
+ prop: "deptId",
|
|
|
+ label: "开票部门",
|
|
|
+ data: deptData.value,
|
|
|
+ propsTreeLabel: "deptName",
|
|
|
+ propsTreeValue: "deptId",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "date",
|
|
|
+ prop: "applyTime",
|
|
|
+ itemType: "date",
|
|
|
+ label: "申请日期",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "treeSelect",
|
|
|
+ // prop: "companyId",
|
|
|
+ // label: "所属公司",
|
|
|
+ // data: proxy.useUserStore().allDict["tree_all_company_data"],
|
|
|
+ // propsTreeLabel: "deptName",
|
|
|
+ // propsTreeValue: "deptId",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // fn: (val) => {},
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
+
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "applyScenario",
|
|
|
+ label: "申请场景",
|
|
|
+ filterable: true,
|
|
|
+ multiple: false,
|
|
|
+ data: applicatioScenario.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "orderingChannels",
|
|
|
+ label: "内部下单渠道",
|
|
|
+ filterable: true,
|
|
|
+ multiple: false,
|
|
|
+ data: internalOrderChannels.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "财务主管驳回原因",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ aisInventorySupportept: "",
|
|
|
+ prop: "fileList",
|
|
|
+ label: "相关审批附件",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "关联系统销售合同",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: formData.data.orderingChannels == "10",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "contractDetail",
|
|
|
+ label: "关联系统销售合同",
|
|
|
+ isShow: formData.data.orderingChannels == "10",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "关联系统销售合同单号y",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: formData.data.orderingChannels == "10",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "合同累计收款金额",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // placeholder: " ",
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: formData.data.orderingChannels == "10",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "合同累计收款金额",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // placeholder: " ",
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: formData.data.orderingChannels == "10",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "contractAmount",
|
|
|
+ itemType: "text",
|
|
|
+ label: "合同开票总金额",
|
|
|
+ itemWidth: 50,
|
|
|
+ placeholder: " ",
|
|
|
+ disabled: true,
|
|
|
+ isShow: formData.data.orderingChannels == "10",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "未开票金额",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // placeholder: " ",
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: formData.data.orderingChannels == "10",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "isMatchOrder",
|
|
|
+ label: "是否匹配订单",
|
|
|
+ filterable: true,
|
|
|
+ multiple: false,
|
|
|
+ data: isData.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ isShow: formData.data.orderingChannels == "30",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "paymentSituation",
|
|
|
+ label: "收款情况",
|
|
|
+ filterable: true,
|
|
|
+ multiple: false,
|
|
|
+ data: paymentSituation.value,
|
|
|
+ itemWidth: 33.33,
|
|
|
+ isShow: formData.data.orderingChannels == "30",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "jstOrderCode",
|
|
|
+ itemType: "text",
|
|
|
+ label: "关联聚水潭单号",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: false,
|
|
|
+ isShow: ["20", "30", "40", "50"].includes(formData.data.orderingChannels),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "uploadImg",
|
|
|
+ // listType: "picture-card",
|
|
|
+ // limit: 1,
|
|
|
+ // accept: ".gif, .jpeg, .jpg, .png",
|
|
|
+ prop: "jstOrderFileList",
|
|
|
+ imgProp: "imageUrl",
|
|
|
+ label: "聚水潭订单界面金额截图(需有订单号和金额)",
|
|
|
+ itemWidth: 100,
|
|
|
+ isShow: ["20", "30", "40", "50"].includes(formData.data.orderingChannels),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "uploadImg",
|
|
|
+ // listType: "picture-card",
|
|
|
+ // limit: 1,
|
|
|
+ // accept: ".gif, .jpeg, .jpg, .png",
|
|
|
+ prop: "shopTradeFileList",
|
|
|
+ imgProp: "imageUrlOne",
|
|
|
+ label: "店铺交易截图(含店铺名称、订单编号)",
|
|
|
+ itemWidth: 100,
|
|
|
+ isShow: ["20", "40"].includes(formData.data.orderingChannels),
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "askRemark",
|
|
|
+ itemType: "textarea",
|
|
|
+ label: "开票要求备注",
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "isCashNoted",
|
|
|
+ itemType: "text",
|
|
|
+ label: "是否在票面备注上‘现金’两个字",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: false,
|
|
|
+ placeholder: " ",
|
|
|
+ isShow: ["20", "40"].includes(formData.data.orderingChannels),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "开票信息&税点结算",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "taxPointSettle",
|
|
|
+ itemType: "text",
|
|
|
+ label: "税点结算(%)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "taxPointSettleAmount",
|
|
|
+ itemType: "text",
|
|
|
+ label: "税点结算金额",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "customerId",
|
|
|
+ slotName: "customer",
|
|
|
+ label: "客户开票信息",
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "billingType",
|
|
|
+ label: "开票类型",
|
|
|
+ filterable: false,
|
|
|
+ multiple: false,
|
|
|
+ data: invoiceType.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "sellerCompanyId",
|
|
|
+ label: "名称(销售方)",
|
|
|
+ filterable: false,
|
|
|
+ multiple: false,
|
|
|
+ data: accountList.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ fn: (val) => {
|
|
|
+ changeShroffAccount(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "buyerCompanyName",
|
|
|
+ itemType: "text",
|
|
|
+ label: "名称(购买方)",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "sellerTaxpayerCode",
|
|
|
+ itemType: "text",
|
|
|
+ label: "纳税人识别号(销售方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "buyerTaxpayerCode",
|
|
|
+ itemType: "text",
|
|
|
+ label: "纳税人识别号(购买方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "sellerAddress",
|
|
|
+ itemType: "text",
|
|
|
+ label: "地址、电话(销售方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "buyerAddress",
|
|
|
+ itemType: "text",
|
|
|
+ label: "地址、电话(购买方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "sellerAccountBank",
|
|
|
+ itemType: "text",
|
|
|
+ label: "开户行及账号(销售方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "buyerAccountBank",
|
|
|
+ itemType: "text",
|
|
|
+ label: "开户行及账号(购买方)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "开票内容",
|
|
|
+ haveLine: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "detail",
|
|
|
+ prop: "",
|
|
|
+ label: "开票明细",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "amountIncludingTax",
|
|
|
+ itemType: "text",
|
|
|
+ label: "合计开票总金额(含税)",
|
|
|
+ placeholder: " ",
|
|
|
+ itemWidth: 50,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "activityName",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "客户确认结果",
|
|
|
+ // placeholder: " ",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "ticketRemark",
|
|
|
+ itemType: "textarea",
|
|
|
+ label: "票面备注内容",
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ aisInventorySupportept: "",
|
|
|
+ prop: "invoicerFileList",
|
|
|
+ label: "开票员上传发票附件",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+
|
|
|
+const rules = ref({
|
|
|
+ applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
|
|
|
+ companyId: [{ required: true, message: "请选择所属公司", trigger: "change" }],
|
|
|
+ deptId: [{ required: true, message: "请选择所属部门", trigger: "change" }],
|
|
|
+ createUser: [{ required: true, message: "请选择申请人", trigger: "change" }],
|
|
|
+ applyScenario: [
|
|
|
+ { required: true, message: "请选择申请场景", trigger: "change" },
|
|
|
+ ],
|
|
|
+ orderingChannels: [
|
|
|
+ { required: true, message: "请选择内部下单渠道", trigger: "change" },
|
|
|
+ ],
|
|
|
+ isMatchOrder: [
|
|
|
+ { required: true, message: "请选择是否匹配订单", trigger: "change" },
|
|
|
+ ],
|
|
|
+ paymentSituation: [
|
|
|
+ { required: true, message: "请选择收款情况", trigger: "change" },
|
|
|
+ ],
|
|
|
+ jstOrderFileList: [{ required: true, message: "请上传", trigger: "change" }],
|
|
|
+ shopTradeFileList: [{ required: true, message: "请上传", trigger: "change" }],
|
|
|
+ jstOrderCode: [
|
|
|
+ { required: true, message: "请输入聚水潭单号", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ // askRemark: [
|
|
|
+ // { required: true, message: "请输入开票要求备注", trigger: "blur" },
|
|
|
+ // ],
|
|
|
+ sellerCompanyId: [
|
|
|
+ { required: true, message: "请选择销售方", trigger: "change" },
|
|
|
+ ],
|
|
|
+ customerId: [
|
|
|
+ { required: true, message: "请选择客户开票信息", trigger: "change" },
|
|
|
+ ],
|
|
|
+ name: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
|
+ spec: [{ required: true, message: "请输入规格型号", trigger: "blur" }],
|
|
|
+ unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ amountIncludingTax: [
|
|
|
+ { required: true, message: "请输入金额(含税)", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ amount: [{ required: true, message: "请输入开票金额", trigger: "blur" }],
|
|
|
+});
|
|
|
+const isFormDetail = ref(false);
|
|
|
+if (route.query && route.query.processType && route.query.processType == 20) {
|
|
|
+ isFormDetail.value = true;
|
|
|
+}
|
|
|
+const getDeptData = () => {
|
|
|
+ proxy
|
|
|
+ .get(isFormDetail.value ? "/tenantUser/listAll" : "/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ // companyId: proxy.useUserStore().user.companyId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ // ancestors: proxy.useUserStore().user.companyId,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ // type: 2,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ deptData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+};
|
|
|
+getDeptData();
|
|
|
+
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("/accountManagement/page", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ accountList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.alias,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/customer/selPage", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+
|
|
|
+const loadingSearch = ref(false);
|
|
|
+const remoteMethod = (keyword) => {
|
|
|
+ if (keyword && typeof keyword === "string") {
|
|
|
+ loadingSearch.value = true;
|
|
|
+ proxy.post("/customer/selPage", { keyword }).then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ loadingSearch.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return;
|
|
|
+};
|
|
|
+
|
|
|
+const changeCustomer = (val) => {
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/customer/detail", { id: val }).then(
|
|
|
+ (res) => {
|
|
|
+ formData.data.buyerCompanyName = res.name;
|
|
|
+ formData.data.buyerTaxpayerCode = res.dutyParagraph;
|
|
|
+ formData.data.buyerAddress = res.accountAddress + " " + res.accountTel;
|
|
|
+ formData.data.buyerAccountBank =
|
|
|
+ res.accountBank + " " + res.accountNumber;
|
|
|
+ },
|
|
|
+ (err) => {}
|
|
|
+ );
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeShroffAccount = (val) => {
|
|
|
+ if (val) {
|
|
|
+ let data = accountList.value.find((item) => item.value == val);
|
|
|
+ if (data) {
|
|
|
+ formData.data.taxPointSettle = data.taxPoints;
|
|
|
+ formData.data.sellerTaxpayerCode = data.taxpayerCode;
|
|
|
+ formData.data.sellerAddress =
|
|
|
+ data.beneficiaryAddress + " " + data.beneficiaryTel;
|
|
|
+ formData.data.sellerAccountBank =
|
|
|
+ data.openingBank + " " + data.accountOpening;
|
|
|
+ for (let i = 0; i < formData.data.invoiceApplyDetailList.length; i++) {
|
|
|
+ formData.data.invoiceApplyDetailList[i].taxRate =
|
|
|
+ formData.data.taxPointSettle;
|
|
|
+ }
|
|
|
+ totalAmount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const totalAmount = () => {
|
|
|
+ let money = 0;
|
|
|
+ let moneyTwo = 0;
|
|
|
+ if (
|
|
|
+ formData.data.invoiceApplyDetailList &&
|
|
|
+ formData.data.invoiceApplyDetailList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.invoiceApplyDetailList.length; i++) {
|
|
|
+ let row = formData.data.invoiceApplyDetailList[i];
|
|
|
+ row.priceIncludingTax = parseFloat(
|
|
|
+ Number(row.amountIncludingTax) / Number(row.quantity)
|
|
|
+ ).toFixed(2);
|
|
|
+ money = parseFloat(
|
|
|
+ Number(money) + Number(row.amountIncludingTax)
|
|
|
+ ).toFixed(2);
|
|
|
+ if (row.taxRate) {
|
|
|
+ row.taxAmount = parseFloat(
|
|
|
+ Number(row.amountIncludingTax) * (Number(row.taxRate) / 100)
|
|
|
+ ).toFixed(2);
|
|
|
+ moneyTwo = parseFloat(Number(moneyTwo) + Number(row.taxAmount)).toFixed(
|
|
|
+ 2
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.amountIncludingTax = money;
|
|
|
+ formData.data.taxPointSettleAmount = moneyTwo;
|
|
|
+};
|
|
|
+
|
|
|
+const amountChange = () => {
|
|
|
+ let money = 0;
|
|
|
+ if (
|
|
|
+ formData.data.invoiceApplyContractDetailList &&
|
|
|
+ formData.data.invoiceApplyContractDetailList.length > 0
|
|
|
+ ) {
|
|
|
+ for (
|
|
|
+ let i = 0;
|
|
|
+ i < formData.data.invoiceApplyContractDetailList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ let row = formData.data.invoiceApplyContractDetailList[i];
|
|
|
+
|
|
|
+ money = parseFloat(Number(money) + Number(row.amount)).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.contractAmount = money;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSelectContrct = async (row) => {
|
|
|
+ formData.data.invoiceApplyContractDetailList.push({
|
|
|
+ contractId: row.id,
|
|
|
+ contractCode: row.code,
|
|
|
+ sumClaimMoney: row.sumClaimMoney,
|
|
|
+ invoiceAmount: row.invoiceAmount,
|
|
|
+ unInvoiceAmount: row.unInvoiceAmount,
|
|
|
+ amount: null,
|
|
|
+ });
|
|
|
+ return proxy.msgTip("选择成功", 1);
|
|
|
+};
|
|
|
+
|
|
|
+const handleAdd = () => {
|
|
|
+ formData.data.invoiceApplyDetailList.push({
|
|
|
+ name: "",
|
|
|
+ spec: "",
|
|
|
+ unit: "",
|
|
|
+ quantity: null,
|
|
|
+ priceIncludingTax: "",
|
|
|
+ amountIncludingTax: "",
|
|
|
+ taxRate: formData.data.taxPointSettle ? formData.data.taxPointSettle : "",
|
|
|
+ taxAmount: "",
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleRemove = (index, type) => {
|
|
|
+ if (type == 1) {
|
|
|
+ formData.data.invoiceApplyContractDetailList.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ formData.data.invoiceApplyDetailList.splice(index, 1);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleSubmit = async (isStag = false) => {
|
|
|
+ if (isStag) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ let flag = await formDom.value.handleSubmit(() => {});
|
|
|
+ if (flag) {
|
|
|
+ if (formData.data.orderingChannels == "10") {
|
|
|
+ if (
|
|
|
+ !(
|
|
|
+ formData.data.invoiceApplyContractDetailList &&
|
|
|
+ formData.data.invoiceApplyContractDetailList.length > 0
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ proxy.msgTip("请关联销售合同", 2);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !(
|
|
|
+ formData.data.invoiceApplyDetailList &&
|
|
|
+ formData.data.invoiceApplyDetailList.length > 0
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ proxy.msgTip("请添加开票明细", 2);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (formData.data.orderingChannels == "10") {
|
|
|
+ if (
|
|
|
+ !(
|
|
|
+ Number(formData.data.contractAmount) ==
|
|
|
+ Number(formData.data.amountIncludingTax)
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ proxy.msgTip("合同开票总金额必须等于合计开票总金额(含税)", 2);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ const errorDiv = document.getElementsByClorderingChannelsName("is-error");
|
|
|
+ errorDiv[0].scrollIntoView();
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+};
|
|
|
+
|
|
|
+const getFormData = () => {
|
|
|
+ return proxy.deepClone(formData.data);
|
|
|
+};
|
|
|
+// 向父组件暴露
|
|
|
+defineExpose({
|
|
|
+ getFormData,
|
|
|
+ handleSubmit,
|
|
|
+});
|
|
|
+
|
|
|
+const getAllData = (businessId) => {
|
|
|
+ if (businessId) {
|
|
|
+ proxy.post("/invoiceApply/detail", { id: businessId }).then((res) => {
|
|
|
+ formData.data = res;
|
|
|
+ amountChange();
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [businessId] })
|
|
|
+ .then((fileObj) => {
|
|
|
+ if (fileObj[businessId] && fileObj[businessId].length > 0) {
|
|
|
+ formData.data.fileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "10")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ formData.data.jstOrderFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "20")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ formData.data.jstOrderFileList &&
|
|
|
+ formData.data.jstOrderFileList.length > 0
|
|
|
+ ) {
|
|
|
+ formData.data.imageUrl =
|
|
|
+ formData.data.jstOrderFileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.shopTradeFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "30")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ formData.data.shopTradeFileList &&
|
|
|
+ formData.data.shopTradeFileList.length > 0
|
|
|
+ ) {
|
|
|
+ formData.data.imageUrlOne =
|
|
|
+ formData.data.shopTradeFileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.invoicerFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "40")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.fileList = [];
|
|
|
+ formData.data.jstOrderFileList = [];
|
|
|
+ formData.data.shopTradeFileList = [];
|
|
|
+ formData.data.invoicerFileList = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ formData.data.applyTime = proxy.parseTime(new Date());
|
|
|
+ formData.data.companyId = proxy.useUserStore().user.companyId;
|
|
|
+ formData.data.deptId = proxy.useUserStore().user.dept.deptId;
|
|
|
+ formData.data.createUser = proxy.useUserStore().user.userId;
|
|
|
+ if (route.query.businessId) {
|
|
|
+ getAllData(route.query.businessId);
|
|
|
+ }
|
|
|
+ // 删除莫名多出的一个textarea
|
|
|
+ nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ let dom = document.getElementsByTagName("textarea");
|
|
|
+ if (dom && dom.length > 0) {
|
|
|
+ for (let i = 0; i < dom.length; i++) {
|
|
|
+ if (!dom[i].className) {
|
|
|
+ dom[i].style.display = "none";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+</style>
|