快速修改价格
This commit is contained in:
@@ -72,6 +72,17 @@ export function savePrice(price, num1, num2, num3, num4, num5) {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 实时保存备注
|
||||
export function saveRemark(price, num1, num2, num3, num4, num5) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '4',
|
||||
name: `update 采购管理_询价单明细_视图 set 备注 = ${price} where isnull(物料流水号,0) = isnull('${num1}',0) and 询价单流水号 = ${num2} and isnull(零件名称,'') = '${num3}' and isnull(零件图号,'') = '${num4}' and (isnull(规格,'') = '${num5}' or isnull(物料规格,'') = '${num5}')`
|
||||
}
|
||||
})
|
||||
}
|
||||
// 实时保存合同头
|
||||
export function saveContractHeader(...params) {
|
||||
return request({
|
||||
|
||||
@@ -72,24 +72,30 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-col :span="21">
|
||||
<el-form-item label="其他说明:">
|
||||
<el-input v-model="otherInfo" :disabled="!contractNumValue" size="small" type="textarea" rows="1" @blur="contractHeaderChange"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-button v-if="quickChangePrice" size="mini" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">快速修改价格</el-button>
|
||||
<el-button v-else size="mini" style="margin: 10px 0 0 10px" @click="quickChangePrice=!quickChangePrice">还原</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-table :data="tableData1" border style="margin: 10px 0;max-height: 480px;" height="480px" size="mini" show-summary>
|
||||
<el-table :data="tableData1" border style="margin: 10px 0;max-height: 480px;" height="480px" size="mini" show-summary tooltip-effect="dark">
|
||||
<el-table-column label="序号" align="center" width="50" type="index"/>
|
||||
<el-table-column label="交货期" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker
|
||||
v-if="quickChangePrice"
|
||||
v-model="scope.row.交货期"
|
||||
size="mini"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width:100%"/>
|
||||
<b v-else>{{ scope.row.交货期.split(' ')[0] || '—' }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机床图号" align="center" min-width="100">
|
||||
@@ -97,7 +103,7 @@
|
||||
{{ scope.row.机床图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="组号" align="center" min-width="80">
|
||||
<el-table-column label="组号" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.组号 }}
|
||||
</template>
|
||||
@@ -107,7 +113,7 @@
|
||||
{{ scope.row.名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图号或型号" align="center" min-width="150">
|
||||
<el-table-column label="图号或型号" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.图号 ? scope.row.图号 : '—' }}
|
||||
</template>
|
||||
@@ -122,20 +128,20 @@
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" width="80">
|
||||
<el-table-column label="单位" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计量单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-show="hasTax==='未税'" label="单价(未税)" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-show="hasTax==='未税'" :min="0" v-model="scope.row.未税单价" controls-position="right" size="mini" style="width:100%" @focus="scope.row.未税单价=''" @change="priceChange(scope.row.未税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
|
||||
<el-input-number v-show="hasTax==='未税'" :min="0" v-model="scope.row.未税单价" controls-position="right" size="mini" style="width:100%" @change="priceChange(scope.row.未税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
|
||||
<b v-show="hasTax!=='未税'">—</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-show="hasTax==='含税'" label="单价(含税)" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-show="hasTax==='含税'" :min="0" v-model="scope.row.含税单价" controls-position="right" size="mini" style="width:100%" @focus="scope.row.含税单价=''" @change="priceChange(scope.row.含税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
|
||||
<el-input-number v-show="hasTax==='含税'" :min="0" v-model="scope.row.含税单价" controls-position="right" size="mini" style="width:100%" @change="priceChange(scope.row.含税单价, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
|
||||
<b v-show="hasTax!=='含税'">—</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -149,9 +155,10 @@
|
||||
{{ hasTax==='含税' ? scope.row.含税总额 = (Number(scope.row.数量) * Number(scope.row.含税单价)).toFixed(2) : scope.row.含税总额 = (scope.row.未税总额 * (1+taxRate)).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" width="80">
|
||||
<el-table-column label="备注" align="center" min-width="80" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
<el-input v-if="quickChangePrice" v-model="scope.row.备注" size="mini" style="width:100%" @change="remarkChange(scope.row.备注, scope.row.物料流水号, scope.row.询价单流水号, scope.row, scope.row.零件名称, scope.row.零件图号, scope.row.规格)"/>
|
||||
<b v-else>{{ scope.row.备注 || '—' }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -185,7 +192,7 @@
|
||||
|
||||
<script>
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo, savePrice, saveContractHeader, searchContractHeader } from '@/api/PurchasingCenter/CreatePurchaseContract'
|
||||
import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo, savePrice, saveContractHeader, searchContractHeader, saveRemark } from '@/api/PurchasingCenter/CreatePurchaseContract'
|
||||
import { convertCurrency } from '@/vendor/int2Chinese'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { sleep, groupBy } from '@/utils/tool'
|
||||
@@ -196,6 +203,7 @@ export default {
|
||||
inject: ['reload'],
|
||||
data() {
|
||||
return {
|
||||
quickChangePrice: true,
|
||||
supplier: [],
|
||||
year: '',
|
||||
month: '',
|
||||
@@ -270,6 +278,37 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
// 备注实时保存
|
||||
remarkChange(remark, num1, num2, row, num3, num4, num5) {
|
||||
this.tableData1.map(v => {
|
||||
v.物料流水号 = v.物料流水号 || ''
|
||||
v.零件名称 = v.零件名称 || ''
|
||||
v.零件图号 = v.零件图号 || ''
|
||||
v.规格 = v.规格 || ''
|
||||
row.物料流水号 = row.物料流水号 || ''
|
||||
row.零件名称 = row.零件名称 || ''
|
||||
row.零件图号 = row.零件图号 || ''
|
||||
row.规格 = row.规格 || ''
|
||||
if (Number(v.物料流水号) === Number(row.物料流水号) && Number(v.询价单流水号) === Number(row.询价单流水号) && v.零件名称 === row.零件名称 && v.零件图号 === row.零件图号 && v.规格 === row.规格) {
|
||||
v.备注 = row.备注
|
||||
}
|
||||
})
|
||||
const group = this.tableData1
|
||||
this.tableData1 = []
|
||||
this.tableData1 = group
|
||||
remark = remark || ''
|
||||
num1 = num1 || ''
|
||||
num3 = num3 || ''
|
||||
num4 = num4 || ''
|
||||
num5 = num5 || ''
|
||||
saveRemark(remark, num1, num2, num3, num4, num5).then(res => {
|
||||
if (res.data[0].result === '1') {
|
||||
console.log('备注实时保存成功')
|
||||
} else {
|
||||
console.log('备注实时保存失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 价格实时保存
|
||||
priceChange(price, num1, num2, row, num3, num4, num5) {
|
||||
this.tableData1.map(v => {
|
||||
|
||||
@@ -355,6 +355,8 @@
|
||||
</el-tooltip>
|
||||
<el-input v-model="taxRate" style="float:right;width:100px" placeholder="税率" size="mini"/>
|
||||
<h4 style="float:right;width: 40px;margin: 5px">税率:</h4>
|
||||
<el-button v-if="quickChangePrice" size="mini" style="float:right;" @click="quickChangePrice=!quickChangePrice">快速修改价格</el-button>
|
||||
<el-button v-else size="mini" style="float:right;" @click="quickChangePrice=!quickChangePrice">还原</el-button>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData3" :summary-method="getSummaries" border style="max-height: 500px;" height="500px" size="mini" show-summary>
|
||||
<el-table-column label="离线合同编号" align="center" min-width="150">
|
||||
@@ -369,17 +371,18 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="物料规格" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料规格 }}
|
||||
{{ scope.row.物料规格 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料型号" align="center" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料型号 }}
|
||||
{{ scope.row.物料型号 || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
|
||||
<el-input v-if="quickChangePrice" v-model="scope.row.数量" :disabled="disable" size="mini" style="width:70px"/>
|
||||
<b v-else>{{ scope.row.数量 }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" min-width="100">
|
||||
@@ -416,12 +419,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="交货期要求" align="center" min-width="100" prop="交货期要求">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.交货期要求" :disabled="disable" size="mini" style="width:70px"/>
|
||||
<el-input v-if="quickChangePrice" v-model="scope.row.交货期要求" :disabled="disable" size="mini" style="width:70px"/>
|
||||
<b v-else>{{ scope.row.交货期要求 || '—' }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" min-width="150" prop="备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.备注" :disabled="disable" size="mini" style="width:120px"/>
|
||||
<el-input v-if="quickChangePrice" v-model="scope.row.备注" :disabled="disable" size="mini" style="width:120px"/>
|
||||
<b v-else>{{ scope.row.备注 || '—' }}</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="disable" label="到货数量" align="center" min-width="100">
|
||||
@@ -431,7 +436,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button>
|
||||
<el-button v-if="quickChangePrice" :disabled="disable" type="danger" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)">移除</el-button>
|
||||
<b v-else>移除</b>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -692,6 +698,7 @@ export default {
|
||||
name: '', // 离线合同
|
||||
data() {
|
||||
return {
|
||||
quickChangePrice: true,
|
||||
hasTax: '含税',
|
||||
taxRate: 0.13,
|
||||
source: [
|
||||
|
||||
Reference in New Issue
Block a user