This commit is contained in:
parent
fa474c8a07
commit
6a07f5e5ac
|
|
@ -1,7 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 新增工机具 -->
|
<!-- 新增工机具 -->
|
||||||
<div>
|
<div>
|
||||||
<el-form :model="maForm" ref="maForm" size="small" :rules="rules" :inline="true" label-width="120px">
|
<el-form
|
||||||
|
:model="maForm"
|
||||||
|
ref="maForm"
|
||||||
|
size="small"
|
||||||
|
:rules="rules"
|
||||||
|
:inline="true"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
<el-form-item label="到货日期" prop="arrivalTime">
|
<el-form-item label="到货日期" prop="arrivalTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="maForm.arrivalTime"
|
v-model="maForm.arrivalTime"
|
||||||
|
|
@ -12,7 +19,13 @@
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物资厂家" prop="supplierId">
|
<el-form-item label="物资厂家" prop="supplierId">
|
||||||
<el-select v-model="maForm.supplierId" placeholder="物资厂家" clearable filterable style="width: 240px">
|
<el-select
|
||||||
|
v-model="maForm.supplierId"
|
||||||
|
placeholder="物资厂家"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in supplierList"
|
v-for="item in supplierList"
|
||||||
:key="item.supplierId"
|
:key="item.supplierId"
|
||||||
|
|
@ -128,26 +141,41 @@
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave" >保存</el-button>
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSave" >保存</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-if="isEdit">
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-if="isEdit">导出</el-button>
|
||||||
导出
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="equipmentList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||||
<el-table-column align="center" label="序号" type="index" width="55" />
|
<el-table-column
|
||||||
<el-table-column align="center" label="物资名称" prop="maTypeName" show-overflow-tooltip></el-table-column>
|
align="center"
|
||||||
<el-table-column align="center" label="规格型号" prop="typeName" show-overflow-tooltip />
|
label="序号"
|
||||||
|
type="index"
|
||||||
|
width="55"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="物资名称"
|
||||||
|
prop="maTypeName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="规格型号"
|
||||||
|
prop="typeName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
<el-table-column align="center" label="单位" prop="unitName" />
|
<el-table-column align="center" label="单位" prop="unitName" />
|
||||||
<el-table-column label="采购数量" prop="purchaseNum" align="center">
|
<el-table-column label="采购数量" prop="purchaseNum" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model.number="scope.row.purchaseNum"
|
v-model.number="scope.row.purchaseNum"
|
||||||
controls-position="right"
|
controls-position="right" type="number"
|
||||||
type="number"
|
style="width: 100%" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||||
style="width: 100%"
|
|
||||||
:disabled="scope.row.status != 1 && scope.row.status != 12"
|
|
||||||
:min="0"
|
:min="0"
|
||||||
@input="
|
@input="
|
||||||
v =>
|
v =>
|
||||||
|
|
@ -158,57 +186,59 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="购置单价(元含税)" prop="purchaseTaxPrice" align="center" width="200">
|
<el-table-column
|
||||||
|
label="购置单价(元含税)"
|
||||||
|
prop="purchaseTaxPrice"
|
||||||
|
align="center" width="200"
|
||||||
|
>
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scope.row.purchaseTaxPrice"
|
v-model="scope.row.purchaseTaxPrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
style="width: 100%"
|
style="width: 100%" @blur="scope.row.purchaseTaxPrice = scope.row.purchaseTaxPrice>0? scope.row.purchaseTaxPrice:0"
|
||||||
@blur="
|
:min="0" :step="1" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||||
scope.row.purchaseTaxPrice = scope.row.purchaseTaxPrice > 0 ? scope.row.purchaseTaxPrice : 0
|
|
||||||
"
|
|
||||||
:min="0"
|
|
||||||
:step="1"
|
|
||||||
:disabled="scope.row.status != 1 && scope.row.status != 12"
|
|
||||||
@change="purchaseTaxPriceChange(scope.row,scope.$index)"
|
@change="purchaseTaxPriceChange(scope.row,scope.$index)"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="购置单价(元不含税)" prop="purchasePrice" align="center" width="200">
|
<el-table-column
|
||||||
|
label="购置单价(元不含税)"
|
||||||
|
prop="purchasePrice"
|
||||||
|
align="center" width="200"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scope.row.purchasePrice"
|
v-model="scope.row.purchasePrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:min="0"
|
:min="0" :step="1" disabled
|
||||||
:step="1"
|
|
||||||
disabled
|
|
||||||
@input="purchasePriceChange(scope.row,scope.$index)"
|
@input="purchasePriceChange(scope.row,scope.$index)"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="租赁价(元/天)" prop="rentPrice" align="center" width="200">
|
<el-table-column label="租赁价(元/天)" prop="rentPrice"
|
||||||
|
align="center" width="200"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="scope.row.rentPrice"
|
v-model="scope.row.rentPrice"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
style="width: 100%"
|
style="width: 100%" @blur="scope.row.rentPrice = scope.row.rentPrice>0? Number(scope.row.rentPrice.toFixed(2)) :0"
|
||||||
@blur="
|
:min="0" :step="1" :disabled="(scope.row.status!=1&&scope.row.status!=12)||scope.row.rentPriceDisabled"
|
||||||
scope.row.rentPrice = scope.row.rentPrice > 0 ? Number(scope.row.rentPrice.toFixed(2)) : 0
|
|
||||||
"
|
|
||||||
:min="0"
|
|
||||||
:step="1"
|
|
||||||
:disabled="(scope.row.status != 1 && scope.row.status != 12) || scope.row.rentPriceDisabled"
|
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否为固定资产" prop="fixCode" align="center" width="120">
|
<el-table-column
|
||||||
|
label="是否为固定资产"
|
||||||
|
prop="fixCode"
|
||||||
|
align="center"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="scope.row.fixCode"
|
v-model="scope.row.fixCode"
|
||||||
placeholder="固定资产"
|
placeholder="固定资产"
|
||||||
filterable
|
filterable :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||||
:disabled="scope.row.status != 1 && scope.row.status != 12"
|
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option label="是" value="1"></el-option>
|
<el-option label="是" value="1"></el-option>
|
||||||
|
|
@ -217,21 +247,29 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="出厂日期" align="center" prop="productionTime" width="200">
|
<el-table-column
|
||||||
|
label="出厂日期"
|
||||||
|
align="center"
|
||||||
|
prop="productionTime"
|
||||||
|
width="200"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="scope.row.productionTime"
|
v-model="scope.row.productionTime"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
type="date"
|
type="date" :disabled="scope.row.status!=1&&scope.row.status!=12"
|
||||||
:disabled="scope.row.status != 1 && scope.row.status != 12"
|
|
||||||
placeholder="出厂日期"
|
placeholder="出厂日期"
|
||||||
clearable
|
clearable
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="相关配套资料" align="center" width="120" prop="bmFileInfos">
|
<el-table-column
|
||||||
|
label="相关配套资料"
|
||||||
|
align="center" width="120"
|
||||||
|
prop="bmFileInfos"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div
|
<div
|
||||||
style="color: #02a7f0; cursor: pointer"
|
style="color: #02a7f0; cursor: pointer"
|
||||||
|
|
@ -265,8 +303,7 @@
|
||||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text" v-if="scope.row.status==1||scope.row.status==12"
|
||||||
v-if="scope.row.status == 1 || scope.row.status == 12"
|
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
style="color: red"
|
style="color: red"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
|
|
@ -277,6 +314,9 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-dialog title="报告管理" :visible.sync="open" width="900px" append-to-body>
|
<el-dialog title="报告管理" :visible.sync="open" width="900px" append-to-body>
|
||||||
<el-table :data="fileDataList" width="100%" height="350px">
|
<el-table :data="fileDataList" width="100%" height="350px">
|
||||||
<el-table-column label="序号" type="index" width="55" align="center"/>
|
<el-table-column label="序号" type="index" width="55" align="center"/>
|
||||||
|
|
@ -297,17 +337,13 @@
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||||
<el-upload
|
<el-upload ref="upload" :limit="3" :headers="upload.headers"
|
||||||
ref="upload"
|
:action="upload.url" :show-file-list="false" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
|
||||||
:limit="3"
|
:on-success="handleFileSuccess" :auto-upload="true"
|
||||||
:headers="upload.headers"
|
|
||||||
:action="upload.url"
|
|
||||||
:show-file-list="false"
|
|
||||||
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
|
|
||||||
:on-success="handleFileSuccess"
|
|
||||||
:auto-upload="true"
|
|
||||||
>
|
>
|
||||||
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">上传</el-button>
|
<el-button size="mini" type="text" @click="beforeFileUpload(scope.row)">
|
||||||
|
上传
|
||||||
|
</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -320,6 +356,8 @@
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -330,6 +368,8 @@
|
||||||
<img width="100%" height="500px" :src="dialogImageUrl" />
|
<img width="100%" height="500px" :src="dialogImageUrl" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -512,9 +552,7 @@ export default {
|
||||||
this.maForm.taxRate = val.replace(/[^\d.]/g,'')
|
this.maForm.taxRate = val.replace(/[^\d.]/g,'')
|
||||||
this.equipmentList.forEach(item=>{
|
this.equipmentList.forEach(item=>{
|
||||||
if(item.status==1||item.status==12){
|
if(item.status==1||item.status==12){
|
||||||
item.purchasePrice = ((item.purchaseTaxPrice / (100 + Number(this.maForm.taxRate))) * 100).toFixed(
|
item.purchasePrice = ((item.purchaseTaxPrice/(100 + Number(this.maForm.taxRate)))*100).toFixed(10)
|
||||||
10
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -685,7 +723,8 @@ export default {
|
||||||
},
|
},
|
||||||
//添加机具类型
|
//添加机具类型
|
||||||
deviceTypeChange(val) {
|
deviceTypeChange(val) {
|
||||||
const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes()
|
const deviceTypeList =
|
||||||
|
this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||||
let tempList = []
|
let tempList = []
|
||||||
if (val.length > 0) {
|
if (val.length > 0) {
|
||||||
const items = val.map(e => {
|
const items = val.map(e => {
|
||||||
|
|
@ -705,8 +744,7 @@ export default {
|
||||||
obj.fixCode = '0'
|
obj.fixCode = '0'
|
||||||
obj.status=1
|
obj.status=1
|
||||||
obj.bmFileInfos=[]
|
obj.bmFileInfos=[]
|
||||||
if (obj.rentPrice > 0) {
|
if(obj.rentPrice>0){//判断是否有租赁价格:有禁用;无修改;
|
||||||
//判断是否有租赁价格:有禁用;无修改;
|
|
||||||
obj.rentPriceDisabled=true
|
obj.rentPriceDisabled=true
|
||||||
}else{
|
}else{
|
||||||
obj.rentPriceDisabled=false
|
obj.rentPriceDisabled=false
|
||||||
|
|
@ -766,8 +804,7 @@ export default {
|
||||||
})
|
})
|
||||||
console.log(this.equipmentList)
|
console.log(this.equipmentList)
|
||||||
// this.loading = false;
|
// this.loading = false;
|
||||||
}
|
})
|
||||||
)
|
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
|
|
@ -789,9 +826,7 @@ export default {
|
||||||
}else if(index1>-1){
|
}else if(index1>-1){
|
||||||
this.$modal.msgError('租赁价格不能为0!')
|
this.$modal.msgError('租赁价格不能为0!')
|
||||||
}else{
|
}else{
|
||||||
this.$modal
|
this.$modal.confirm('是否确认保存当前页面').then(function () {})
|
||||||
.confirm('是否确认保存当前页面')
|
|
||||||
.then(function () {})
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
console.log('编辑')
|
console.log('编辑')
|
||||||
|
|
@ -821,9 +856,9 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}).catch(() => {})
|
||||||
.catch(() => {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -900,11 +935,9 @@ export default {
|
||||||
//判断当前上传的文件是否已上传过-再往机具类型数据中插入
|
//判断当前上传的文件是否已上传过-再往机具类型数据中插入
|
||||||
if(this.rowData.bmFileInfos.length>0){
|
if(this.rowData.bmFileInfos.length>0){
|
||||||
let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
|
let index2 = this.rowData.bmFileInfos.findIndex(v=>v.fileType==this.rowData.fileType)
|
||||||
if (index2 > -1) {
|
if(index2>-1){//相同类型文件重复上传-替换
|
||||||
//相同类型文件重复上传-替换
|
|
||||||
this.rowData.bmFileInfos.splice(index2,0,obj)
|
this.rowData.bmFileInfos.splice(index2,0,obj)
|
||||||
} else {
|
}else{//不存在相同类型文件-添加
|
||||||
//不存在相同类型文件-添加
|
|
||||||
this.rowData.bmFileInfos.push(obj)
|
this.rowData.bmFileInfos.push(obj)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -925,8 +958,7 @@ export default {
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.$modal.msgSuccess('上传成功')
|
this.$modal.msgSuccess('上传成功')
|
||||||
this.getFileData()
|
this.getFileData()
|
||||||
})
|
}).catch(() => {
|
||||||
.catch(() => {
|
|
||||||
this.$modal.msgError('上传失败')
|
this.$modal.msgError('上传失败')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue