Browse Source

6.21 仓库集控的修改

master
fengdong777 2 years ago
parent
commit
ce7854d854
  1. 245
      warehousing-system/project_web/src/components/initial_value/storehouse.vue
  2. 149
      warehousing-system/project_web/src/components/instorehouse/purchase.vue
  3. 4
      warehousing-system/project_web/src/plugins/element.js

245
warehousing-system/project_web/src/components/initial_value/storehouse.vue

@ -11,7 +11,7 @@
<el-button type="primary" @click="addStorehouseDialog">新增</el-button>
</el-col>
</el-row>
<el-table :data="storehouseList.slice((queryInfo.pageNum-1)*queryInfo.pageSize,queryInfo.pageNum*queryInfo.pageSize)"
<el-table :data="storehouseList.slice((queryInfo.current-1)*queryInfo.size,queryInfo.current*queryInfo.size)"
style="width: 100%"
stripe border fixed height="500">
<el-table-column
@ -50,37 +50,61 @@
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:current-page="queryInfo.current"
:page-sizes="[10, 20, 30, 40]"
:page-size="queryInfo.pageSize"
:page-size="queryInfo.size"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-card>
<el-dialog :title="title" :visible.sync="storehouseDialogVisible" width="65%" >
<el-dialog :title="title" :visible.sync="storehouseDialogVisible" width="75%" >
<el-form :model="form" :rules="rules" ref="form" label-position="right" class="demo-form-inline">
<el-row >
<el-col :span="3.2" class="tleftb">
<span><span class="icon">*</span>仓库名称</span>
<span><span class="icon">*</span>客户名称</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库名称" class="addinputw" clearable /></el-form-item>
<el-col :span="3" class="trightb">
<el-form-item prop="custerName">
<el-select size="small" v-model="form.custerName" placeholder="请选择" >
<el-option
v-for="custName in storehouseListss"
:key="custName.name"
:label="custName.name"
:value="custName.name">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>仓库名称</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="name">
<el-select size="small" v-model="form.name" placeholder="请选择" @change="getSupplier" >
<el-option
v-for="(storehouse,i) in storeList"
:key="i"
:label="storehouse.name"
:value="storehouse.name">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>仓库简称</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库简称" class="addinputw" clearable /></el-form-item>
<el-col :span="3" class="trightb">
<el-form-item prop="simpleName"><el-input size="small" v-model="form.simpleName" placeholder="仓库简称" class="addinputw" clearable /></el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>仓库编码</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="仓库编码" class="addinputw" clearable /></el-form-item>
<el-form-item prop="code"><el-input size="small" v-model="form.code" placeholder="仓库编码" class="addinputw" clearable /></el-form-item>
</el-col>
</el-row>
@ -90,18 +114,18 @@
<span><span class="icon">*</span>所属地&nbsp;&nbsp;&nbsp; </span>
</el-col>
<el-form-item prop="simpleName">
<el-select size="small" class = "arriveClass" v-model="form.region1" placeholder="请选择省" @change = "provinceChange($event)">
<el-option v-for="(item,index) in form.provinceList" :key="index" :label="item.name" :value="item.name">
<el-select size="small" class = "arriveClass" v-model="form.provinceName" placeholder="请选择省" @change = "provinceChange($event)">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.name" :value="item.name">
</el-option>
</el-select>
<el-select size="small" class = "arriveClass" v-model="form.region2" placeholder="请选择市" :disabled="changeCity" @change = "cityChange($event)">
<el-option v-for="(item,index) in form.cityList" :key="index" :label="item.name" :value="item.name">
<el-select size="small" class = "arriveClass" v-model="form.cityName" placeholder="请选择市" :disabled="changeCity" @change = "cityChange($event)">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.name" :value="item.name">
</el-option>
</el-select>
<el-select size="small" class = "arriveClass" v-model="form.region3" :disabled="changeCounty" placeholder="请选择区县">
<el-option v-for="(item,index) in form.countyList" :key="index" :label="item.name" :value="item.name">
<el-select size="small" class = "arriveClass" v-model="form.countyName" :disabled="changeCounty" placeholder="请选择区县">
<el-option v-for="(item,index) in countyList" :key="index" :label="item.name" :value="item.name">
</el-option>
</el-select>
</el-form-item>
@ -109,68 +133,86 @@
<el-row >
<el-col :span="3.2" class="tleftb">
<span><span class="icon">*</span>库房面积</span>
<span><span class="icon">*</span>详细地址</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="库房面积" class="addinputw" clearable /></el-form-item>
<el-form-item prop="address"><el-input size="small" v-model="form.address" placeholder="详细地址" class="addinputw" clearable /></el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>库房面积</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="acreage"><el-input size="small" v-model="form.acreage" placeholder="库房面积" class="addinputw" clearable /></el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>库房高度</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="库房高度" class="addinputw" clearable /></el-form-item>
<el-form-item prop="storeyHeight"><el-input size="small" v-model="form.storeyHeight" placeholder="库房高度" class="addinputw" clearable /></el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>月租金</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="月租金" class="addinputw" clearable /></el-form-item>
<el-form-item prop="monthlyPrice"><el-input size="small" v-model="form.monthlyPrice" placeholder="月租金" class="addinputw" clearable /></el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="3.2" class="tleftb">
<span><span class="icon">*</span>库房性质编码</span>
<span><span class="icon">*</span>库房性质名称</span>
</el-col>
<el-col :span="6" class="trightb">
<el-form-item prop="name">
<el-select size="small" class = "arriveClass" v-model="form.region1" placeholder="库房性质编码" @change = "provinceChange($event)">
<el-option v-for="(item,index) in form.provinceList" :key="index" :label="item.name" :value="item.name">
</el-option>
</el-select>
<el-col :span="3" class="trightb">
<el-form-item prop="attributeNames">
<el-input size="small" v-model="form.attributeNames" placeholder="库房性质名称" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<el-col :span="2" class="tleftb">
<span><span class="icon">*</span>房源</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="房源" class="addinputw" clearable /></el-form-item>
<el-col :span="3" class="trightb">
<el-form-item prop="housingResource"><el-input size="small" v-model="form.housingResource" placeholder="房源" class="addinputw" clearable /></el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="3.2" class="tleftb">
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>联系人姓名</span>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="联系人姓名" class="addinputw" clearable /></el-form-item>
<el-col :span="3" class="trightb">
<el-form-item prop="linkerName"><el-input size="small" v-model="form.linkerName" placeholder="联系人姓名" class="addinputw" clearable /></el-form-item>
</el-col>
<el-col :span="3" class="tleftb">
<el-col :span="3" class="tleftb">
<span><span class="icon">*</span>联系人电话</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="联系人电话" class="addinputw" clearable /></el-form-item>
<el-form-item prop="linkerPhone"><el-input size="small" v-model="form.linkerPhone" placeholder="联系人电话" class="addinputw" clearable /></el-form-item>
</el-col>
</el-row>
<el-col :span="3" class="tleftb">
<el-row >
<el-col :span="3.2" class="tleftb">
<span><span class="icon">*</span>附件</span>
</el-col>
<el-col :span="3" class="trightb">
<el-form-item prop="name"><el-input size="small" v-model="form.name" placeholder="附件" class="addinputw" clearable /></el-form-item>
<el-form-item prop="picUrl">
<el-upload
ref="upload"
class="upload-demo"
accept=".xls"
:action="updateAction"
:file-list="fileList"
:on-progress="handleProgress"
:on-success="handleSuccess"
:multiple="false"
:show-file-list="false"
:before-remove="beforeRemove"
:limit="1">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -189,15 +231,25 @@ export default {
data () {
return {
queryInfo: {
query: '',
pageNum: 1,
pageSize: 10
total: 0,
size: 1,
current: 10,
params:{
}
},
total: 0,
changeCity: true,
changeCounty: true,
storehouseList: [],
storehouseListss: [],
storeList: [],
provinceList: [],
cityList: [],
countyList: [],
updateAction: 'http://8.130.39.13:9050/v1/shstorehouse/upload',
storehouseDialogVisible: false,
// myHeaders: { Access-Control-Allow-Origin},
title: '新增仓库',
storehouseForm: {
name: '',
@ -217,17 +269,26 @@ export default {
]
},
tableData:[],
fileList: [],
totalPrice:0,
form:{
name:"",
region1:'',
region2:'',
region3:'',
xxarrive:'',
tel:'',
provinceList:[],
cityList:[],
countyList:[]
name:'',
custerName:"",
provinceName:'',
cityName:'',
simpleName:'',
code:'',
countyName:'',
address:'',
acreage:'',
storeyHeight:'',
monthlyPrice:'',
attributeNames:'',
attributeCodes:'',
housingResource:'',
linkerName:'',
linkerPhone:'',
picUrl:''
},
CITY:[],
XIAN:[],
@ -237,15 +298,15 @@ export default {
},
methods: {
handleSizeChange (val) {
this.queryInfo.pageSize = val
this.queryInfo.size = val
this.getStorehouseList()
},
handleCurrentChange (val) {
this.queryInfo.pageNum = val
this.queryInfo.current = val
this.getStorehouseList()
},
async getStorehouseList () {
const { data: result } = await this.$http.get('/storehouse/list', { params: this.queryInfo })
const { data: result } = await this.$http.get('/v1/shstorehouse/listPage', { params: this.queryInfo },)
if (result.status !== 200) return this.$message.error('获取列表失败')
this.total = result.data.total
@ -255,6 +316,24 @@ export default {
this.title = '新增仓库'
this.storehouseDialogVisible = true
},
async getStorehouseLists () {
const { data: result } = await this.$http.get('/purchase/getStorehouse')
if (result.status !== 200) return this.$message.error('获取仓库列表失败')
this.storehouseLists = result.data
this.storehouseListss = result.data
for (var i = 0; i < this.storehouseLists.length; i++) {
let item = {
name: this.storehouseLists[i].name,
}
this.storeList.push(item)
}
},
getSupplier(value) {
const choose = this.storehouseLists.filter((item) => item.name === value)
this.form.simpleName = choose[0].simpleName
this.form.code = choose[0].addr
},
updataStorehousedialog (storehouse) {
this.storehouseForm.name = storehouse.name
this.storehouseForm.simpleName = storehouse.simpleName
@ -263,14 +342,12 @@ export default {
this.title = '修改仓库'
this.storehouseDialogVisible = true
},
addStorehouse () {
this.$refs.storehouseRuleForm.validate(async valid => {
const { data: result } = await this.$http.post('/storehouse/addStorehouse', this.storehouseForm)
if (result.status !== 200) return this.$message.error('添加仓库失败')
async addStorehouse () {
const { data: result } = await this.$http.post('/v1/shstorehouse/save', this.form)
if (result.code !== 200) return this.$message.error('添加仓库失败')
this.$message.success('成功添加仓库')
this.getStorehouseList()
this.storehouseDialogVisible = false
})
},
async updataStorehouse () {
const { data: result } = await this.$http.put('/storehouse/updataStorehouse', this.storehouseForm)
@ -307,10 +384,10 @@ export default {
subdistrict:3 //
}
}).then((res)=>{
this.form.provinceList = res.data.districts[0].districts /* 省*/
this.provinceList = res.data.districts[0].districts /* 省*/
/* 进行遍历赋值*/
/* 市区和县区*/
let newProvince = this.form.provinceList
let newProvince = this.provinceList
for(let i = 0; i < newProvince.length; i++){ /* 省级*/
for(let j = 0; j < newProvince[i].districts.length; j++){ /* 市级*/
let city = newProvince[i].districts[j].name
@ -324,58 +401,82 @@ export default {
for(let m = 0; m < newProvince.length;m++){
newProvince[m] = {...newProvince[m],...{code:m+1}}
}
this.form.provinceList = newProvince
this.provinceList = newProvince
})
},
provinceChange(that){
//
this.form.region2=''
this.form.region3=''
if(this.form.region2==='' || this.form.region3===''){
this.form.cityName=''
this.form.countyName=''
if(this.form.cityName==='' || this.form.countyName===''){
this.changeCounty=true
}
let cityCode = 0
let newCityArry = []
this.form.provinceList.forEach((item,index)=>{
this.provinceList.forEach((item,index)=>{
if(item.name == that){
cityCode = item.code
}
})
// console.log(cityCode)
if(cityCode){
this.form.cityList = []
this.cityList = []
this.CITY.forEach((item,index)=>{
if(item.code == cityCode){
this.form.cityList.push(item)
this.cityList.push(item)
this.changeCity=false
}
}) /* 市匹配成功*/
}
},
cityChange(that){
this.form.region3=''
this.form.countyName=''
let countyCode = 0
let cityname = ''
let newCountyArry = []
this.form.cityList.forEach((item,index)=>{
this.cityList.forEach((item,index)=>{
if(item.name == that){
countyCode = item.id
cityname = item.name
}
})
if(countyCode){
this.form.countyList = []
this.countyList = []
this.XIAN.forEach((item,index)=>{
if(item.code == countyCode && item.cityCountyName == cityname){
this.form.countyList.push(item)
this.countyList.push(item)
this.changeCounty=false
}
})
}
},
handleSuccess(resp, file, fileList) {
this.fileList = []
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: '导入成功'
})
} else {
this.$message({
showClose: true,
type: 'error',
message: resp.msg
})
}
},
handleProgress(event, file, fileList) {
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }`);
}
},
mounted () {
this.getStorehouseList()
this.getStorehouseLists()
// this.getStoreList()
this.getMap()
},
}

149
warehousing-system/project_web/src/components/instorehouse/purchase.vue

@ -3,14 +3,12 @@
<el-card class="box-card">
<el-row :gutter="10">
<el-col :span="15">
<el-input clearable v-model="queryInfo.query" placeholder="请输入订单编号" prefix-icon="el-icon-search" >
<el-input clearable v-model="queryInfo.params.purchaseNo" placeholder="请输入订单编号" prefix-icon="el-icon-search" >
<el-button slot="append" icon="el-icon-search" @click="getPurchaseList"></el-button>
</el-input>
</el-col>
<el-col :span="9">
<el-button type="primary" @click="openAddPurchaseDialog" icon = "el-icon-circle-plus" >新增</el-button>
<el-button type="success" @click="check" icon = "el-icon-success">审核</el-button>
<el-button type="danger" @click="cancel" icon = "el-icon-error">撤销审核</el-button>
</el-col>
</el-row>
<el-table :data="purchaseList.slice((queryInfo.current-1)*queryInfo.size,queryInfo.current*queryInfo.size)"
@ -18,13 +16,8 @@
stripe
border
fixed
height="500"
@selection-change="handleSelectionChange">
<el-table-column
fixed="left"
type="selection"
width="55">
</el-table-column>
height="500">
<el-table-column label="序号" type="index" width="60" :index="indexMethod" align="center" />
<el-table-column
prop="custName"
label="客户名称"
@ -85,52 +78,6 @@
</el-card>
<!-- <el-dialog title="添加采购订单" :visible.sync="addPurchaseDialogVisible" width="75%">
<el-form :model="purchaseForm" :rules="rules" ref="addPurchaseRuleForm" label-width="100px" class="demo-ruleForm" :inline="true">
<el-form-item label="订单编号" prop="purchaseId">
<el-input :disabled="true" v-model="purchaseForm.purchaseId"></el-input>
</el-form-item>
<el-form-item label="商品名称" prop="product">
<el-select v-model="purchaseForm.product" placeholder="请选择" >
<el-option
v-for="product in productList"
:key="product.name"
:label="product.name"
:value="product.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="supplier">
<el-select v-model="purchaseForm.supplier" placeholder="请选择" >
<el-option
v-for="supplier in supplierList"
:key="supplier.name"
:label="supplier.name"
:value="supplier.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属仓库" prop="storehouse">
<el-select v-model="purchaseForm.storehouse" placeholder="请选择" >
<el-option
v-for="storehouse in storehouseList"
:key="storehouse.name"
:label="storehouse.name"
:value="storehouse.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品数量" prop="count">
<el-input v-model="purchaseForm.count"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="addPurchaseDialogVisible = false"> </el-button>
<el-button type="primary" @click="addPurchase"> </el-button>
</div>
</el-dialog> -->
<el-dialog title="添加采购订单" :visible.sync="addPurchaseDialogVisible" width="75%">
<div class="listconadd">
@ -147,7 +94,8 @@
<el-col :span="4">
<el-form-item class="trightb_item">
<!-- <span>{{temp.bankName}}</span> -->
<el-input v-model="purchaseForm.purchaseDate" placeholder="" clearable />
<el-date-picker v-model="purchaseForm.purchaseDate" type="date" style="width: 100%;"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择" />
</el-form-item>
</el-col>
<el-col :span="3" class="trightb">
@ -235,7 +183,7 @@
<el-table :data="purchaseForm.products" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="商品名称" width="120" prop="proName" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.proName" placeholder="请选择" >
@ -275,19 +223,19 @@
<el-input v-model="scope.row.proModel" placeholder="" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="数量" width="100" prop="estimateNum" align="center">
<el-table-column label="单价" width="140" prop="estimateConfirmedPrice" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.estimateNum" @change="getLists" placeholder="" clearable></el-input>
<el-input v-model="scope.row.estimateConfirmedPrice" @input="limitInput1($event,scope.$index)" placeholder="" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="单价" width="140" prop="estimateConfirmedPrice" align="center">
<el-table-column label="数量" width="100" prop="estimateNum" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.estimateConfirmedPrice" @change="getList" placeholder="" clearable></el-input>
<el-input v-model="scope.row.estimateNum" @input="limitInput2($event,scope.$index)" placeholder="" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="总价值" width="120px" prop="estimateCalculatedValue" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.estimateCalculatedValue" :readonly="true" placeholder="" clearable></el-input>
<el-input v-model="scope.row.estimateCalculatedValue" @input="limitInput3($event,scope.$index)" :readonly="true" placeholder="" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="规格单位" width="130" prop="proUnit" align="center">
@ -356,7 +304,7 @@ export default {
current: 1,
size: 10,
params: {
purchaseNo:''
}
},
total: 0,
@ -402,7 +350,6 @@ export default {
}
},
created(){
this.heji()
},
methods: {
handleSizeChange (val) {
@ -414,7 +361,12 @@ export default {
this.queryInfo.current = val
this.getPurchaseList()
},
//
indexMethod(index) {
var pagestart = (this.queryInfo.current - 1) * this.queryInfo.size
var pageindex = index + 1 + pagestart
return pageindex
},
async getPurchaseList () {
const { data: result } = await this.$http.post('/purchasenew/listPage', { params: this.queryInfo })
if (result.code == 200){
@ -465,6 +417,7 @@ export default {
this.purchaseForm.purchaseNo = 'IP' + now.getTime()
console.log('IP' + now.getTime())
if (this.productList2.length == 0) this.productList2 = this.productList
this.add()
},
async getSupplierList () {
@ -488,17 +441,18 @@ export default {
},
async deletePurchase (purchase) {
if (purchase.status !== '待审核') return this.$message.error('订单' + purchase.purchaseNo + '进行中')
const sids = []
sids.push(purchase.sid)
const result = await this.$confirm('此操作将永久删除订单' + purchase.purchaseNo + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(error => error)
if (result !== 'confirm') return this.$message.info('用户取消操作')
const { data: resultDB } = await this.$http.delete(`/purchase/delete/${purchase.purchaseNo}`)
if (resultDB.status !== 200) return this.$message.error('删除订单失败')
this.getPurchaseList()
const { data: resultDB } = await this.$http.post('/purchasenew/delBySids', sids)
if (resultDB.code == 200)
this.$message.success('订单删除成功')
this.getPurchaseList()
},
async open (purchase) {
@ -507,15 +461,8 @@ export default {
const _this = this
const { data: result } = await this.$http.get(`/purchasenew/fetchDetailsBySid/${purchase.sid}`)
if (result.code==200) {
// _this.purchaseForm.purchaseDate=result.data.purchaseDate
// _this.purchaseForm.purchaseNo=result.data.purchaseNo
// _this.purchaseForm.supplierName=result.data.supplierName
// _this.purchaseForm.purchasePerson=result.data.purchasePerson
// _this.purchaseForm.custName=result.data.custName
// _this.purchaseForm.storehouseName=result.data.storehouseName
_this.purchaseForm=result.data
}
// if (this.productList2.length == 0) this.productList2 = this.productList
},
checkUpdataPurchase () {
this.$refs.updataPurchaseRuleForm.validate(validate => {
@ -588,18 +535,44 @@ export default {
this.purchaseForm.products.splice(index, 1);
})
},
getList(value){
this.pirce=value
console.log(this.pirce);
},
getLists(value){
this.num=value
},
heji(){
if(this.pirce && this.num){
console.log(666);
getLists(){
let arrList=this.purchaseForm.products
for(let i=0;i<arrList.length;i++){
if(arrList[i].estimateNum && arrList[i].estimateConfirmedPrice){
let newValue=parseFloat(arrList[i].estimateNum) * parseFloat(arrList[i].estimateConfirmedPrice) || 0
this.$set(arrList[i], 'estimateCalculatedValue', newValue)
}else{
this.$set(arrList[i], 'estimateCalculatedValue', '')
}
}
}
},
limitInput1(value, index) {
this.purchaseForm.products[index].estimateConfirmedPrice =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
this.getLists()
},
limitInput2(value, index) {
this.purchaseForm.products[index].estimateNum =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
this.getLists()
},
limitInput3(value, index) {
this.purchaseForm.products[index].estimateCalculatedValue =
("" + value) //
.replace(/[^\d^\.]+/g, "") //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || ""; // 02
this.getLists()
},
},
mounted () {

4
warehousing-system/project_web/src/plugins/element.js

@ -42,7 +42,8 @@ import {
InputNumber,
Footer,
Collapse,
CollapseItem
CollapseItem,
DatePicker
} from 'element-ui'
Vue.use(Button)
@ -86,6 +87,7 @@ Vue.use(InputNumber)
Vue.use(Footer)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.use(DatePicker)
// 将弹框组件挂载到Vue对象中 用户可以使用this关键字调用
Vue.prototype.$message = Message

Loading…
Cancel
Save