|
|
@@ -60,8 +60,7 @@
|
|
|
@blur="discountInputByOrder(form.discountTotalPrice)"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
- </el-input
|
|
|
- >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -84,25 +83,34 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <template v-slot:headerCustomerMark="{ column }">
|
|
|
+ <template v-if="clientEnvironmentId!=4" v-slot:headerCustomerMark="{ column }">
|
|
|
<span class="is-required">{{ column.label }}</span>
|
|
|
</template>
|
|
|
<template v-slot:customerMark="{ row, $index }">
|
|
|
<el-form-item
|
|
|
:prop="'datasource.' + $index + '.customerMark'"
|
|
|
:rules="{
|
|
|
- required: true,
|
|
|
+ required: clientEnvironmentId!=4?true:false,
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
- }">
|
|
|
+ }"
|
|
|
+ >
|
|
|
<el-input v-model="row.customerMark" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:entrustedEnterpriseId="scope">
|
|
|
<el-form-item prop="entrustedEnterpriseId">
|
|
|
- <el-select v-model="scope.row['entrustedEnterpriseId']" clearable filterable>
|
|
|
- <el-option v-for="i in scope.row.entrustedEnterpriseIdList" :key="i.id" :value="i.id"
|
|
|
- :label="i.name"></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row['entrustedEnterpriseId']"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="i in scope.row.entrustedEnterpriseIdList"
|
|
|
+ :key="i.id"
|
|
|
+ :value="i.id"
|
|
|
+ :label="i.name"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -115,7 +123,11 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.productCode'"
|
|
|
>
|
|
|
- <el-input :disabled="isContractId" v-model="scope.row.productCode" disabled></el-input>
|
|
|
+ <el-input
|
|
|
+ :disabled="isContractId"
|
|
|
+ v-model="scope.row.productCode"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:productCategoryName="scope">
|
|
|
@@ -134,7 +146,7 @@
|
|
|
required: pageName == 'businessOpportunity' ? false : true,
|
|
|
pattern: positiveIntegerReg,
|
|
|
message: '请正确输入数量',
|
|
|
- trigger: ['blur','change']
|
|
|
+ trigger: ['blur', 'change']
|
|
|
}"
|
|
|
>
|
|
|
<!-- :prop="'datasource.' + scope.$index + '.totalCount'"
|
|
|
@@ -150,7 +162,7 @@
|
|
|
:disabled="isContractId"
|
|
|
v-model="scope.row.totalCount"
|
|
|
placeholder="请输入"
|
|
|
- @input="changeCount(scope.row,scope.$index)"
|
|
|
+ @input="changeCount(scope.row, scope.$index)"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -162,8 +174,11 @@
|
|
|
</template>
|
|
|
<template
|
|
|
v-slot:headerSingleWeight="{ column }"
|
|
|
- v-if="pageName != 'businessOpportunity'">
|
|
|
- <span :class="{'is-required':pricingWay==2}">{{ column.label }}</span>
|
|
|
+ v-if="pageName != 'businessOpportunity'"
|
|
|
+ >
|
|
|
+ <span :class="{ 'is-required': pricingWay == 2 }">{{
|
|
|
+ column.label
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template v-slot:totalPrice="scope">
|
|
|
<el-form-item
|
|
|
@@ -349,7 +364,11 @@
|
|
|
:showLib="false"
|
|
|
:limit="5"
|
|
|
/>
|
|
|
- <div v-else-if="scope.row.technicalDrawings && scope.row.technicalDrawings?.length">
|
|
|
+ <div
|
|
|
+ v-else-if="
|
|
|
+ scope.row.technicalDrawings && scope.row.technicalDrawings?.length
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-link
|
|
|
v-for="link in scope.row.technicalDrawings"
|
|
|
:key="link.id"
|
|
|
@@ -358,8 +377,7 @@
|
|
|
@click="downloadFile(link)"
|
|
|
>
|
|
|
{{ link.name }}
|
|
|
- </el-link
|
|
|
- >
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -375,7 +393,11 @@
|
|
|
:showLib="false"
|
|
|
:limit="5"
|
|
|
/>
|
|
|
- <div v-else-if="scope.row.customerReqFiles && scope.row.customerReqFiles?.length">
|
|
|
+ <div
|
|
|
+ v-else-if="
|
|
|
+ scope.row.customerReqFiles && scope.row.customerReqFiles?.length
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-link
|
|
|
v-for="link in scope.row.customerReqFiles"
|
|
|
:key="link.id"
|
|
|
@@ -384,8 +406,7 @@
|
|
|
@click="downloadFile(link)"
|
|
|
>
|
|
|
{{ link.name }}
|
|
|
- </el-link
|
|
|
- >
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -406,7 +427,11 @@
|
|
|
:showLib="false"
|
|
|
:limit="5"
|
|
|
/>
|
|
|
- <div v-else-if="scope.row.industryArtFiles && scope.row.industryArtFiles?.length">
|
|
|
+ <div
|
|
|
+ v-else-if="
|
|
|
+ scope.row.industryArtFiles && scope.row.industryArtFiles?.length
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-link
|
|
|
v-for="link in scope.row.industryArtFiles"
|
|
|
:key="link.id"
|
|
|
@@ -415,8 +440,7 @@
|
|
|
@click="downloadFile(link)"
|
|
|
>
|
|
|
{{ link.name }}
|
|
|
- </el-link
|
|
|
- >
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -441,8 +465,7 @@
|
|
|
@click="downloadFile(link)"
|
|
|
>
|
|
|
{{ link.name }}
|
|
|
- </el-link
|
|
|
- >
|
|
|
+ </el-link>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -500,10 +523,10 @@
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
:rules="{
|
|
|
- required: pricingWay==2,
|
|
|
- pattern: numberReg,
|
|
|
- trigger: ['change','blur']
|
|
|
- }"
|
|
|
+ required: pricingWay == 2,
|
|
|
+ pattern: numberReg,
|
|
|
+ trigger: ['change', 'blur']
|
|
|
+ }"
|
|
|
:prop="'datasource.' + scope.$index + '.singleWeight'"
|
|
|
>
|
|
|
<!-- :rules="{
|
|
|
@@ -515,7 +538,7 @@
|
|
|
<el-input
|
|
|
:disabled="isContractId"
|
|
|
v-model="scope.row.singleWeight"
|
|
|
- @input="singleWeightChange(scope.row,scope.$index)"
|
|
|
+ @input="singleWeightChange(scope.row, scope.$index)"
|
|
|
placeholder="请输入"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -537,7 +560,19 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
+ <template v-slot:blockCount="scope">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'datasource.' + scope.$index + '.blockCount'"
|
|
|
+ :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.blockCount"
|
|
|
+ @input="
|
|
|
+ (val) => tableHandleKeyUp(scope.row, scope.$index, 'blockCount')
|
|
|
+ "
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-popconfirm
|
|
|
@@ -546,7 +581,12 @@
|
|
|
@confirm="remove(row)"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
- <el-link type="danger" v-if="!isContractId" :underline="false" icon="el-icon-delete">
|
|
|
+ <el-link
|
|
|
+ type="danger"
|
|
|
+ v-if="!isContractId"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ >
|
|
|
删除
|
|
|
</el-link>
|
|
|
</template>
|
|
|
@@ -567,15 +607,15 @@
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {numberReg, positiveIntegerReg} from 'ele-admin';
|
|
|
+import { numberReg, positiveIntegerReg } from 'ele-admin';
|
|
|
import productList from '@/BIZComponents/product-list.vue';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import headList from '@/BIZComponents/user-select/user-select.vue';
|
|
|
import ProductionVersion from '@/components/ProductionVersion2/index.vue';
|
|
|
-import {getFile} from "@/api/system/file";
|
|
|
-import {getByCode} from "@/api/system/dictionary-data";
|
|
|
-import {contactQueryByCategoryIdsAPI} from "@/api/saleManage/contact";
|
|
|
+import { getFile } from '@/api/system/file';
|
|
|
+import { getByCode } from '@/api/system/dictionary-data';
|
|
|
+import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
|
|
|
|
|
|
const dayjs = require('dayjs');
|
|
|
|
|
|
@@ -585,7 +625,7 @@ export default {
|
|
|
productList,
|
|
|
fileUpload,
|
|
|
headList,
|
|
|
- ProductionVersion,
|
|
|
+ ProductionVersion
|
|
|
},
|
|
|
props: {
|
|
|
pageName: {
|
|
|
@@ -621,8 +661,8 @@ export default {
|
|
|
},
|
|
|
customerMark: {
|
|
|
type: [Number, String],
|
|
|
- default:''
|
|
|
- },
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -645,8 +685,19 @@ export default {
|
|
|
datasource: []
|
|
|
},
|
|
|
rules: {},
|
|
|
- dictList: {},
|
|
|
- columns: [
|
|
|
+ dictList: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ canHandl() {
|
|
|
+ return this.form.datasource.length;
|
|
|
+ },
|
|
|
+ clientEnvironmentId() {
|
|
|
+ console.log(this.$store.state.user.info.clientEnvironmentId,'this.$store.state.user.info.clientEnvironmentId')
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ },
|
|
|
+ columns() {
|
|
|
+ return [
|
|
|
{
|
|
|
width: 45,
|
|
|
type: 'index',
|
|
|
@@ -660,14 +711,14 @@ export default {
|
|
|
label: '名称',
|
|
|
slot: 'productName',
|
|
|
headerSlot: 'headerProductName',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'productCode',
|
|
|
label: '编码',
|
|
|
slot: 'productCode',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -676,14 +727,14 @@ export default {
|
|
|
label: '数量',
|
|
|
slot: 'totalCount',
|
|
|
headerSlot: 'headerTotalCount',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'measuringUnit',
|
|
|
label: '计量单位',
|
|
|
slot: 'measuringUnit',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 100,
|
|
|
@@ -692,19 +743,27 @@ export default {
|
|
|
slot: 'availableCountBase',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'blockCount',
|
|
|
+ label: '块数',
|
|
|
+ slot: 'blockCount',
|
|
|
+ align: 'center',
|
|
|
+ show: this.clientEnvironmentId == '4'
|
|
|
+ },
|
|
|
{
|
|
|
width: 150,
|
|
|
prop: 'singlePrice',
|
|
|
label: '单价',
|
|
|
slot: 'singlePrice',
|
|
|
headerSlot: 'headerSinglePrice',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'discountSinglePrice',
|
|
|
label: '折让单价',
|
|
|
- align: "center",
|
|
|
+ align: 'center',
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
return _row.discountSinglePrice
|
|
|
? Number(_row.discountSinglePrice).toFixed(2)
|
|
|
@@ -716,13 +775,13 @@ export default {
|
|
|
prop: 'totalPrice',
|
|
|
label: '合计',
|
|
|
slot: 'totalPrice',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 100,
|
|
|
prop: 'discountTotalPrice',
|
|
|
label: '折让合计',
|
|
|
- align: "center",
|
|
|
+ align: 'center',
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
return _row.discountTotalPrice
|
|
|
? Number(_row.discountTotalPrice).toFixed(2)
|
|
|
@@ -736,7 +795,7 @@ export default {
|
|
|
slot: 'customerMark',
|
|
|
headerSlot: 'headerCustomerMark',
|
|
|
show: this.isCustomerMark,
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
@@ -744,7 +803,7 @@ export default {
|
|
|
label: '受托企业',
|
|
|
slot: 'entrustedEnterpriseId',
|
|
|
show: this.isCustomerMark,
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 160,
|
|
|
@@ -752,7 +811,7 @@ export default {
|
|
|
label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
|
|
|
slot: 'customerExpectDeliveryDeadline',
|
|
|
headerSlot: 'headerCustomerExpectDeliveryDeadline',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
@@ -760,49 +819,49 @@ export default {
|
|
|
label: '单重',
|
|
|
slot: 'singleWeight',
|
|
|
headerSlot: 'headerSingleWeight',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 100,
|
|
|
prop: 'totalWeight',
|
|
|
label: '总重',
|
|
|
slot: 'totalWeight',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 100,
|
|
|
prop: 'weightUnit',
|
|
|
label: '重量单位',
|
|
|
slot: 'weightUnit',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'productCategoryName',
|
|
|
label: '类型',
|
|
|
slot: 'productCategoryName',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'productBrand',
|
|
|
label: '牌号',
|
|
|
slot: 'productBrand',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'modelType',
|
|
|
label: '型号',
|
|
|
slot: 'modelType',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'specification',
|
|
|
label: '规格',
|
|
|
slot: 'specification',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
@@ -818,7 +877,11 @@ export default {
|
|
|
label: '生产类型',
|
|
|
showOverflowTooltip: true,
|
|
|
formatter: (row, column) => {
|
|
|
- return row.produceType && row.produceType.length ? row.produceType.map(item => this.getDictV('productionType', item + '')).join(',') : ''
|
|
|
+ return row.produceType && row.produceType.length
|
|
|
+ ? row.produceType
|
|
|
+ .map((item) => this.getDictV('productionType', item + ''))
|
|
|
+ .join(',')
|
|
|
+ : '';
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -855,7 +918,7 @@ export default {
|
|
|
label: '生产交付交期',
|
|
|
slot: 'produceDeliveryDeadline',
|
|
|
show: this.contractBookType == 1 ? true : false,
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -863,7 +926,7 @@ export default {
|
|
|
prop: 'guaranteePeriod',
|
|
|
label: '质保期',
|
|
|
slot: 'guaranteePeriod',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 200,
|
|
|
@@ -871,7 +934,7 @@ export default {
|
|
|
label: '质保期截止日期',
|
|
|
slot: 'guaranteePeriodDeadline',
|
|
|
show: this.isGuaranteePeriod,
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
// {
|
|
|
// width: 120,
|
|
|
@@ -884,28 +947,28 @@ export default {
|
|
|
prop: 'customerReqFiles',
|
|
|
label: '客户需求',
|
|
|
slot: 'customerReqFiles',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 130,
|
|
|
prop: 'technicalAnswerName',
|
|
|
label: '技术答疑人',
|
|
|
slot: 'technicalAnswerName',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 220,
|
|
|
prop: 'technicalParams',
|
|
|
label: '技术参数',
|
|
|
slot: 'technicalParams',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 240,
|
|
|
prop: 'technicalDrawings',
|
|
|
label: '技术图纸',
|
|
|
slot: 'technicalDrawings',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 240,
|
|
|
@@ -913,29 +976,28 @@ export default {
|
|
|
label: '工艺路线',
|
|
|
slot: 'technologyRouteName',
|
|
|
show: this.contractBookType == 1 ? true : false,
|
|
|
- align: "center"
|
|
|
-
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 240,
|
|
|
prop: 'industryArtFiles',
|
|
|
label: '工艺附件',
|
|
|
slot: 'industryArtFiles',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 240,
|
|
|
prop: 'otherFiles',
|
|
|
label: '其他附件',
|
|
|
slot: 'otherFiles',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 220,
|
|
|
prop: 'remark',
|
|
|
label: '备注',
|
|
|
slot: 'remark',
|
|
|
- align: "center"
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
@@ -947,12 +1009,7 @@ export default {
|
|
|
fixed: 'right',
|
|
|
showOverflowTooltip: true
|
|
|
}
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- canHandl() {
|
|
|
- return this.form.datasource.length;
|
|
|
+ ];
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -970,36 +1027,54 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getDictList('productionType')
|
|
|
+ this.getDictList('productionType');
|
|
|
},
|
|
|
methods: {
|
|
|
getDictV(code, val) {
|
|
|
if (!this.dictList[code]) return '';
|
|
|
- return this.dictList[code].find(item => item.value == val)?.label
|
|
|
+ return this.dictList[code].find((item) => item.value == val)?.label;
|
|
|
},
|
|
|
async getDictList(code) {
|
|
|
- let {data: res} = await getByCode(code)
|
|
|
- this.dictList[code] = res.map(item => {
|
|
|
- let values = Object.keys(item)
|
|
|
+ let { data: res } = await getByCode(code);
|
|
|
+ this.dictList[code] = res.map((item) => {
|
|
|
+ let values = Object.keys(item);
|
|
|
return {
|
|
|
value: values[0],
|
|
|
label: item[values[0]]
|
|
|
- }
|
|
|
- })
|
|
|
+ };
|
|
|
+ });
|
|
|
},
|
|
|
downloadFile(file) {
|
|
|
- getFile({objectName: file.storePath}, file.name);
|
|
|
+ getFile({ objectName: file.storePath }, file.name);
|
|
|
},
|
|
|
openVersion(index) {
|
|
|
this.$refs.versionRefs.open(index);
|
|
|
},
|
|
|
+ // 表格:模数、数量(方)、块数输入框 输入事件
|
|
|
+ tableHandleKeyUp(row, index, name) {
|
|
|
+ console.log(row, 'row');
|
|
|
+ // && this.clientEnvironmentId == '4'
|
|
|
+ if (row.specification && this.clientEnvironmentId == '4') {
|
|
|
+ let modelArr = row.specification.split('*');
|
|
|
+ let modelLong = modelArr[0]; // model规格长度
|
|
|
+ let modeWide = modelArr[1]; // model规格宽度
|
|
|
+ let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
|
|
|
+ modeHight = Number(modeHight);
|
|
|
+ if (name === 'sum') {
|
|
|
+ row.blockCount = Math.floor(
|
|
|
+ row.totalCount / ((modelLong * modeWide * modeHight) / 1000000)
|
|
|
+ );
|
|
|
+ } else if (name === 'blockCount') {
|
|
|
+ row.totalCount =
|
|
|
+ (Number(row.blockCount) * modelLong * modeWide * modeHight) /
|
|
|
+ 1000000;
|
|
|
+ this.changeCount(row.totalCount, index, 'tableHandleKeyUp');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//工艺路线
|
|
|
changeProduct(data, index) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'technologyRouteName',
|
|
|
- data.name
|
|
|
- );
|
|
|
+ this.$set(this.form.datasource[index], 'technologyRouteName', data.name);
|
|
|
this.$set(this.form.datasource[index], 'technologyRouteId', data.id);
|
|
|
},
|
|
|
setDeliveryDays(row, index, type, isAll) {
|
|
|
@@ -1052,10 +1127,10 @@ export default {
|
|
|
return code == 3
|
|
|
? 'day'
|
|
|
: code == 4
|
|
|
- ? 'month'
|
|
|
- : code == 5
|
|
|
- ? 'year'
|
|
|
- : 'second';
|
|
|
+ ? 'month'
|
|
|
+ : code == 5
|
|
|
+ ? 'year'
|
|
|
+ : 'second';
|
|
|
},
|
|
|
setDay(addDay, dateType = 'day') {
|
|
|
return dayjs(this.contractStartDate || new Date())
|
|
|
@@ -1068,7 +1143,10 @@ export default {
|
|
|
if (comitDatasource.length === 0) return [];
|
|
|
comitDatasource.forEach((v) => {
|
|
|
if (v.guaranteePeriodUnitCode) {
|
|
|
- v.guaranteePeriodUnitName = this.getDictValue('保质期单位', v.guaranteePeriodUnitCode);
|
|
|
+ v.guaranteePeriodUnitName = this.getDictValue(
|
|
|
+ '保质期单位',
|
|
|
+ v.guaranteePeriodUnitCode
|
|
|
+ );
|
|
|
}
|
|
|
v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
|
|
|
v.customerReqFiles = v.customerReqFiles || [];
|
|
|
@@ -1081,46 +1159,61 @@ export default {
|
|
|
return [this.allPrice, this.form.discountTotalPrice];
|
|
|
},
|
|
|
//改变数量
|
|
|
- changeCount(row, index) {
|
|
|
+ changeCount(row, index, type) {
|
|
|
this.singleWeightChange(row, index);
|
|
|
- this.getTotalPrice()
|
|
|
+ this.getTotalPrice();
|
|
|
+ if (type != 'tableHandleKeyUp') {
|
|
|
+ this.tableHandleKeyUp(this.form.datasource[index], index, 'sum');
|
|
|
+ }
|
|
|
},
|
|
|
//计算总金额
|
|
|
getTotalPrice(row) {
|
|
|
if (this.form.datasource.length) {
|
|
|
let sum = 0;
|
|
|
- sum = this.getNumTotalPrice()
|
|
|
+ sum = this.getNumTotalPrice();
|
|
|
let allsum = sum.toFixed(2);
|
|
|
this.allPrice = allsum;
|
|
|
this.form.discountTotalPrice = allsum;
|
|
|
this.$store.commit('concact/setDiscountAmount', allsum);
|
|
|
this.$store.commit('order/setAllcountAmount', allsum);
|
|
|
- this.$emit('orderDiscountAmount', this.allPrice)
|
|
|
- this.$refs.table.reload()
|
|
|
+ this.$emit('orderDiscountAmount', this.allPrice);
|
|
|
+ this.$refs.table.reload();
|
|
|
return allsum;
|
|
|
} else {
|
|
|
this.allPrice = 0.0;
|
|
|
this.form.discountTotalPrice = 0.0;
|
|
|
- this.$emit('orderDiscountAmount', 0)
|
|
|
+ this.$emit('orderDiscountAmount', 0);
|
|
|
return 0.0;
|
|
|
}
|
|
|
},
|
|
|
//计算总金额
|
|
|
getNumTotalPrice(sum = 0) {
|
|
|
this.form.datasource.forEach((r, index) => {
|
|
|
- this.$set(r, 'discountSinglePrice', r.singlePrice ? Number(r.singlePrice) : '')
|
|
|
+ this.$set(
|
|
|
+ r,
|
|
|
+ 'discountSinglePrice',
|
|
|
+ r.singlePrice ? Number(r.singlePrice) : ''
|
|
|
+ );
|
|
|
if (r.singlePrice && r.totalCount) {
|
|
|
r.totalPrice = this.getAllPrice(r);
|
|
|
r.discountTotalPrice = this.getDiscountTotalPrice(r);
|
|
|
- this.$set(this.form.datasource[index], 'totalPrice', Number(r.totalPrice))
|
|
|
- this.$set(this.form.datasource[index], 'discountTotalPrice', Number(r.discountTotalPrice))
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'totalPrice',
|
|
|
+ Number(r.totalPrice)
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'discountTotalPrice',
|
|
|
+ Number(r.discountTotalPrice)
|
|
|
+ );
|
|
|
sum += Number(r.totalPrice);
|
|
|
} else {
|
|
|
- this.$set(r, 'totalPrice', '')
|
|
|
- this.$set(r, 'discountTotalPrice', '')
|
|
|
+ this.$set(r, 'totalPrice', '');
|
|
|
+ this.$set(r, 'discountTotalPrice', '');
|
|
|
}
|
|
|
});
|
|
|
- return isNaN(sum) ? 0 : sum
|
|
|
+ return isNaN(sum) ? 0 : sum;
|
|
|
},
|
|
|
//更新优惠后总金额
|
|
|
discountInput(val) {
|
|
|
@@ -1128,65 +1221,77 @@ export default {
|
|
|
},
|
|
|
//设置优惠后总金额修改产品单价
|
|
|
discountInputByOrder(val) {
|
|
|
- this.form.discountTotalPrice = val
|
|
|
+ this.form.discountTotalPrice = val;
|
|
|
//获取优惠金额和总计的差价
|
|
|
this.form.datasource.forEach((item) => {
|
|
|
if (val === 0) {
|
|
|
- item.discountTotalPrice = 0
|
|
|
- item.discountSinglePrice = 0
|
|
|
- return
|
|
|
+ item.discountTotalPrice = 0;
|
|
|
+ item.discountSinglePrice = 0;
|
|
|
+ return;
|
|
|
}
|
|
|
if (!val) {
|
|
|
- item.discountTotalPrice = item.totalPrice
|
|
|
- item.discountSinglePrice = item.singlePrice
|
|
|
- return
|
|
|
+ item.discountTotalPrice = item.totalPrice;
|
|
|
+ item.discountSinglePrice = item.singlePrice;
|
|
|
+ return;
|
|
|
}
|
|
|
//获取折让单价
|
|
|
- item.discountSinglePrice = this.getDiscountSinglePrice(item)
|
|
|
- item.discountTotalPrice = this.getDiscountTotalPrice(item)
|
|
|
- })
|
|
|
- this.$refs.table.reload()
|
|
|
+ item.discountSinglePrice = this.getDiscountSinglePrice(item);
|
|
|
+ item.discountTotalPrice = this.getDiscountTotalPrice(item);
|
|
|
+ });
|
|
|
+ this.$refs.table.reload();
|
|
|
this.$store.commit('concact/setDiscountAmount', val);
|
|
|
},
|
|
|
//获取折让单价
|
|
|
getDiscountSinglePrice(row) {
|
|
|
- let num = Number(this.form.discountTotalPrice) / Number(this.allPrice) * Number(row.singlePrice)
|
|
|
- return isNaN(num) ? '' : num
|
|
|
+ let num =
|
|
|
+ (Number(this.form.discountTotalPrice) / Number(this.allPrice)) *
|
|
|
+ Number(row.singlePrice);
|
|
|
+ return isNaN(num) ? '' : num;
|
|
|
},
|
|
|
//获取合计
|
|
|
getAllPrice(row) {
|
|
|
- let num = 0
|
|
|
+ let num = 0;
|
|
|
switch (this.pricingWay) {
|
|
|
case 1: //按数量计价计算总金额
|
|
|
- num = Number(row.singlePrice) * Number(row.totalCount)
|
|
|
+ num = Number(row.singlePrice) * Number(row.totalCount);
|
|
|
break;
|
|
|
- case 2 ://按重量计价计算总金额
|
|
|
- num = Number(row.singlePrice) * Number(row.totalCount) * Number(row.singleWeight)
|
|
|
+ case 2: //按重量计价计算总金额
|
|
|
+ num =
|
|
|
+ Number(row.singlePrice) *
|
|
|
+ Number(row.totalCount) *
|
|
|
+ Number(row.singleWeight);
|
|
|
break;
|
|
|
}
|
|
|
- return isNaN(num) ? '' : num.toFixed(2)
|
|
|
+ return isNaN(num) ? '' : num.toFixed(2);
|
|
|
},
|
|
|
//获取折让合计
|
|
|
getDiscountTotalPrice(row) {
|
|
|
- let num = 0
|
|
|
+ let num = 0;
|
|
|
switch (this.pricingWay) {
|
|
|
case 1: //按数量计价计算折让合计
|
|
|
- num = Number(row.discountSinglePrice) * Number(row.totalCount)
|
|
|
+ num = Number(row.discountSinglePrice) * Number(row.totalCount);
|
|
|
break;
|
|
|
- case 2 ://按重量计价计算折让合计
|
|
|
- num = Number(row.discountSinglePrice) * Number(row.totalCount) * Number(row.singleWeight)
|
|
|
+ case 2: //按重量计价计算折让合计
|
|
|
+ num =
|
|
|
+ Number(row.discountSinglePrice) *
|
|
|
+ Number(row.totalCount) *
|
|
|
+ Number(row.singleWeight);
|
|
|
break;
|
|
|
}
|
|
|
- return isNaN(num) ? '' : num.toFixed(2)
|
|
|
+ return isNaN(num) ? '' : num.toFixed(2);
|
|
|
},
|
|
|
//修改回显
|
|
|
async putTableValue(data) {
|
|
|
let productList =
|
|
|
- (data && (data.quoteProductList || data.productList || data.detailList)) || [];
|
|
|
+ (data &&
|
|
|
+ (data.quoteProductList || data.productList || data.detailList)) ||
|
|
|
+ [];
|
|
|
if (productList) {
|
|
|
- let supplierObj = await this.getSupplierObj(productList, 'productId')
|
|
|
+ let supplierObj = await this.getSupplierObj(productList, 'productId');
|
|
|
productList.forEach((item) => {
|
|
|
- item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode ? item.guaranteePeriodUnitCode + '' : '';
|
|
|
+ item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
|
|
|
+ ? item.guaranteePeriodUnitCode + ''
|
|
|
+ : '';
|
|
|
// if (item.deliveryDays) {
|
|
|
// item['deliveryDeadline'] =
|
|
|
// item['deliveryDeadline'] || this.setDay(item.deliveryDays);
|
|
|
@@ -1210,7 +1315,6 @@ export default {
|
|
|
this.allPrice = data?.contractVO?.totalPrice;
|
|
|
// this.getTotalPrice();
|
|
|
|
|
|
-
|
|
|
this.form.discountTotalPrice = data?.contractVO?.discountTotalPrice;
|
|
|
|
|
|
// this.discountInput(data?.contractVO?.discountTotalPrice);
|
|
|
@@ -1218,23 +1322,26 @@ export default {
|
|
|
},
|
|
|
async getSupplierObj(productList, queryName) {
|
|
|
try {
|
|
|
- let categoryIds = productList.map(item => item[queryName])
|
|
|
- return await contactQueryByCategoryIdsAPI({categoryIds, isQueryEE: 1})
|
|
|
+ let categoryIds = productList.map((item) => item[queryName]);
|
|
|
+ return await contactQueryByCategoryIdsAPI({
|
|
|
+ categoryIds,
|
|
|
+ isQueryEE: 1
|
|
|
+ });
|
|
|
} catch (e) {
|
|
|
return Promise.resolve({});
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
//修改订单未选择合同时回显
|
|
|
async putTableValueByOrder(row) {
|
|
|
- let data = {...row}
|
|
|
- let productList =
|
|
|
- (data && data.productList) || [];
|
|
|
+ let data = { ...row };
|
|
|
+ let productList = (data && data.productList) || [];
|
|
|
|
|
|
if (productList) {
|
|
|
- let supplierObj = await this.getSupplierObj(productList, 'productId')
|
|
|
+ let supplierObj = await this.getSupplierObj(productList, 'productId');
|
|
|
productList.forEach((item) => {
|
|
|
- item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode ? item.guaranteePeriodUnitCode + '' : '';
|
|
|
+ item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
|
|
|
+ ? item.guaranteePeriodUnitCode + ''
|
|
|
+ : '';
|
|
|
// if (item.deliveryDays) {
|
|
|
// item['deliveryDeadline'] =
|
|
|
// item['deliveryDeadline'] || this.setDay(item.deliveryDays);
|
|
|
@@ -1260,12 +1367,12 @@ export default {
|
|
|
singleWeightChange(row, index) {
|
|
|
if (row && row.singleWeight && row.totalCount) {
|
|
|
row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
|
|
|
- this.$set(this.form.datasource[index], 'totalWeight', row.totalWeight)
|
|
|
+ this.$set(this.form.datasource[index], 'totalWeight', row.totalWeight);
|
|
|
} else {
|
|
|
- this.$set(this.form.datasource[index], 'totalWeight', '')
|
|
|
+ this.$set(this.form.datasource[index], 'totalWeight', '');
|
|
|
}
|
|
|
if (this.pricingWay == 2) {
|
|
|
- this.getTotalPrice(row)
|
|
|
+ this.getTotalPrice(row);
|
|
|
}
|
|
|
},
|
|
|
//选择产品
|
|
|
@@ -1288,7 +1395,7 @@ export default {
|
|
|
},
|
|
|
//选择产品回调
|
|
|
async changeParent(obj, idx) {
|
|
|
- let supplierObj = await this.getSupplierObj(obj, 'id')
|
|
|
+ let supplierObj = await this.getSupplierObj(obj, 'id');
|
|
|
obj.forEach((item, index) => {
|
|
|
let i = idx == -1 ? index : idx;
|
|
|
let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
@@ -1296,7 +1403,11 @@ export default {
|
|
|
let params = idx == -1 ? row : this.form.datasource[i];
|
|
|
|
|
|
if (supplierObj[item.id]?.length === 1) {
|
|
|
- this.$set(params, 'entrustedEnterpriseId', supplierObj[item.id][0].id);
|
|
|
+ this.$set(
|
|
|
+ params,
|
|
|
+ 'entrustedEnterpriseId',
|
|
|
+ supplierObj[item.id][0].id
|
|
|
+ );
|
|
|
}
|
|
|
this.$set(params, 'entrustedEnterpriseIdList', supplierObj[item.id]);
|
|
|
this.$set(params, 'productId', item.id);
|
|
|
@@ -1315,7 +1426,11 @@ export default {
|
|
|
this.$set(params, 'produceType', item.produceType);
|
|
|
this.$set(params, 'productionDays', item.productionDays);
|
|
|
this.$set(params, 'approvalNumber', item.extField.approvalNumber);
|
|
|
- this.$set(params, 'packingSpecification', item.extField.packingSpecification);
|
|
|
+ this.$set(
|
|
|
+ params,
|
|
|
+ 'packingSpecification',
|
|
|
+ item.extField.packingSpecification
|
|
|
+ );
|
|
|
this.$set(params, 'customerMark', this.customerMark || '');
|
|
|
if (idx == -1) {
|
|
|
this.form.datasource.push(row);
|