销售订单审批
This commit is contained in:
parent
cf5b0c3ca2
commit
bde3b5fc0d
@ -119,6 +119,15 @@ public class ExampleOrderServiceImpl extends ServiceImpl<ExampleOrderMapper, Exa
|
||||
id = form.getId();
|
||||
}
|
||||
//主表字段验证
|
||||
ExampleOrderEntity order = this.getInfo(id);
|
||||
if (order == null) {
|
||||
return "该销售订单不存在,请确认!";
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(form.getOrdStatus()) &&
|
||||
("3".equals(form.getOrdStatus()) || "5".equals(form.getOrdStatus())) &&
|
||||
!"2".equals(order.getOrdStatus())) {
|
||||
return "该销售订单状态不是已送审,请刷新界面!";
|
||||
}
|
||||
|
||||
return countRecover;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ public class OrderDetailController {
|
||||
OrderDetailEntity byId = orderDetailService.getById(id);
|
||||
// 对象存在判断
|
||||
if (ObjectUtil.isNotEmpty(byId )) {
|
||||
if (!"1".equals(byId.getOrdItemStatus())) return ActionResult.fail("该产品已转生产订单不允许删除,请确认!");
|
||||
if (!"0".equals(byId.getOrdItemStatus())) return ActionResult.fail("该产品已转生产订单不允许删除,请确认!");
|
||||
orderDetailService.removeById(id);
|
||||
return ActionResult.success("删除成功");
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6" >
|
||||
<jnpf-form-tip-item label="订单类型" prop="ordType">
|
||||
<JnpfSelect v-model="dataForm.ordType" placeholder="请选择" filterable :disabled="isDetail=='detail' || isDetail=='change'"
|
||||
<JnpfSelect v-model="dataForm.ordType" placeholder="请选择" filterable :disabled="isDetail=='detail' || isDetail=='change'||dataForm.id "
|
||||
:style='{ "width": "100%" }' :options="ordTypeOptions"
|
||||
:props="ordTypeProps">
|
||||
</JnpfSelect>
|
||||
@ -130,7 +130,7 @@
|
||||
<el-col :span="6" >
|
||||
<jnpf-form-tip-item label="是否变更" prop="isChange">
|
||||
<JnpfRadio v-model="dataForm.isChange"
|
||||
:disabled="isDetail=='detail' || isDetail=='change'" optionType="default" direction="horizontal"
|
||||
disabled optionType="default" direction="horizontal"
|
||||
size="small" :options="isUrgentOptions" :props="isUrgentProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
@ -200,7 +200,11 @@
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column label="物料名称"
|
||||
prop="materialName" width="150"
|
||||
align="center">
|
||||
align="center" >
|
||||
<template slot="header">
|
||||
物料名称(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.materialName}}
|
||||
<!-- <materialslect v-model="scope.row.materialId" placeholder="请选择" filterable :disabled="false"-->
|
||||
@ -212,6 +216,10 @@
|
||||
<el-table-column label="规格型号"
|
||||
prop="spec" width="150"
|
||||
align="center">
|
||||
<template slot="header">
|
||||
规格型号(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.spec}}
|
||||
<!-- <JnpfSelect v-model="scope.row.spec" placeholder="请选择" filterable :disabled="false"-->
|
||||
@ -223,6 +231,10 @@
|
||||
<el-table-column label="单位"
|
||||
prop="unit" width="150"
|
||||
align="center">
|
||||
<template slot="header">
|
||||
单位(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.unitName}}
|
||||
<!-- <JnpfSelect v-model="scope.row.unit" placeholder="请选择" filterable :disabled="false"-->
|
||||
@ -235,8 +247,8 @@
|
||||
<el-table-column label="订单数量"
|
||||
width="150" align="center">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
>*</span>订单数量
|
||||
订单数量(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.ordQty"
|
||||
@ -249,8 +261,8 @@
|
||||
<el-table-column label="含税单价"
|
||||
width="150" align="center">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
>*</span>含税单价
|
||||
含税单价(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.priceTax" :disabled="isDetail=='detail'"
|
||||
@ -263,8 +275,8 @@
|
||||
prop="materialUse" width="150"
|
||||
align="center">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
>*</span>用途
|
||||
用途(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfSelect v-model="scope.row.materialUse" placeholder="请选择" filterable :disabled="isDetail=='detail'"
|
||||
@ -341,6 +353,20 @@
|
||||
</el-col>
|
||||
|
||||
</template>
|
||||
<el-col :span="24">
|
||||
<div class="footer-buttons" style="text-align: center; margin-top: 20px;">
|
||||
<el-button type="primary" @click="dataFormSubmit(0)" :loading="btnLoading" :disabled="continueBtnLoading" v-if="isDetail=='change'">
|
||||
订单变更
|
||||
</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit(0)" :loading="btnLoading" :disabled="continueBtnLoading" v-if="isDetail!='detail'&&isDetail!='change'">
|
||||
保 存
|
||||
</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit(1)" :loading="btnLoading" :disabled="continueBtnLoading" v-if="isDetail!='detail'&&isDetail!='change'" style="margin-left: 20px;">
|
||||
送 审
|
||||
</el-button>
|
||||
<el-button @click="goBack" style="margin-left: 20px;">取 消</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<el-dialog
|
||||
title="选择"
|
||||
@ -351,6 +377,7 @@
|
||||
append-to-body
|
||||
width="1000px"
|
||||
height="400px"
|
||||
@close="selectCancel()"
|
||||
>
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
@ -397,15 +424,6 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
<div class="footer-buttons" style="text-align: center; margin-top: 20px;">
|
||||
<el-button type="primary" @click="dataFormSubmit(0)" :loading="btnLoading" :disabled="continueBtnLoading" v-if="isDetail!='detail'">
|
||||
保 存
|
||||
</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit(1)" :loading="btnLoading" :disabled="continueBtnLoading" v-if="isDetail!='detail'" style="margin-left: 20px;">
|
||||
送 审
|
||||
</el-button>
|
||||
<el-button @click="goBack" style="margin-left: 20px;">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
@ -491,7 +509,7 @@ export default {
|
||||
version: 0,
|
||||
deliveryStatus:"1",
|
||||
ordDate:undefined,
|
||||
ordStatus: undefined,
|
||||
ordStatus: "1",
|
||||
remark: undefined,
|
||||
orderDetailList:[]
|
||||
},
|
||||
@ -501,9 +519,9 @@ export default {
|
||||
ordDate: [
|
||||
{ required: true, message: '请选择下单日期', trigger: 'change' }
|
||||
],
|
||||
// ordStatus: [
|
||||
// { required: true, message: '请选择订单状态', trigger: 'change' }
|
||||
// ],
|
||||
ordStatus: [
|
||||
{ required: true, message: '请选择订单状态', trigger: 'change' }
|
||||
],
|
||||
saleDeptId: [
|
||||
{ required: true, message: '请选择业务部门', trigger: 'change' }
|
||||
],
|
||||
@ -679,7 +697,14 @@ export default {
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.listQuery.matCode = ''
|
||||
this.listQuery.matName = ''
|
||||
this.listQuery.spec = ''
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = this.pageSize
|
||||
this.initData()
|
||||
},
|
||||
getEnumLabel(options, value) {
|
||||
if (value === undefined || value === null || value === '') return value;
|
||||
const item = options.find(opt => opt.id == value);
|
||||
@ -1007,6 +1032,27 @@ export default {
|
||||
for (let i = 0; i < this.dataForm.orderDetailList.length; i++) {
|
||||
const row = this.dataForm.orderDetailList[i]
|
||||
const rowNumber = i + 1
|
||||
if (!row.materialName || row.materialName === '') {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: `第${rowNumber}行的物料名称不能为空!`
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!row.spec || row.spec === '') {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: `第${rowNumber}行的规格型号不能为空!`
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!row.unitName || row.unitName === '') {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: `第${rowNumber}行的单位不能为空!`
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!row.ordQty || row.ordQty === '') {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
@ -1035,6 +1081,9 @@ export default {
|
||||
}else {
|
||||
_data.ordStatus=2
|
||||
}
|
||||
if (this.isDetail=='change'){
|
||||
_data.isChange=0
|
||||
}
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-form @submit.native.prevent >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下单日期">
|
||||
<JnpfDateRangePicker v-model="query.ordDate" format="yyyy-MM-dd"
|
||||
<JnpfDateRangePicker v-model="query.ordDate" format="yyyy-MM-dd" :clearable="false"
|
||||
startPlaceholder="开始日期" endPlaceholder="结束日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -62,8 +62,8 @@
|
||||
<el-table-column type="selection" width="50" align="center" fixed="left"/>
|
||||
<el-table-column prop="saleOrdNo" label="订单编码" align="center" fixed="left" width="100"/>
|
||||
<el-table-column prop="ordDate" label="下单日期" align="center" :formatter="jnpf.tableDateFormat1" fixed="left" width="90"/>
|
||||
<el-table-column prop="custName" label="客户名称" align="center" />
|
||||
<el-table-column prop="ordType" label="订单类型" align="center">
|
||||
<el-table-column prop="custName" label="客户名称" align="center" width="200"/>
|
||||
<el-table-column prop="ordType" label="订单类型" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ordType == 1 ? '备库订单' : scope.row.ordType == 2 ? '销售订单' : scope.row.ordType }}
|
||||
</template>
|
||||
@ -74,21 +74,21 @@
|
||||
{{ scope.row.isUrgent == 0 ? '是' : scope.row.isUrgent == 1 ? '否' : scope.row.isUrgent }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contractNo" label="合同编号" align="center"/>
|
||||
<el-table-column prop="contractNo" label="合同编号" align="center" width="150"/>
|
||||
<el-table-column prop="saleManName" label="业务人员" align="center"/>
|
||||
<el-table-column prop="isChange" label="是否变更" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isChange == 0 ? '是' : scope.row.isChange == 1 ? '否' : scope.row.isChange }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="proStatus" label="生产状态" align="center">
|
||||
<el-table-column prop="proStatus" label="生产状态" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.proStatus == 0 ? '正常' : scope.row.proStatus == 1 ? '部分转生产' : scope.row.proStatus == 2 ? "全部转生产":scope.row.proStatus}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="qualityReq" label="质量要求" align="center"/>
|
||||
<el-table-column prop="packReq" label="包装要求" align="center"/>
|
||||
<el-table-column prop="qualityReq" label="质量要求" align="center" width="180"/>
|
||||
<el-table-column prop="packReq" label="包装要求" align="center" width="180"/>
|
||||
<el-table-column prop="ordStatus" label="订单状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ (ordStatusOptions.find(item => item.enCode == scope.row.ordStatus) || {}).fullName || scope.row.ordStatus }}
|
||||
@ -103,8 +103,8 @@
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'update')" v-if='scope.row.ordStatus=="1"||scope.row.ordStatus=="5"' >编辑</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)" v-if='scope.row.ordStatus=="1"||scope.row.ordStatus=="5"'>作废</el-button>
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'change')" v-if='scope.row.ordStatus=="2"' >订单变更</el-button>
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'detail')" v-if='scope.row.ordStatus!="3"' >详情</el-button>
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'change')" v-if='scope.row.ordStatus=="3"' >订单变更</el-button>
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'detail')">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
@ -436,9 +436,14 @@ export default {
|
||||
},
|
||||
//初始化查询的默认数据
|
||||
async initSearchData() {
|
||||
let date = new Date();
|
||||
let dateWithoutTime = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
this.query.ordDate = [dateWithoutTime.getTime(), dateWithoutTime.getTime()]
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const startDate = `${year}-${month}-01 00:00:00`
|
||||
const startDateTimestamp = new Date(startDate).getTime()
|
||||
const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`
|
||||
const endDateTimestamp = new Date(endDate).getTime()
|
||||
this.query.ordDate = [startDateTimestamp, endDateTimestamp]
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
|
||||
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack" content="详情" />
|
||||
<div class="options">
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class="main" :style="{ margin: '0 auto', width: '100%' }">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="150px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="供应商" prop="supplierId">
|
||||
<p>{{ dataForm.supplierId }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="物料编码" prop="materialCode">
|
||||
<p>{{ dataForm.materialCode }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="规格">
|
||||
<p>{{ dataForm.materialCode_device_code }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="生产日期(批号)" prop="productLot">
|
||||
<JnpfInput v-model="dataForm.productLot" placeholder="请输入" disabled detailed clearable :style="{ width: '100%' }"> </JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="到货日期" prop="recieveDate">
|
||||
<p>{{ dataForm.recieveDate }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="检验日期" prop="checkDate">
|
||||
<p>{{ dataForm.checkDate }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="到货数量(kg)" prop="recieveKg">
|
||||
<JnpfNumber v-model="dataForm.recieveKg" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="到货数量(件)" prop="recievePiece">
|
||||
<JnpfNumber v-model="dataForm.recievePiece" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="抽检数量(件)" prop="sampleQty">
|
||||
<JnpfNumber v-model="dataForm.sampleQty" placeholder="数字文本" disabled :step="10"> </JnpfNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="检验结果" prop="checkResult">
|
||||
<p>{{ dataForm.checkResult }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="处理结果" prop="processResult">
|
||||
<p>{{ dataForm.processResult }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="问题原因" prop="problemReason">
|
||||
<p>{{ dataForm.problemReason }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="备注" prop="remark">
|
||||
<p>{{ dataForm.remark }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>检验数据明细</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.tableField120" size="mini">
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column prop="avgValue" label="平均值" align="" fixed="${config.tableFixed}">
|
||||
<template slot-scope="scope">
|
||||
<JnpfNumber v-model="scope.row.avgValue" placeholder="数字文本" disabled :step="1"> </JnpfNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="" fixed="${config.tableFixed}">
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.remark" placeholder="请输入" disabled detailed clearable :style="{ width: '100%' }"> </JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="checkResult" label="判定结果" align="" fixed="${config.tableFixed}">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.checkResult }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>样品数据</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.tableField126" size="mini">
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column prop="actValue" label="实际的检验值" align="" fixed="${config.tableFixed}">
|
||||
<template slot-scope="scope">
|
||||
<JnpfNumber v-model="scope.row.actValue" placeholder="数字文本" disabled :step="1"> </JnpfNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request';
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev';
|
||||
import jnpf from '@/utils/jnpf';
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail';
|
||||
import { thousandsFormat } from '@/components/Generator/utils/index';
|
||||
export default {
|
||||
components: { Detail },
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
//掩码配置
|
||||
maskConfig: {
|
||||
productLot: {},
|
||||
qa_material_check_data_twremark: {},
|
||||
},
|
||||
//定位属性
|
||||
locationScope: {},
|
||||
|
||||
dataForm: {},
|
||||
checkResultOptions: [
|
||||
{ fullName: '合格', id: '1' },
|
||||
{ fullName: '不合格', id: '0' },
|
||||
],
|
||||
checkResultProps: { label: 'fullName', value: 'id' },
|
||||
|
||||
checkResultOptions: [
|
||||
{ fullName: '合格', id: '1' },
|
||||
{ fullName: '不合格', id: '0' },
|
||||
],
|
||||
checkResultProps: { label: 'fullName', value: 'id' },
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return;
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
let formData = JSON.parse(res.data.formData);
|
||||
formData.popupType = 'general';
|
||||
this.detailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue);
|
||||
});
|
||||
});
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll;
|
||||
this.dataForm = _dataAll;
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$emit('refresh');
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true;
|
||||
request({
|
||||
url: '/api/example/Qa_material_check_data/detail/' + this.dataForm.id,
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
1247
jnpf-java-boot/jnpf-web/src/views/example/orderapproval/form.vue
Normal file
1247
jnpf-java-boot/jnpf-web/src/views/example/orderapproval/form.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,568 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout finalcheckdata_new">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下单日期">
|
||||
<JnpfDateRangePicker v-model="query.ordDate" format="yyyy-MM-dd" :clearable="false"
|
||||
startPlaceholder="开始日期" endPlaceholder="结束日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="订单编号">
|
||||
<el-input v-model="query.saleOrdNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单类型">
|
||||
<JnpfSelect v-model="query.ordType" placeholder="请选择" clearable :options="ordTypeOptions"
|
||||
:props="ordTypeProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单状态">
|
||||
<JnpfSelect v-model="query.ordStatus" placeholder="请选择" clearable filterable :options="ordStatusOptions"
|
||||
:props="ordStatusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否急单">
|
||||
<JnpfSelect v-model="query.isUrgent" placeholder="请选择" clearable :options="isUrgentOptions"
|
||||
:props="isUrgentProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" >
|
||||
<el-form-item class="btn">
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list"
|
||||
:span-method="arraySpanMethod" @selection-change="handleSelectionChange" :hasNOFixed="true" border>
|
||||
<el-table-column prop="saleOrdNo" label="订单编码" align="center" fixed="left" width="100"/>
|
||||
<el-table-column prop="ordDate" label="下单日期" align="center" :formatter="jnpf.tableDateFormat1" fixed="left" width="90"/>
|
||||
<el-table-column prop="custName" label="客户名称" align="center" width="200"/>
|
||||
<el-table-column prop="ordType" label="订单类型" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ordType == 1 ? '备库订单' : scope.row.ordType == 2 ? '销售订单' : scope.row.ordType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reqDeliveryDate" label="要求交货日期" align="center" :formatter="jnpf.tableDateFormat1" width="100"/>
|
||||
<el-table-column prop="isUrgent" label="是否急单" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isUrgent == 0 ? '是' : scope.row.isUrgent == 1 ? '否' : scope.row.isUrgent }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contractNo" label="合同编号" align="center" width="150"/>
|
||||
<el-table-column prop="saleManName" label="业务人员" align="center"/>
|
||||
<el-table-column prop="isChange" label="是否变更" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isChange == 0 ? '是' : scope.row.isChange == 1 ? '否' : scope.row.isChange }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="proStatus" label="生产状态" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.proStatus == 0 ? '正常' : scope.row.proStatus == 1 ? '部分转生产' : scope.row.proStatus == 2 ? "全部转生产":scope.row.proStatus}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="qualityReq" label="质量要求" align="center" width="180"/>
|
||||
<el-table-column prop="packReq" label="包装要求" align="center" width="180"/>
|
||||
<el-table-column prop="ordStatus" label="订单状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ (ordStatusOptions.find(item => item.enCode == scope.row.ordStatus) || {}).fullName || scope.row.ordStatus }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveryStatus" label="发货状态" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deliveryStatus ==1 ? '未发货' : scope.row.deliveryStatus == 1 ? '部分发货' : scope.row.deliveryStatus == 2 ? "全部发货":scope.row.deliveryStatus}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="160" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'approval')" v-if='scope.row.ordStatus=="2"'>审批</el-button>
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row,'detail')">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||
|
||||
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
|
||||
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import { mapGetters } from "vuex";
|
||||
import JNPFForm from "./form";
|
||||
import Detail from "./Detail";
|
||||
import ExportBox from "@/components/ExportBox";
|
||||
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
|
||||
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
|
||||
import { getConfigData } from "@/api/onlineDev/visualDev";
|
||||
import columnList from "./columnList";
|
||||
import SuperQuery from "@/components/SuperQuery";
|
||||
import superQueryJson from "./superQueryJson";
|
||||
import { noGroupList } from "@/components/Generator/generator/comConfig";
|
||||
import {getDictionaryDataSelector} from "@/api/systemData/dictionary";
|
||||
import {formatDate} from "element-ui";
|
||||
import {toDate} from "@/filters";
|
||||
import jnpf from "@/utils/jnpf";
|
||||
|
||||
|
||||
export default {
|
||||
name: "orderApproval",
|
||||
components: {
|
||||
JNPFForm,
|
||||
Detail,
|
||||
ExportBox,
|
||||
ToFormDetail,
|
||||
SuperQuery,
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
expandsTree: true,
|
||||
refreshTree: true,
|
||||
toFormDetailVisible: false,
|
||||
hasBatchBtn: false,
|
||||
expandObj: {},
|
||||
columnOptions: [],
|
||||
mergeList: [],
|
||||
exportList: [],
|
||||
columnList,
|
||||
ordTypeOptions: [
|
||||
{ fullName: "备库订单", id: "1" },
|
||||
{ fullName: "销售订单", id: "2" },
|
||||
],
|
||||
ordTypeProps: { label: "fullName", value: "id" },
|
||||
superQueryVisible: false,
|
||||
superQueryJson,
|
||||
uploadBoxVisible: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
saleOrdNo: undefined,
|
||||
ordDate: undefined,
|
||||
projectName: undefined,
|
||||
isUrgent: undefined,
|
||||
ordStatus: "2",
|
||||
saleManName:undefined,
|
||||
},
|
||||
defListQuery: {
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
//排序默认值
|
||||
|
||||
list: [],
|
||||
listLoading: false,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
queryData: {},
|
||||
listQuery: {
|
||||
superQueryJson: "",
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "",
|
||||
sidx: "",
|
||||
},
|
||||
//多列排序
|
||||
ordersList: [],
|
||||
formVisible: false,
|
||||
flowVisible: false,
|
||||
flowListVisible: false,
|
||||
flowList: [],
|
||||
exportBoxVisible: false,
|
||||
isUrgentOptions: [
|
||||
{ fullName: "是", id: "0" },
|
||||
{ fullName: "否", id: "1" },
|
||||
],
|
||||
isUrgentProps: { label: "fullName", value: "id" },
|
||||
ordStatusOptions: [
|
||||
],
|
||||
ordStatusProps: { label: "fullName", value: "enCode" },
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
jnpf() {
|
||||
return jnpf
|
||||
},
|
||||
...mapGetters(["userInfo"]),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || "";
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getColumnList(),
|
||||
this.getOrdStatusOptions(),
|
||||
this.initSearchDataAndListData();
|
||||
this.queryData = JSON.parse(JSON.stringify(this.query));
|
||||
},
|
||||
methods: {
|
||||
// 请求接口导出excel
|
||||
exportExcel(row) {
|
||||
request({
|
||||
url: `/api/example/QaProMaterialCheck/exportExcel`,
|
||||
method: "post",
|
||||
data: {
|
||||
id: row.id,
|
||||
checkCode: row.printCode,
|
||||
// checkCode: 2
|
||||
}
|
||||
}).then((res) => {
|
||||
if (!res.data || !res.data.url) {
|
||||
this.$message.error('导出失败:未返回下载地址');
|
||||
return;
|
||||
}
|
||||
this.jnpf.downloadFile(res.data.url);
|
||||
// 安全地关闭导出弹窗
|
||||
if (this.$refs.ExportBox) {
|
||||
this.$refs.ExportBox.visible = false;
|
||||
}
|
||||
this.exportBoxVisible = false;
|
||||
}).catch(err => {
|
||||
console.error('导出Excel失败:', err);
|
||||
this.$message.error(err.message || '导出Excel失败,请重试');
|
||||
});
|
||||
},
|
||||
|
||||
getOrdStatusOptions() {
|
||||
getDictionaryDataSelector("811520443046428805").then(res => {
|
||||
this.ordStatusOptions = res.data.list;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
|
||||
|
||||
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return;
|
||||
getConfigData(modelId).then((res) => {
|
||||
if (!res.data || !res.data.formData) return;
|
||||
let formData = JSON.parse(res.data.formData);
|
||||
formData.popupType = "general";
|
||||
this.toFormDetailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
|
||||
});
|
||||
});
|
||||
},
|
||||
toggleTreeExpand(expands) {
|
||||
this.refreshTree = false;
|
||||
this.expandsTree = expands;
|
||||
this.$nextTick(() => {
|
||||
this.refreshTree = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.treeBox.setCurrentKey(null);
|
||||
});
|
||||
});
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data[this.treeProps.label].indexOf(value) !== -1;
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const nodeData = node.data;
|
||||
const config = {
|
||||
treeInterfaceId: "",
|
||||
treeTemplateJson: [],
|
||||
};
|
||||
if (config.treeInterfaceId) {
|
||||
//这里是为了拿到参数中关联的字段的值,后端自行拿
|
||||
if (config.treeTemplateJson && config.treeTemplateJson.length) {
|
||||
for (let i = 0; i < config.treeTemplateJson.length; i++) {
|
||||
const element = config.treeTemplateJson[i];
|
||||
element.defaultValue = nodeData[element.relationField] || "";
|
||||
}
|
||||
}
|
||||
//参数
|
||||
let query = {
|
||||
paramList: config.treeTemplateJson || [],
|
||||
};
|
||||
//接口
|
||||
getDataInterfaceRes(config.treeInterfaceId, query).then((res) => {
|
||||
let data = res.data;
|
||||
if (Array.isArray(data)) {
|
||||
resolve(data);
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getColumnList() {
|
||||
// 没有开启权限
|
||||
this.columnOptions = this.transformColumnList(this.columnList);
|
||||
},
|
||||
transformColumnList(columnList) {
|
||||
let list = [];
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i];
|
||||
if (!e.prop.includes("-")) {
|
||||
list.push(e);
|
||||
} else {
|
||||
let prop = e.prop.split("-")[0];
|
||||
let label = e.label.split("-")[0];
|
||||
let vModel = e.prop.split("-")[1];
|
||||
let newItem = {
|
||||
align: "center",
|
||||
jnpfKey: "table",
|
||||
prop,
|
||||
label,
|
||||
children: [],
|
||||
};
|
||||
e.vModel = vModel;
|
||||
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
|
||||
this.$set(this.expandObj, `${prop}Expand`, false);
|
||||
if (!list.some((o) => o.prop === prop)) list.push(newItem);
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getMergeList(list);
|
||||
// this.getExportList(list);
|
||||
return list;
|
||||
},
|
||||
arraySpanMethod({ column }) {
|
||||
for (let i = 0; i < this.mergeList.length; i++) {
|
||||
if (column.property == this.mergeList[i].prop) {
|
||||
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
|
||||
}
|
||||
}
|
||||
},
|
||||
getMergeList(list) {
|
||||
let newList = JSON.parse(JSON.stringify(list));
|
||||
newList.forEach((item) => {
|
||||
if (item.children && item.children.length) {
|
||||
let child = {
|
||||
prop: item.prop + "-child-first",
|
||||
};
|
||||
item.children.unshift(child);
|
||||
}
|
||||
});
|
||||
newList.forEach((item) => {
|
||||
if (item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
});
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: item.prop,
|
||||
rowspan: 1,
|
||||
colspan: 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getExportList(list) {
|
||||
let exportList = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].jnpfKey === "table") {
|
||||
for (let j = 0; j < list[i].children.length; j++) {
|
||||
exportList.push(list[i].children[j]);
|
||||
}
|
||||
} else {
|
||||
exportList.push(list[i]);
|
||||
}
|
||||
}
|
||||
this.exportList = exportList.filter(
|
||||
(o) => !noGroupList.includes(o.__config__.jnpfKey)
|
||||
);
|
||||
},
|
||||
goDetail(id) {
|
||||
this.detailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id);
|
||||
});
|
||||
},
|
||||
|
||||
async initSearchDataAndListData() {
|
||||
await this.initSearchData();
|
||||
// this.initData();
|
||||
},
|
||||
//初始化查询的默认数据
|
||||
async initSearchData() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0')
|
||||
const startDate = `${year}-${month}-01 00:00:00`
|
||||
const startDateTimestamp = new Date(startDate).getTime()
|
||||
const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`
|
||||
const endDateTimestamp = new Date(endDate).getTime()
|
||||
this.query.ordDate = [startDateTimestamp, endDateTimestamp]
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
dataType: 0,
|
||||
};
|
||||
request({
|
||||
url: `/api/example/exampleOrder/getList`,
|
||||
method: "post",
|
||||
data: _query,
|
||||
}).then((res) => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data);
|
||||
}
|
||||
this.list = _list.map((o) => ({
|
||||
...o,
|
||||
...this.expandObj,
|
||||
}));
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm("此操作将作废该数据, 是否继续?", "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
request({
|
||||
url: `/api/example/exampleOrder/${id}`,
|
||||
method: "DELETE",
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
|
||||
addOrUpdateHandle(row, isDetail) {
|
||||
let id = row ? row.id : "";
|
||||
this.formVisible = true;
|
||||
if (!this.treeActiveId) {
|
||||
this.leftTreeActiveInfo = {};
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(
|
||||
id,
|
||||
isDetail,
|
||||
this.list,
|
||||
this.leftTreeActiveInfo
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
exportData() {
|
||||
let temp = [
|
||||
{ label: "订单编码", prop: "saleOrdNo" },
|
||||
{ label: "下单日期", prop: "ordDate" },
|
||||
{ label: "客户名称", prop: "custName" },
|
||||
{ label: "订单类型", prop: "ordType" },
|
||||
{ label: "要求交货日期", prop: "reqDeliveryDate" },
|
||||
{ label: "是否急单", prop: "isUrgent" },
|
||||
{ label: "合同编号", prop: "contractNo" },
|
||||
{ label: "业务人员", prop: "saleManName" },
|
||||
{ label: "是否变更", prop: "isChange" },
|
||||
{ label: "生产状态", prop: "proStatus" },
|
||||
{ label: "质量要求", prop: "qualityReq" },
|
||||
{ label: "包装要求", prop: "packReq" },
|
||||
{ label: "订单状态", prop: "ordStatus" },
|
||||
{ label: "发货状态", prop: "deliveryStatus" },
|
||||
];
|
||||
this.exportBoxVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(temp);
|
||||
});
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId,
|
||||
};
|
||||
request({
|
||||
url: `/api/example/exampleOrder/Actions/Export`,
|
||||
method: "post",
|
||||
data: query,
|
||||
}).then((res) => {
|
||||
if (!res.data.url) return;
|
||||
this.jnpf.downloadFile(res.data.url);
|
||||
this.$refs.ExportBox.visible = false;
|
||||
this.exportBoxVisible = false;
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.initData();
|
||||
this.update_count += 1;
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false;
|
||||
if (isrRefresh) this.search();
|
||||
},
|
||||
reset() {
|
||||
this.query = JSON.parse(JSON.stringify(this.queryData));
|
||||
this.search();
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .el-form-item__label {
|
||||
text-align: left !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<el-select v-model="innerValue" :placeholder="placeholder" :clearable="clearable"
|
||||
@change="onChange()" :multiple="multiple" :disabled="disabled" :filterable="filterable">
|
||||
<el-option v-for="item in options" :key="item[props.value]" :label="item[props.label] +' ' + item[props.labels]"
|
||||
:value="item[props.value]">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'materialslect',
|
||||
components: {},
|
||||
props: {
|
||||
value: {
|
||||
default: undefined
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
filterable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
props: {
|
||||
label: "fullName",
|
||||
value: "id"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
innerValue: this.value,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
this.innerValue = val
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
mounted() { },
|
||||
methods: {
|
||||
onChange() {
|
||||
if (this.multiple) this.innerValue = this.innerValue ? this.innerValue : []
|
||||
if (!this.multiple) this.innerValue = this.innerValue ? this.innerValue : ""
|
||||
this.$emit('input', this.innerValue)
|
||||
this.$emit('change', this.innerValue)
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.input-number {
|
||||
width: 100%;
|
||||
border-radius: 0px !important;
|
||||
>>> .el-input__inner {
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
}
|
||||
.select-item {
|
||||
display: block;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.select-border {
|
||||
display: block;
|
||||
margin: 8px 0;
|
||||
}
|
||||
.select-horizontal {
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
vertical-align: middle;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.vertical-button {
|
||||
margin: 5px 0;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user