This commit is contained in:
liushuai
2020-03-16 17:58:23 +08:00
parent c1257f77ea
commit 325f8deb57
6 changed files with 58 additions and 12 deletions

View File

@@ -124,9 +124,9 @@
{{ scope.row.总数量 }}
</template>
</el-table-column>
<el-table-column label="采购总数量" align="center" width="115px">
<el-table-column label="采购总数量" align="center" width="135px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 90px"/>
<el-input-number v-model="scope.row.采购总数量" :min="0" size="mini" style="width: 100%"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="120">

View File

@@ -23,6 +23,9 @@
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 10px" plain @click="PageSize = 30;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-tooltip v-show="true" :open-delay="1000" effect="dark" content="导出合同执行情况" placement="top">
<el-button type="primary" plain class="el-icon-download" size="small" style="margin: 10px 0 0 300px" @click="exportExcel">导出</el-button>
</el-tooltip>
</el-row>
</el-card>
<el-card>
@@ -777,6 +780,32 @@ export default {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
this.getSelect(selectProvince, ['省份', '省份流水号'], 'Province')
},
exportExcel() {
if (this.customerName1 === '' || this.customerName1 === null) { this.customerName1_check = 0 } else { this.customerName1_check = 1 }
if (this.entryNameValue === '' || this.entryNameValue === null) { this.entryNameValue_check = 0 } else { this.entryNameValue_check = 1 }
if (this.MarketingManagerValue === '' || this.MarketingManagerValue === null) { this.peopleid_check = 0 } else { this.peopleid_check = 1 }
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
if (this.machine === '' || this.machine === null) { this.machine_check = 0 } else { this.machine_check = 1 }
this.ExecutionProgressShow = false
this.uploader = false
this.ExecutionProgress = null
// this.listLoading = true
var param = []
param[0] = ['项目流水号_check', this.entryNameValue_check]
param[1] = ['合同ID', this.entryNameValue]
param[2] = ['客户名称_check', this.customerName1_check]
param[3] = ['客户名称', this.customerName1]
param[4] = ['开始日期_check', this.check1]
param[5] = ['开始日期', this.dateRange[0]]
param[6] = ['结束日期_check', this.check1]
param[7] = ['结束日期', this.dateRange[1]]
param[8] = ['营销经理流水号_check', 0]
param[9] = ['机床型号_check', 0]
var Data = this.CreateData('2001', '报表_合同执行查询', param)
this.exportExcel_NPOI(Data)
},
openName() {
this.dialogFormVisiblePeople = true
this.ProvinceValue = ''

View File

@@ -184,12 +184,12 @@
</el-table-column>
<el-table-column label="库存(BZ)" align="center" width="80" prop="库存">
<template slot-scope="scope">
{{ scope.row.货位存量 - scope.row.占用数量 }}
{{ (scope.row.货位存量 ? scope.row.货位存量 : 0) - scope.row.占用数量 }}
</template>
</el-table-column>
<el-table-column label="使用库存数量" align="center" width="145" prop="使用库存数">
<template slot-scope="scope">
<template v-if="scope.row.库存 === '0'">
<template v-if="((scope.row.货位存量 ? scope.row.货位存量 : 0) - scope.row.占用数量) === 0">
</template>
<el-input-number v-else v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 130px" @change="changeNumber(scope.row)"/>

View File

@@ -102,8 +102,8 @@
</el-table-column>
<el-table-column label="使用库存数量" align="center" width="105" prop="使用库存数">
<template slot-scope="scope">
<span v-if="Number(scope.row.零件类型) !== 1">-</span>
<el-input-number v-if="Number(scope.row.零件类型) === 1" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
<span v-if="Number(scope.row.零件类型) !== 1 || (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) === 0">-</span>
<el-input-number v-if="Number(scope.row.零件类型) === 1 && (Number(scope.row.货位存量 ? scope.row.货位存量 : 0) - Number(scope.row.占用数量)) !== 0" v-model="scope.row.使用库存数" :min="0" :max="Number(scope.row.零件数量) > (Number(scope.row.货位存量) - Number(scope.row.占用数量)) ? (Number(scope.row.货位存量) - Number(scope.row.占用数量) + Number(scope.row.使用库存数)) : Number(scope.row.零件数量)" :disabled="(Number(scope.row.货位存量) - Number(scope.row.占用数量)) === 0 || parseInt(scope.row.采购状态编号)===3" size="mini" style="width: 90px" @change="changeNumber(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="待采数量" align="center" width="80" prop="待采购数量">

View File

@@ -52,8 +52,8 @@
width="50"/>
<el-table-column align="center" label="物料" min-width="70">
<template slot-scope="scope">
<span v-if="scope.row.物料流水号===null" type="warning" size="mini" style="margin: 0px">不存在</span>
<span v-if="scope.row.物料流水号!==null" type="primary" size="mini" style="margin: 0px">存在</span>
<el-tag v-if="scope.row.物料流水号===null" type="warning" size="mini" style="margin: 0px">不存在</el-tag>
<el-tag v-if="scope.row.物料流水号!==null" type="primary" size="mini" style="margin: 0px">存在</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="图号" min-width="100" show-overflow-tooltip>

View File

@@ -50,12 +50,12 @@
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="单价" width="100px">
<el-table-column align="center" label="单价(元)" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.单价" size="mini" width="80px" align="center" @change="update(scope.row)"/>
<el-input v-model="scope.row.单价" size="mini" width="80px" align="center" @blur="filterNuber(scope.row.单价, scope.$index, '单价', scope.row)"/>
</template>
</el-table-column>
<el-table-column align="center" label="总额" width="70px">
<el-table-column align="center" label="总额(元)" width="90px">
<template slot-scope="scope">
{{ Number(scope.row.金额).toFixed(2) }}
</template>
@@ -116,6 +116,23 @@ export default {
}
})
},
filterNuber(val, index, date, row) {
let value = '' + val
value = value
.replace(/[^\d.]/g, '') // 清除“数字”和“.”以外的字符
.replace(/\.{2,}/g, '.') // 只保留第一个. 清除多余的
.replace('.', '$#$')
.replace(/\./g, '')
.replace('$#$', '.')
.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数
if (value.indexOf('.') < 0 && value !== '') {
value = parseFloat(value).toFixed(2)
}
console.log(value)
this.tableData[index][date] = value
this.tableData[index]['金额'] = value * row.数量
this.update(row)
},
searchTable() {
this.loading = true
this.tableData = []
@@ -152,7 +169,7 @@ export default {
console.log(response, 1111)
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.searchTable()
// this.searchTable()
} else {
this.$message.error('编辑失败')
}