|
@@ -105,7 +105,7 @@
|
|
@cell-click=""
|
|
@cell-click=""
|
|
@edit-closed=""
|
|
@edit-closed=""
|
|
highlight-current-row
|
|
highlight-current-row
|
|
- :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
|
|
|
|
|
|
+ :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
|
|
>
|
|
>
|
|
<vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
|
|
<vxe-table-column field="purchaser" title="采购人" :edit-render="{}" :rules="[{required: true, message:'请选择采购人', trigger:'blur'}]">
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
@@ -129,12 +129,19 @@
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
<vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
|
|
<vxe-table-column field="tradePrice" title="商品单价(元)" :edit-render="{}" :rules="[{required: true, message:'请输入商品单价', trigger:'blur'}]">
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
- <el-input maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
|
|
|
|
|
|
+ <!-- <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @keyup.native="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>-->
|
|
|
|
+ <el-input @change="changeValue" maxlength="15" v-model="scope.row.tradePrice" @blur="scope.row.tradePrice = twoDecimalPlaces(scope.row.tradePrice)"></el-input>
|
|
</template>
|
|
</template>
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
<vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
|
|
<vxe-table-column field="tradeNumber" title="商品数量" :edit-render="{}">
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
- <el-input v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>
|
|
|
|
|
|
+ <!-- <el-input @change="changeValue" v-model="scope.row.tradeNumber" oninput ="value=value.replace(/\D|^0/g,'')" maxlength="10"></el-input>-->
|
|
|
|
+ <el-input @change="changeValue" v-model="scope.row.tradeNumber" @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)" maxlength="10"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-table-column>
|
|
|
|
+ <vxe-table-column field="priceSum" title="商品总价" :edit-render="{}">
|
|
|
|
+ <template v-slot:edit="scope">
|
|
|
|
+ <el-input v-model="scope.row.priceSum" @blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)" maxlength="15"></el-input>
|
|
</template>
|
|
</template>
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
<vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
|
|
<vxe-table-column field="company" title="单位" :edit-render="{}" :rules="[{required: true, message:'请填写单位', trigger:'blur'}]">
|
|
@@ -225,6 +232,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
import MaterialManagementDialog from '../file/MaterialManagementDialog'
|
|
import MaterialManagementDialog from '../file/MaterialManagementDialog'
|
|
import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
|
|
import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
|
|
import MaterialTypePullForm from './MaterialTypePullForm'
|
|
import MaterialTypePullForm from './MaterialTypePullForm'
|
|
@@ -266,6 +274,7 @@
|
|
this.materialManagementService = new MaterialManagementService()
|
|
this.materialManagementService = new MaterialManagementService()
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
|
|
+ SelectTree,
|
|
MaterialTypePullForm,
|
|
MaterialTypePullForm,
|
|
CwProgramPageForm,
|
|
CwProgramPageForm,
|
|
MaterialManagementDialog,
|
|
MaterialManagementDialog,
|
|
@@ -312,22 +321,18 @@
|
|
if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
|
|
this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
|
|
this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
|
|
}
|
|
}
|
|
|
|
+ let i = this.inputForm.detailInfos.length
|
|
|
|
+ for (let j = 0; j < i; j++) {
|
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradePrice)) {
|
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfos[j].tradeNumber)) {
|
|
|
|
+ this.inputForm.detailInfos[j].priceSum = this.inputForm.detailInfos[j].tradePrice * this.inputForm.detailInfos[j].tradeNumber
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
- // this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
|
|
|
|
- // this.inputForm = this.recover(this.inputForm, data)
|
|
|
|
- // this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
|
|
- // this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
|
- // this.loading = false
|
|
|
|
- // })
|
|
|
|
- // this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
|
- // this.inputForm = this.recover(this.inputForm, data)
|
|
|
|
- // this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
|
|
- // this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
|
- // this.loading = false
|
|
|
|
- // })
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -381,6 +386,34 @@
|
|
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
return str
|
|
return str
|
|
},
|
|
},
|
|
|
|
+ twoDecimalPlaces2 (num) {
|
|
|
|
+ let str = num.toString()
|
|
|
|
+ var len1 = str.substr(0, 1)
|
|
|
|
+ var len2 = str.substr(1, 1)
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str.length > 1 && len1 == 0 && len2 != '.') {
|
|
|
|
+ str = str.substr(1, 1)
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (len1 == '.') {
|
|
|
|
+ str = ''
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str.indexOf('.') != -1) {
|
|
|
|
+ var str_ = str.substr(str.indexOf('.') + 1)
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str_.indexOf('.') != -1) {
|
|
|
|
+ str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
|
|
|
|
+ }
|
|
|
|
+ if (str_.length > 2) {
|
|
|
|
+ this.$message.warning(`商品数量小数点后只能输入两位,请正确输入!`)
|
|
|
|
+ return (str = '')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line no-useless-escape
|
|
|
|
+ str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
|
+ return str
|
|
|
|
+ },
|
|
// 采购人下拉弹窗
|
|
// 采购人下拉弹窗
|
|
userPullListForm (rowIndex) {
|
|
userPullListForm (rowIndex) {
|
|
this.indexRow = rowIndex
|
|
this.indexRow = rowIndex
|
|
@@ -392,10 +425,9 @@
|
|
if (columnIndex === 0) {
|
|
if (columnIndex === 0) {
|
|
return '商品总价'
|
|
return '商品总价'
|
|
}
|
|
}
|
|
- if (['tradePrice'].includes(column.property)) {
|
|
|
|
|
|
+ if (['priceSum'].includes(column.property)) {
|
|
// eslint-disable-next-line no-undef
|
|
// eslint-disable-next-line no-undef
|
|
this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
|
|
this.inputForm.tradeTotalPrice = XEUtils.sum(data, column.property)
|
|
- console.log('this.inputForm.tradeTotalPrice', this.inputForm.tradeTotalPrice)
|
|
|
|
return XEUtils.sum(data, column.property)
|
|
return XEUtils.sum(data, column.property)
|
|
}
|
|
}
|
|
return null
|
|
return null
|