|
|
@@ -1,21 +1,23 @@
|
|
|
<template>
|
|
|
<el-form ref="form" :model="form" :rules="rules">
|
|
|
- <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource"
|
|
|
+ <ele-pro-table ref="table" :needPage="false" :columns="columns" :toolkit="[]" :datasource="form.datasource"
|
|
|
cache-key="systemRoleTable17" class="time-form">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd"
|
|
|
- :disabled="canHandl ? true : false">
|
|
|
+ <div class="headbox">
|
|
|
+ <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
|
|
|
新增
|
|
|
</el-button>
|
|
|
+ <span class="amount">总计:{{getTotalPrice()}}元</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- <template v-slot:productName="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + scope.$index + '.productName'" :rules="{
|
|
|
+ <template v-slot:productName="{ row, $index }">
|
|
|
+ <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + $index + '.productName'" :rules="{
|
|
|
required: true,
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.productName" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="row.productName" placeholder="请输入" @click.native="handParent(row, $index)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:productCode="scope">
|
|
|
@@ -24,7 +26,7 @@
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.productCode" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.productCode" disabled placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:productCategoryName="scope">
|
|
|
@@ -33,89 +35,70 @@
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.productCategoryName" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.productCategoryName" disabled placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:totalCount="scope">
|
|
|
<el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.totalCount'" :rules="{
|
|
|
required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
+ pattern:numberReg,
|
|
|
+ message: '请输入数字',
|
|
|
+ trigger: 'blur'
|
|
|
}">
|
|
|
<el-input v-model="scope.row.totalCount" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:totalPrice="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.totalPrice'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
- <el-input v-model="scope.row.totalPrice" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.totalPrice'" >
|
|
|
+ {{(scope.row.totalCount*scope.row.singlePrice||0).toFixed(2)}}元
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:productBrand="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.productBrand'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
- <el-input v-model="scope.row.productBrand" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.productBrand'">
|
|
|
+ <el-input v-model="scope.row.productBrand" disabled placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:modelType="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.modelType'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
- <el-input v-model="scope.row.modelType" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.modelType'" >
|
|
|
+ <el-input v-model="scope.row.modelType" disabled placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:specification="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.specification'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
- <el-input v-model="scope.row.specification" placeholder="请输入"></el-input>
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.specification'" >
|
|
|
+ <el-input v-model="scope.row.specification" disabled placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:deliveryDays="scope">
|
|
|
<el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.deliveryDays'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
+ pattern:numberReg,
|
|
|
+ message: '请输入数字',
|
|
|
+ trigger: 'blur'
|
|
|
}">
|
|
|
<el-input v-model="scope.row.deliveryDays" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:guaranteePeriod="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.guaranteePeriod'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
+ <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" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="borderrightnone">
|
|
|
+ <DictSelection dictName="质保期单位" clearable v-model="scope.row.guaranteePeriodUnitCode">
|
|
|
+ </DictSelection>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- <template v-slot:guaranteePeriodUnitCode="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.guaranteePeriodUnitCode'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
- <el-input v-model="scope.row.guaranteePeriodUnitCode" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
+ <!-- <template v-slot:guaranteePeriodUnitCode="scope"> </template> -->
|
|
|
<template v-slot:measuringUnit="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.measuringUnit'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }">
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.measuringUnit'">
|
|
|
<el-input v-model="scope.row.measuringUnit" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -125,25 +108,28 @@
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.remark" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.remark" type="textarea" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:singlePrice="scope">
|
|
|
<el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.singlePrice'" :rules="{
|
|
|
required: true,
|
|
|
- message: '请输入',
|
|
|
+ pattern:numberReg,
|
|
|
+ message: '请输入正确的单价',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.singlePrice" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="scope.row.singlePrice" placeholder="请输入">
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <template v-slot:technicalAnswerName="scope">
|
|
|
- <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.technicalAnswerName'" :rules="{
|
|
|
+ <template v-slot:technicalAnswerName="{ row, $index }">
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + $index + '.technicalAnswerName'" :rules="{
|
|
|
required: true,
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
}">
|
|
|
- <el-input v-model="scope.row.technicalAnswerName" placeholder="请输入"></el-input>
|
|
|
+ <el-input v-model="row.technicalAnswerName" placeholder="请输入" @click.native="handHead(row, $index)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-slot:technicalParams="scope">
|
|
|
@@ -155,6 +141,21 @@
|
|
|
<el-input v-model="scope.row.technicalParams" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
+ <template v-slot:technicalDrawings="scope">
|
|
|
+ <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.technicalDrawings'" :rules="{
|
|
|
+ required: false,
|
|
|
+ message: '请输入',
|
|
|
+ trigger: 'change'
|
|
|
+ }">
|
|
|
+ <fileUpload
|
|
|
+ v-model="scope.row.technicalDrawings"
|
|
|
+ module="main"
|
|
|
+ :showLib="false"
|
|
|
+ :limit="5"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
|
|
|
|
|
|
<template v-slot:workHour="scope">
|
|
|
@@ -162,30 +163,32 @@
|
|
|
</template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-popconfirm class="ele-action" title="确定要删除此工作时间段吗?" @confirm="remove(row)">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
删除
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
-
|
|
|
- <!-- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- v-if="!row.isLeader"
|
|
|
- @click="setFirst(row)"
|
|
|
- >
|
|
|
- 设为首班
|
|
|
- </el-link> -->
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
- <!-- <el-button @click="verification">ada</el-button> -->
|
|
|
+ <product-list ref="productListRef" classType="1" @changeParent="changeParent"></product-list>
|
|
|
+ <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { emailReg, phoneReg,numberReg } from 'ele-admin';
|
|
|
+import productList from './product-list.vue'
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import fileUpload from '@/components/upload/fileUpload';
|
|
|
+import headList from '@/views/saleManage/businessOpportunity/components/headList.vue'
|
|
|
export default {
|
|
|
-
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ productList,
|
|
|
+ fileUpload,
|
|
|
+ headList
|
|
|
+ },
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
key: null,
|
|
|
@@ -196,6 +199,7 @@ export default {
|
|
|
workHour: ''
|
|
|
};
|
|
|
return {
|
|
|
+ numberReg,
|
|
|
defaultForm,
|
|
|
form: {
|
|
|
datasource: []
|
|
|
@@ -210,39 +214,27 @@ export default {
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- width: 120,
|
|
|
+ width: 200,
|
|
|
prop: 'productName',
|
|
|
- label: '产品名称',
|
|
|
+ label: '名称',
|
|
|
slot: 'productName'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
prop: 'productCode',
|
|
|
- label: '产品编号',
|
|
|
+ label: '编码',
|
|
|
slot: 'productCode'
|
|
|
},
|
|
|
{
|
|
|
- width: 120,
|
|
|
+ width: 200,
|
|
|
prop: 'productCategoryName',
|
|
|
- label: '产品分类',
|
|
|
+ label: '类型',
|
|
|
slot: 'productCategoryName'
|
|
|
},
|
|
|
{
|
|
|
- width: 120,
|
|
|
- prop: 'totalCount',
|
|
|
- label: '数量',
|
|
|
- slot: 'totalCount'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'totalPrice',
|
|
|
- label: '产品销售总金额',
|
|
|
- slot: 'totalPrice'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
+ width: 160,
|
|
|
prop: 'productBrand',
|
|
|
- label: '产品品牌',
|
|
|
+ label: '牌号',
|
|
|
slot: 'productBrand'
|
|
|
},
|
|
|
{
|
|
|
@@ -257,23 +249,18 @@ export default {
|
|
|
label: '规格',
|
|
|
slot: 'specification'
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
- width: 120,
|
|
|
- prop: 'deliveryDays',
|
|
|
- label: '交期(天)',
|
|
|
- slot: 'deliveryDays'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'guaranteePeriod',
|
|
|
- label: '质保期',
|
|
|
- slot: 'guaranteePeriod'
|
|
|
+ width: 160,
|
|
|
+ prop: 'singlePrice',
|
|
|
+ label: '单价',
|
|
|
+ slot: 'singlePrice'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
- prop: 'guaranteePeriodUnitCode',
|
|
|
- label: '质保期单位名称',
|
|
|
- slot: 'guaranteePeriodUnitCode'
|
|
|
+ prop: 'totalCount',
|
|
|
+ label: '数量',
|
|
|
+ slot: 'totalCount'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
@@ -283,29 +270,52 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
- slot: 'remark'
|
|
|
+ prop: 'totalPrice',
|
|
|
+ label: '合计',
|
|
|
+ slot: 'totalPrice'
|
|
|
},
|
|
|
{
|
|
|
width: 120,
|
|
|
- prop: 'singlePrice',
|
|
|
- label: '销售单价',
|
|
|
- slot: 'singlePrice'
|
|
|
+ prop: 'deliveryDays',
|
|
|
+ label: '交期(天)',
|
|
|
+ slot: 'deliveryDays'
|
|
|
},
|
|
|
{
|
|
|
+ width: 200,
|
|
|
+ prop: 'guaranteePeriod',
|
|
|
+ label: '质保期',
|
|
|
+ slot: 'guaranteePeriod'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // width: 120,
|
|
|
+ // prop: 'guaranteePeriodUnitCode',
|
|
|
+ // label: '',
|
|
|
+ // slot: 'guaranteePeriodUnitCode'
|
|
|
+ // },
|
|
|
+ {
|
|
|
width: 120,
|
|
|
prop: 'technicalAnswerName',
|
|
|
- label: '技术答疑人名称',
|
|
|
+ label: '技术答疑人',
|
|
|
slot: 'technicalAnswerName'
|
|
|
},
|
|
|
{
|
|
|
- width: 120,
|
|
|
+ width: 220,
|
|
|
prop: 'technicalParams',
|
|
|
label: '技术参数',
|
|
|
slot: 'technicalParams'
|
|
|
},
|
|
|
-
|
|
|
+ {
|
|
|
+ width:240,
|
|
|
+ prop: 'technicalDrawings',
|
|
|
+ label: '技术图纸',
|
|
|
+ slot: 'technicalDrawings'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ slot: 'remark'
|
|
|
+ },
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
@@ -322,9 +332,75 @@ export default {
|
|
|
computed: {
|
|
|
canHandl() {
|
|
|
return this.form.datasource.length;
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 返回列表数据
|
|
|
+ getTableValue(){
|
|
|
+ let comitDatasource=this.form.datasource
|
|
|
+ if(comitDatasource.length===0) return []
|
|
|
+ comitDatasource.forEach(v=>{
|
|
|
+ v.totalPrice=(v.totalCount*v.singlePrice)?.toFixed(2)||0
|
|
|
+ v.guaranteePeriodUnitName=this.getDictValue('质保期单位', v.guaranteePeriodUnitCode)
|
|
|
+ })
|
|
|
+ return comitDatasource
|
|
|
+ },
|
|
|
+ //计算总金额
|
|
|
+ getTotalPrice(){
|
|
|
+ if(this.form.datasource.length){
|
|
|
+ let datasource=this.form.datasource,sum=0
|
|
|
+ datasource.forEach(r=>{
|
|
|
+ if(r.singlePrice&&r.totalCount){
|
|
|
+ sum+=r.singlePrice*r.totalCount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return sum.toFixed(2)
|
|
|
+ }else{
|
|
|
+ return 0.00
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //修改回显
|
|
|
+ putTableValue(data){
|
|
|
+ if(data&&data?.length){
|
|
|
+ this.form.datasource=data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择产品
|
|
|
+ handParent(row,index) {
|
|
|
+ let item={
|
|
|
+ id:row.productCode
|
|
|
+ }
|
|
|
+ this.$refs.productListRef.open(item,index)
|
|
|
+ },
|
|
|
+//选择技术人回调
|
|
|
+changeAnswer(obj,idx) {
|
|
|
+ this.$set( this.form.datasource[idx], 'technicalAnswerId', obj.id)
|
|
|
+ this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name)
|
|
|
+ },
|
|
|
+ handHead(row,index){
|
|
|
+ let item={
|
|
|
+ id:row.technicalAnswerId
|
|
|
+ }
|
|
|
+ this.$refs.headRef.open(item,index)
|
|
|
+ },
|
|
|
+ //选择产品回调
|
|
|
+ changeParent(obj,idx) {
|
|
|
+ console.log(obj,'33333')
|
|
|
+
|
|
|
+ this.$set(this.form.datasource[idx], 'categoryName', obj.name)
|
|
|
+ this.$set(this.form.datasource[idx], 'productCategoryId', obj.categoryLevelId)
|
|
|
+ this.$set(this.form.datasource[idx], 'productBrand', obj.brandNum)
|
|
|
+ this.$set(this.form.datasource[idx], 'productCategoryName', obj.categoryLevelPath)
|
|
|
+ this.$set(this.form.datasource[idx], 'productCode', obj.code)
|
|
|
+ this.$set(this.form.datasource[idx], 'productName', obj.name)
|
|
|
+ this.$set(this.form.datasource[idx], 'modelType', obj.modelType)
|
|
|
+ this.$set(this.form.datasource[idx], 'measuringUnit', obj.measuringUnit)
|
|
|
+ this.$set(this.form.datasource[idx], 'specification', obj.specification)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
remove(row) {
|
|
|
let index = this.form.datasource.findIndex((n) => n.key == row.key);
|
|
|
if (index !== -1) {
|
|
|
@@ -384,66 +460,45 @@ export default {
|
|
|
this.$emit('timeAll', this.gettimeAll());
|
|
|
return result;
|
|
|
},
|
|
|
- // 获取工作日时常
|
|
|
- gettimeAll() {
|
|
|
- let result = 0;
|
|
|
- this.form.datasource.forEach((n) => {
|
|
|
- result += n.workHour;
|
|
|
- });
|
|
|
- return result;
|
|
|
- },
|
|
|
- verification() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
+
|
|
|
+ validateForm (callback) {
|
|
|
+ //开始表单校验
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- reject();
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (this.isOverlap()) {
|
|
|
- reject();
|
|
|
- return false;
|
|
|
- }
|
|
|
- resolve();
|
|
|
+ callback(valid);
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- // 判断时间段是否重叠
|
|
|
- isOverlap() {
|
|
|
- let timeRanges = JSON.parse(JSON.stringify(this.form.datasource));
|
|
|
-
|
|
|
- // 按开始时间排序
|
|
|
- timeRanges.sort(function (a, b) {
|
|
|
- return (
|
|
|
- new Date(`1970-01-01 ${a.startTime}`) -
|
|
|
- new Date(`1970-01-01 ${b.startTime}`)
|
|
|
- );
|
|
|
- });
|
|
|
- console.log(timeRanges);
|
|
|
- for (var i = 0; i < timeRanges.length - 1; i++) {
|
|
|
- let endTime = timeRanges[i].endTime;
|
|
|
- let NstartTime = timeRanges[i + 1].startTime;
|
|
|
- if (endTime > NstartTime) {
|
|
|
- // 出现重叠
|
|
|
- this.$message.error(
|
|
|
- `上班时间${NstartTime}与下班时间${endTime}存在重叠`
|
|
|
- );
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- },
|
|
|
- changeStartTime(val) {
|
|
|
- this.isOverlap();
|
|
|
- },
|
|
|
- changeEndTime(val) {
|
|
|
- this.isOverlap();
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.headbox{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .amount{
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+}
|
|
|
.time-form .el-form-item {
|
|
|
margin-bottom: 0 !important;
|
|
|
}
|
|
|
+
|
|
|
+::v-deep .period{
|
|
|
+display: flex;
|
|
|
+.borderleftnone{
|
|
|
+ .el-input--medium .el-input__inner{
|
|
|
+ border-top-right-radius: 0;
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.borderrightnone{
|
|
|
+ .el-input--medium .el-input__inner{
|
|
|
+ border-top-left-radius: 0;
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+}
|
|
|
</style>
|