|
@@ -1,13 +1,31 @@
|
|
|
<template>
|
|
|
<div class="tenant">
|
|
|
+ <div class="isSet-box">
|
|
|
+ <el-radio-group v-model="sourceList.pagination.isSet" size="large" @change="getList">
|
|
|
+ <el-radio-button label="1">未创建</el-radio-button>
|
|
|
+ <el-radio-button label="2">已创建</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
<div class="content">
|
|
|
<byTable
|
|
|
:source="sourceList.data"
|
|
|
:pagination="sourceList.pagination"
|
|
|
- :config="config"
|
|
|
+ :config="sourceList.pagination.isSet == '1' ? config : config2"
|
|
|
:loading="loading"
|
|
|
:selectConfig="selectConfig"
|
|
|
highlight-current-row
|
|
|
+ :action-list="[
|
|
|
+ {
|
|
|
+ text: '生成中间合同',
|
|
|
+ plain: true,
|
|
|
+ type: 'warning',
|
|
|
+ action: () => openModal('add'),
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ :table-events="{
|
|
|
+ //element talbe事件都能传
|
|
|
+ select: select,
|
|
|
+ }"
|
|
|
@get-list="getList">
|
|
|
<template #code="{ item }">
|
|
|
<div style="width: 100%">
|
|
@@ -22,14 +40,14 @@
|
|
|
</template>
|
|
|
<template #sellCorporationName="{ item }">
|
|
|
<div>
|
|
|
- <span v-if="item.sellCorporationName">{{ item.sellCorporationName }}</span>
|
|
|
- <span v-else>{{ item.oldSellCorporationName }}</span>
|
|
|
+ <span v-if="item.sellCorporationName">{{ item.buyCorporationName}}</span>
|
|
|
+ <span v-else>{{ item.buyCorporationName }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #buyCorporationName="{ item }">
|
|
|
<div>
|
|
|
- <span v-if="item.buyCorporationName">{{ item.buyCorporationName }}</span>
|
|
|
- <span v-else>{{ item.oldBuyCorporationName }}</span>
|
|
|
+ <span v-if="item.buyCorporationName">{{ item.sellCorporationName }}</span>
|
|
|
+ <span v-else>{{ item.sellCorporationName }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byTable>
|
|
@@ -42,11 +60,12 @@
|
|
|
{{ printDetails.sellCorporationNameEn }}
|
|
|
</div>
|
|
|
<div style="text-align: center">
|
|
|
- {{ printDetails.sellDetailedAddress }},{{ printDetails.sellCityName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCountryName }}
|
|
|
+ {{ printDetails.buyDetailedAddress }}
|
|
|
+ <!-- {{ printDetails.sellDetailedAddress }},{{ printDetails.sellCityName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCountryName }} -->
|
|
|
</div>
|
|
|
<div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">PROFORMA INVOICE</div>
|
|
|
<div style="padding-top: 8px">
|
|
|
- <div>PI NO. : {{ printDetails.contractCode }}</div>
|
|
|
+ <div>PI NO. : {{ printDetails.code }}</div>
|
|
|
<div>PI DATE: {{ printDetails.createTimeEn }}</div>
|
|
|
</div>
|
|
|
<div style="border: 1px solid black; display: flex">
|
|
@@ -125,8 +144,9 @@
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
|
|
|
</div>
|
|
|
- <div v-if="printDetails.productInfoList && printDetails.productInfoList.length > 0">
|
|
|
- <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.productInfoList" :key="item.productId">
|
|
|
+
|
|
|
+ <div v-if="printDetails.contractMap.contractProductList && printDetails.contractMap.contractProductList.length > 0">
|
|
|
+ <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.contractMap.contractProductList" :key="item.productId">
|
|
|
<div class="contentRow" style="width: 50px; text-align: center">
|
|
|
{{ index + 1 }}
|
|
|
</div>
|
|
@@ -137,10 +157,10 @@
|
|
|
{{ dictValueLabel(item.productUnit, productUnit) }}
|
|
|
</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">
|
|
|
- {{ item.productQuantity }}
|
|
|
+ {{ item.quantity }}
|
|
|
</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">
|
|
|
- {{ item.productPrice }}
|
|
|
+ {{ item.price }}
|
|
|
</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">
|
|
|
{{ item.amount }}
|
|
@@ -151,7 +171,7 @@
|
|
|
<div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL:</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center"></div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">
|
|
|
- {{ statistics("productQuantity", 0) }}
|
|
|
+ {{ statistics("quantity", 0) }}
|
|
|
</div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center"></div>
|
|
|
<div class="contentRow" style="width: 100px; text-align: center">
|
|
@@ -257,7 +277,7 @@
|
|
|
<script setup>
|
|
|
import { computed, ref } from "vue";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
+import { ElMessage,ElMessageBox } from "element-plus";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
@@ -274,6 +294,7 @@ const sourceList = ref({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
+ isSet: "1",
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
@@ -291,7 +312,17 @@ const selectConfig = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
-const config = computed(() => {
|
|
|
+
|
|
|
+const selection = ref({
|
|
|
+ data: [],
|
|
|
+});
|
|
|
+
|
|
|
+const select = (_selection, row) => {
|
|
|
+ selection.value.data = _selection;
|
|
|
+ console.log(_selection);
|
|
|
+};
|
|
|
+
|
|
|
+const config2 = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
@@ -310,7 +341,7 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "销售方",
|
|
|
- slot: "sellCorporationName",
|
|
|
+ prop: "sellCorporationName",
|
|
|
"min-width": 200,
|
|
|
},
|
|
|
},
|
|
@@ -323,14 +354,14 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "最近操作人",
|
|
|
+ label: "创建人",
|
|
|
prop: "opUserName",
|
|
|
width: 180,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "最近操作时间",
|
|
|
+ label: "创建时间",
|
|
|
prop: "updateTime",
|
|
|
width: 180,
|
|
|
},
|
|
@@ -343,30 +374,131 @@ const config = computed(() => {
|
|
|
fixed: "right",
|
|
|
},
|
|
|
renderHTML(row) {
|
|
|
- return [
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "编辑",
|
|
|
- type: "primary",
|
|
|
- text: true,
|
|
|
+ if(sourceList.value.pagination.isSet == '2') {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "删除",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ "此操作将永久删除该数据, 是否继续?",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ proxy
|
|
|
+ .post("/intermediateContract/del", {
|
|
|
+ id: row.id,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
- el: "button",
|
|
|
- click() {
|
|
|
- clickUpdate(row);
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "打印",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickPrint(row);
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
+ ];
|
|
|
+ } else{
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "生成中间合同",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickUpdate(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "selection",
|
|
|
+ attrs: {
|
|
|
+ label: "多选",
|
|
|
+ prop: "remark",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "合同编码",
|
|
|
+ slot: "code",
|
|
|
+ width: 220,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "合同金额",
|
|
|
+ slot: "amount",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "归属公司",
|
|
|
+ slot: "sellCorporationName",
|
|
|
+ "min-width": 200,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "客户名称",
|
|
|
+ slot: "buyCorporationName",
|
|
|
+ "min-width": 200,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: "120",
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "打印",
|
|
|
+ label: "生成中间合同",
|
|
|
type: "primary",
|
|
|
text: true,
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- clickPrint(row);
|
|
|
+ clickUpdate(row);
|
|
|
},
|
|
|
},
|
|
|
];
|
|
|
+
|
|
|
},
|
|
|
},
|
|
|
];
|
|
@@ -432,12 +564,23 @@ const getList = async (req) => {
|
|
|
getDict();
|
|
|
getList();
|
|
|
const openPrint = ref(false);
|
|
|
-const printDetails = ref({});
|
|
|
+const printDetails = ref({
|
|
|
+ contractMap:{
|
|
|
+ contractProductList:[],
|
|
|
+ contract:{},
|
|
|
+ },
|
|
|
+});
|
|
|
const clickPrint = (row) => {
|
|
|
- printDetails.value = {};
|
|
|
+ printDetails.value = {
|
|
|
+ contractMap:{
|
|
|
+ contractProductList:[],
|
|
|
+ contract:{},
|
|
|
+ },
|
|
|
+ };
|
|
|
openPrint.value = true;
|
|
|
- proxy.post("/intermediateContract/getPrintInfo", { documentsId: row.documentsId }).then((res) => {
|
|
|
- printDetails.value = res;
|
|
|
+ proxy.post("/intermediateContract/getPrintInfo", { id: row.id }).then((res) => {
|
|
|
+ printDetails.value = {...res,...res.contractMap.contract};
|
|
|
+ console.log(printDetails.value.contractMap.contractProductList);
|
|
|
});
|
|
|
};
|
|
|
const clickDownload = () => {
|
|
@@ -445,8 +588,8 @@ const clickDownload = () => {
|
|
|
};
|
|
|
const statistics = (label, index) => {
|
|
|
let num = 0;
|
|
|
- if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
|
|
|
- printDetails.value.productInfoList.map((item) => {
|
|
|
+ if (printDetails.value.contractMap.contractProductList && printDetails.value.contractMap.contractProductList.length > 0) {
|
|
|
+ printDetails.value.contractMap.contractProductList.map((item) => {
|
|
|
if (item[label]) {
|
|
|
num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
|
|
|
}
|
|
@@ -456,8 +599,8 @@ const statistics = (label, index) => {
|
|
|
};
|
|
|
const statisticsTwo = (label, index) => {
|
|
|
let num = 0;
|
|
|
- if (printDetails.value.contractProjectList && printDetails.value.contractProjectList.length > 0) {
|
|
|
- printDetails.value.contractProjectList.map((item) => {
|
|
|
+ if (printDetails.value.contractMap.contractProductList && printDetails.value.contractMap.contractProductList.length > 0) {
|
|
|
+ printDetails.value.contractMap.contractProductList.map((item) => {
|
|
|
if (item[label]) {
|
|
|
num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
|
|
|
}
|
|
@@ -547,10 +690,23 @@ const rules = ref({
|
|
|
buyContactName: [{ required: true, message: "请输入采购联系人", trigger: "blur" }],
|
|
|
buyContactNumber: [{ required: true, message: "请输入采购联系电话", trigger: "blur" }],
|
|
|
});
|
|
|
+const openModal = (type) => {
|
|
|
+ getPerson();
|
|
|
+ formData.data = {
|
|
|
+ documentsIds: selection.value.data.map((item) => item.id).join(","),
|
|
|
+ sellCorporationId: "",
|
|
|
+ sellContactName: "",
|
|
|
+ sellContactNumber: "",
|
|
|
+ buyCorporationId: "",
|
|
|
+ buyContactName: "",
|
|
|
+ buyContactNumber: "",
|
|
|
+ };
|
|
|
+ openUpdate.value = true;
|
|
|
+};
|
|
|
const clickUpdate = (row) => {
|
|
|
getPerson();
|
|
|
formData.data = {
|
|
|
- documentsId: row.documentsId,
|
|
|
+ documentsIds: row.id,
|
|
|
sellCorporationId: "",
|
|
|
sellContactName: "",
|
|
|
sellContactNumber: "",
|