|
|
@@ -23,7 +23,10 @@
|
|
|
>
|
|
|
新增
|
|
|
</el-button>
|
|
|
- <warehouseAll @success="warehouseAllChange" :disabled="!selection.length"></warehouseAll>
|
|
|
+ <warehouseAll
|
|
|
+ @success="warehouseAllChange"
|
|
|
+ :disabled="!selection.length"
|
|
|
+ ></warehouseAll>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:technicalDrawings="{ row, $index }">
|
|
|
@@ -64,10 +67,20 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.batchNo'"
|
|
|
>
|
|
|
- <el-input v-model="scope.row.batchNo" type="number"></el-input>
|
|
|
+ <el-input v-model="scope.row.batchNo" v-no-chinese></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:productionDate="scope">
|
|
|
+ <el-form-item :prop="'datasource.' + scope.$index + '.productionDate'">
|
|
|
+ <el-date-picker
|
|
|
+ style="width: 140px"
|
|
|
+ v-model="scope.row.productionDate"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
<!-- :disabled="!outsourceSendCode" -->
|
|
|
<template v-slot:sendTotalWeight="scope">
|
|
|
<el-form-item
|
|
|
@@ -171,7 +184,53 @@
|
|
|
>{{ column.label }}</span
|
|
|
>
|
|
|
</template>
|
|
|
-
|
|
|
+ <template v-slot:guaranteePeriod="scope">
|
|
|
+ <div class="period">
|
|
|
+ <div class="borderleftnone">
|
|
|
+ <el-form-item
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ :prop="'datasource.' + scope.$index + '.guaranteePeriod'"
|
|
|
+ :rules="{
|
|
|
+ pattern: numberReg,
|
|
|
+ message: '请输入数字',
|
|
|
+ trigger: 'blur'
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.guaranteePeriod"
|
|
|
+ @change="
|
|
|
+ setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
|
|
|
+ "
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="borderrightnone">
|
|
|
+ <DictSelection
|
|
|
+ dictName="质保期单位"
|
|
|
+ clearable
|
|
|
+ v-model="scope.row.guaranteePeriodUnitCode"
|
|
|
+ @change="
|
|
|
+ setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ </DictSelection>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:guaranteePeriodDeadline="scope">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'datasource.' + scope.$index + '.guaranteePeriodDeadline'"
|
|
|
+ >
|
|
|
+ <el-date-picker
|
|
|
+ style="width: 140px"
|
|
|
+ v-model="scope.row.guaranteePeriodDeadline"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="scope">
|
|
|
<el-popconfirm
|
|
|
@@ -249,6 +308,7 @@
|
|
|
import productListMain from '@/BIZComponents/product-list.vue';
|
|
|
import warehouseAll from '@/BIZComponents/warehouseAll.vue';
|
|
|
import { levelList } from '@/enum/dict.js';
|
|
|
+ const dayjs = require('dayjs');
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins, tabMixins],
|
|
|
@@ -571,13 +631,14 @@
|
|
|
: '';
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // width: 80,
|
|
|
- // prop: 'deliveryDays',
|
|
|
- // label: '交期(天)',
|
|
|
- // slot: 'deliveryDays',
|
|
|
- // align: 'center'
|
|
|
- // },
|
|
|
+ {
|
|
|
+ prop: 'productionDate',
|
|
|
+ label: '生产日期',
|
|
|
+ slot: 'productionDate',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
{
|
|
|
width: 160,
|
|
|
prop: 'deliveryDeadline',
|
|
|
@@ -586,21 +647,24 @@
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- width: 200,
|
|
|
+ width: 250,
|
|
|
prop: 'guaranteePeriod',
|
|
|
label: '有效期',
|
|
|
slot: 'guaranteePeriod',
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- let name = '';
|
|
|
- if (_row.guaranteePeriod) {
|
|
|
- name += _row.guaranteePeriod;
|
|
|
- }
|
|
|
- if (_row.guaranteePeriodUnitName) {
|
|
|
- name += _row.guaranteePeriodUnitName;
|
|
|
- }
|
|
|
- return name || '';
|
|
|
- },
|
|
|
align: 'center'
|
|
|
+
|
|
|
+ // formatter: (_row, _column, cellValue) => {
|
|
|
+ // let name = '';
|
|
|
+ // if (_row.guaranteePeriod) {
|
|
|
+ // name += _row.guaranteePeriod;
|
|
|
+ // }
|
|
|
+ // if (_row.guaranteePeriodUnitName) {
|
|
|
+ // name += _row.guaranteePeriodUnitName;
|
|
|
+ // }
|
|
|
+ // return name || '';
|
|
|
+ // },
|
|
|
+ // align: 'center'
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
width: 160,
|
|
|
@@ -681,7 +745,7 @@
|
|
|
this.$set(this.form.datasource[index], 'warehouseId', data.id);
|
|
|
},
|
|
|
warehouseAllChange(data) {
|
|
|
- console.log(this.selection,'this.selection')
|
|
|
+ console.log(this.selection, 'this.selection');
|
|
|
let keyS = this.selection.map((item) => item.key - 1);
|
|
|
keyS.forEach((key) => {
|
|
|
this.$set(this.form.datasource[key], 'warehouseName', data.name);
|
|
|
@@ -886,7 +950,46 @@
|
|
|
getPrice() {
|
|
|
return [this.allPrice];
|
|
|
},
|
|
|
-
|
|
|
+ setDeliveryDays(row, index, type) {
|
|
|
+ if (type == 'deliveryDays') {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'deliveryDeadline',
|
|
|
+ this.setDay(row.deliveryDays)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (type == 'guaranteePeriod') {
|
|
|
+ let guaranteePeriodUnitName = this.guaranteePeriodUnit(
|
|
|
+ row.guaranteePeriodUnitCode
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'guaranteePeriodUnitName',
|
|
|
+ guaranteePeriodUnitName
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'guaranteePeriodDeadline',
|
|
|
+ guaranteePeriodUnitName != 'second'
|
|
|
+ ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName)
|
|
|
+ : ''
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ guaranteePeriodUnit(code) {
|
|
|
+ return code == 3
|
|
|
+ ? 'day'
|
|
|
+ : code == 4
|
|
|
+ ? 'month'
|
|
|
+ : code == 5
|
|
|
+ ? 'year'
|
|
|
+ : 'second';
|
|
|
+ },
|
|
|
+ setDay(addDay, dateType = 'day') {
|
|
|
+ return dayjs(this.contractStartDate || new Date())
|
|
|
+ .add(addDay, dateType)
|
|
|
+ .format('YYYY-MM-DD');
|
|
|
+ },
|
|
|
//修改回显
|
|
|
async putTableValue(data = [], code) {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -898,7 +1001,10 @@
|
|
|
};
|
|
|
});
|
|
|
this.form.datasource.forEach((item, index) => {
|
|
|
- item.key = index+1
|
|
|
+ item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
|
|
|
+ ? item.guaranteePeriodUnitCode + ''
|
|
|
+ : '';
|
|
|
+ item.key = index + 1;
|
|
|
this.init(item, index);
|
|
|
this.getTotalPrice(index);
|
|
|
});
|