|
@@ -1,11 +1,12 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, onMounted, onUnmounted } from 'vue'
|
|
|
+import { shallowRef, ref, onMounted, onUnmounted } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { GlobalStore } from '@/stores/index'
|
|
|
import { fnMd5 } from '@/utils/common'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import Drawer from '@/components/Drawer/index.vue'
|
|
|
import ImageCom from '@/components/Image/index.vue'
|
|
|
+import { ColumnProps } from '@/components/TableBase/interface/index'
|
|
|
import { Storehouse_Contract_Get, Storehouse_Contract_Approval } from '@/api/storehouse/index'
|
|
|
|
|
|
interface InfoType {
|
|
@@ -21,8 +22,12 @@ interface InfoType {
|
|
|
T_pdf: string
|
|
|
T_remark: string
|
|
|
T_submit: string
|
|
|
- T_submit_name: string
|
|
|
T_type: number
|
|
|
+ T_discount: number
|
|
|
+ T_start_date: string
|
|
|
+ T_end_date: string
|
|
|
+ T_submit_name: string
|
|
|
+ T_project: string
|
|
|
T_no_recoveries_money: number
|
|
|
T_no_invoice_money: number
|
|
|
}
|
|
@@ -30,6 +35,7 @@ interface InfoType {
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
const isSale = ref(false)
|
|
|
+const isVerify = ref(true)
|
|
|
const tableSnData = ref<any[]>([])
|
|
|
const tableData = ref<any[]>([])
|
|
|
const invoiceTableData = ref<any[]>([])
|
|
@@ -37,25 +43,43 @@ const recoveriesTableData = ref<any[]>([])
|
|
|
const info = ref<InfoType | undefined>()
|
|
|
const globalStore = GlobalStore()
|
|
|
const drawerSnRef = ref<InstanceType<typeof Drawer> | null>(null)
|
|
|
-const headerCellStyle = ref({
|
|
|
+const headerCellStyle = shallowRef({
|
|
|
background: '#909399',
|
|
|
height: '50px',
|
|
|
color: '#fff'
|
|
|
})
|
|
|
|
|
|
-const columns = [
|
|
|
+let columns: ColumnProps[] = [
|
|
|
{ type: 'index', label: '序号', width: 80, align: 'center ' },
|
|
|
{ label: '产品图片', prop: 'T_product_img', align: 'center ', name: 'T_product_img' },
|
|
|
{ label: '产品名称', prop: 'T_product_name', align: 'center ' },
|
|
|
{ label: '产品分类', prop: 'T_product_class_name', align: 'center ' },
|
|
|
{ label: '产品型号', prop: 'T_product_model', align: 'center ', name: 'T_product_model' },
|
|
|
{ label: '产品规格', prop: 'T_product_spec', align: 'center ' },
|
|
|
- { label: '是否关联SN', prop: 'T_product_relation_sn', align: 'center ', width: 120, name: 'T_product_relation_sn' },
|
|
|
+ {
|
|
|
+ label: '是否关联SN',
|
|
|
+ prop: 'T_product_relation_sn',
|
|
|
+ align: 'center ',
|
|
|
+ width: 120,
|
|
|
+ name: 'T_product_relation_sn'
|
|
|
+ },
|
|
|
{ label: '数量', prop: 'T_product_total', align: 'center ' },
|
|
|
{ label: '已出库数量', prop: 'T_product_out', align: 'center ' },
|
|
|
{ prop: 'operation', label: '操作', width: 100, fixed: 'right', align: 'center ' }
|
|
|
]
|
|
|
|
|
|
+const VerifyColumns: ColumnProps[] = [
|
|
|
+ { type: 'index', label: '序号', width: 80, align: 'center ' },
|
|
|
+ { label: '产品图片', prop: 'T_product_img', align: 'center ', name: 'T_product_img' },
|
|
|
+ { label: '产品名称', prop: 'T_product_name', align: 'center ' },
|
|
|
+ { label: '产品分类', prop: 'T_product_class_name', align: 'center ' },
|
|
|
+ { label: '产品型号', prop: 'T_product_model', align: 'center ', name: 'T_product_model' },
|
|
|
+ { label: '产品规格', prop: 'T_product_spec', align: 'center ' },
|
|
|
+ { label: '数量', prop: 'T_product_total', align: 'center ' },
|
|
|
+ { label: '单价', prop: 'T_price', align: 'center ' },
|
|
|
+ { label: '总价', prop: 'total', align: 'center ' }
|
|
|
+]
|
|
|
+
|
|
|
const columnsRecoveries = [
|
|
|
{ type: 'index', label: '序号', width: 80, align: 'center ' },
|
|
|
{ label: '回款时间', prop: 'T_date', align: 'center ' },
|
|
@@ -81,6 +105,12 @@ const getStorehouseContractGet = async () => {
|
|
|
tableData.value = T_Product
|
|
|
invoiceTableData.value = T_invoice
|
|
|
recoveriesTableData.value = T_recoveries
|
|
|
+ if (!isVerify.value && T_Product) {
|
|
|
+ tableData.value = T_Product.map((item: any) => {
|
|
|
+ item.total = item.T_product_total * item.T_price
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
const previewPdf = (str: string) => window.open(str)
|
|
@@ -124,10 +154,11 @@ const previewSn = (devicelist: string[]) => {
|
|
|
|
|
|
onMounted(() => {
|
|
|
const { params } = route
|
|
|
- if (params.type === fnMd5('contract')) {
|
|
|
- isSale.value = true
|
|
|
- }
|
|
|
getStorehouseContractGet()
|
|
|
+ params.verify && (isVerify.value = false)
|
|
|
+ params.type === fnMd5('contract') && (isSale.value = true)
|
|
|
+
|
|
|
+ columns = isVerify.value ? columns : VerifyColumns
|
|
|
})
|
|
|
onUnmounted(() => {
|
|
|
isSale.value = false
|
|
@@ -137,7 +168,7 @@ onUnmounted(() => {
|
|
|
<div class="contract-detail">
|
|
|
<div class="info">
|
|
|
<h1>
|
|
|
- 详情 - <span>{{ getState(info?.T_State!, 'T_State') }}</span>
|
|
|
+ 详情<span v-if="isVerify"> - {{ getState(info?.T_State!, 'T_State') }}</span>
|
|
|
</h1>
|
|
|
<el-divider />
|
|
|
<div class="content">
|
|
@@ -147,7 +178,7 @@ onUnmounted(() => {
|
|
|
><span>{{ info?.T_number! }}</span></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>客户名称</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5"
|
|
|
><span>{{ info?.T_customer! }}</span></el-col
|
|
@@ -189,7 +220,7 @@ onUnmounted(() => {
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>业务日期</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
<span>{{ info?.T_date! }}</span></el-col
|
|
@@ -202,15 +233,39 @@ onUnmounted(() => {
|
|
|
<el-text type="danger">{{ info?.T_money! }}¥</el-text>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row v-if="!isVerify">
|
|
|
+ <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>优惠金额</span></el-col>
|
|
|
+ <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
+ <el-text type="danger">{{ info?.T_discount! }}¥</el-text>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="!isVerify">
|
|
|
+ <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>签订时间</span></el-col>
|
|
|
+ <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
+ <span>{{ info?.T_date! }}</span></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="!isVerify">
|
|
|
+ <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>起始时间</span></el-col>
|
|
|
+ <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
+ <span>{{ info?.T_start_date! }}</span></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="!isVerify">
|
|
|
+ <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>终止时间</span></el-col>
|
|
|
+ <el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
+ <span>{{ info?.T_end_date! }}</span></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"> <span>项目</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
- <span>{{ info?.T_money }}</span>
|
|
|
+ <span>{{ info?.T_project }}</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
<!-- 1-未出库 2-已部分出库 3-已全部出库 -->
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"><span>出库状态</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5"
|
|
@@ -218,8 +273,10 @@ onUnmounted(() => {
|
|
|
>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
- <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"><span>经办人</span></el-col>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
+ <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"
|
|
|
+ ><span v-if="isVerify">经办人</span><span v-else>合同负责人</span></el-col
|
|
|
+ >
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5"
|
|
|
><span>{{ info?.T_submit_name! }}</span></el-col
|
|
|
>
|
|
@@ -255,7 +312,7 @@ onUnmounted(() => {
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"><span>未回款金额</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5">
|
|
|
<el-text type="danger">{{ info?.T_no_recoveries_money! }}¥</el-text>
|
|
@@ -270,7 +327,7 @@ onUnmounted(() => {
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isVerify">
|
|
|
<el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="2"><span>未开票金额</span></el-col>
|
|
|
<el-col :xs="11" :sm="9" :md="7" :lg="6" :xl="5"
|
|
|
><el-text type="danger">{{ info?.T_no_invoice_money! }}¥</el-text></el-col
|