|
@@ -147,7 +147,30 @@
|
|
<Table :columns="tableColumns"
|
|
<Table :columns="tableColumns"
|
|
border
|
|
border
|
|
:data="tableData">
|
|
:data="tableData">
|
|
-
|
|
|
|
|
|
+ <template slot="numberSet" slot-scope="{row , index }">
|
|
|
|
+ <Tooltip
|
|
|
|
+ placement="left"
|
|
|
|
+ @on-popper-show="handleToolShow(index, row)"
|
|
|
|
+ >
|
|
|
|
+ <div slot="content">
|
|
|
|
+ <div>
|
|
|
|
+ <div v-for="(_item,_index) in warehouse" :key="_index">
|
|
|
|
+ {{_item.warehouse_title}}:{{_item.num}}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <Input
|
|
|
|
+ type="text"
|
|
|
|
+ v-show="!isCheck"
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="tableData[index].num"
|
|
|
|
+ placeholder="数量"
|
|
|
|
+ on-change="changenum"
|
|
|
|
+ >
|
|
|
|
+ </Input>
|
|
|
|
+ <span v-show="isCheck">{{ tableData[index].num }}</span>
|
|
|
|
+ </Tooltip>
|
|
|
|
+ </template>
|
|
<template slot="setSlot"
|
|
<template slot="setSlot"
|
|
slot-scope="{row,index}">
|
|
slot-scope="{row,index}">
|
|
<a style="margin:0 5px"
|
|
<a style="margin:0 5px"
|
|
@@ -394,26 +417,26 @@ export default {
|
|
},
|
|
},
|
|
{ title: '计量单位', key: 'unit', align: 'center', minWidth: 100 },
|
|
{ title: '计量单位', key: 'unit', align: 'center', minWidth: 100 },
|
|
{
|
|
{
|
|
- title: '采购数量', key: 'num', align: 'center', minWidth: 120,
|
|
|
|
- render: (h, params) => {
|
|
|
|
- const { row, index } = params
|
|
|
|
- const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
|
|
|
|
- return this.isCheck ? h('span', {}, currentRow.num) : h('Input', {
|
|
|
|
- props: {
|
|
|
|
- value: currentRow.num,
|
|
|
|
- type: 'text'
|
|
|
|
- },
|
|
|
|
- on: {
|
|
|
|
- 'on-change': (e) => {
|
|
|
|
- currentRow.num = e.target.value
|
|
|
|
- currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
|
- currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
|
- currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
|
- this.tableData.splice(index, 1, currentRow);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ title: '采购数量', key: 'num', align: 'center', minWidth: 120,slot:"numberSet"
|
|
|
|
+ // render: (h, params) => {
|
|
|
|
+ // const { row, index } = params
|
|
|
|
+ // const currentRow = JSON.parse(JSON.stringify(this.tableData[index]))
|
|
|
|
+ // return this.isCheck ? h('span', {}, currentRow.num) : h('Input', {
|
|
|
|
+ // props: {
|
|
|
|
+ // value: currentRow.num,
|
|
|
|
+ // type: 'text'
|
|
|
|
+ // },
|
|
|
|
+ // on: {
|
|
|
|
+ // 'on-change': (e) => {
|
|
|
|
+ // currentRow.num = e.target.value
|
|
|
|
+ // currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
|
+ // currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
|
+ // currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
|
+ // this.tableData.splice(index, 1, currentRow);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '无税单价', key: 'no_tax_price', align: 'center', minWidth: 120,
|
|
title: '无税单价', key: 'no_tax_price', align: 'center', minWidth: 120,
|
|
@@ -566,6 +589,7 @@ export default {
|
|
modal_supplier_page_size: 10,
|
|
modal_supplier_page_size: 10,
|
|
modal_supplier_total: 0,
|
|
modal_supplier_total: 0,
|
|
currentChoose: {},
|
|
currentChoose: {},
|
|
|
|
+ warehouse:'',
|
|
modalProjectTableColumns: [
|
|
modalProjectTableColumns: [
|
|
{
|
|
{
|
|
title: '选择', key: '', align: 'center', minWidth: 60,
|
|
title: '选择', key: '', align: 'center', minWidth: 60,
|
|
@@ -722,6 +746,31 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ changenum(e){
|
|
|
|
+ currentRow.num = e.target.value
|
|
|
|
+ currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
|
|
|
|
+ currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
|
|
|
|
+ currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
|
|
|
|
+ this.tableData.splice(index, 1, currentRow);
|
|
|
|
+ },
|
|
|
|
+ handleToolShow(index, row) {
|
|
|
|
+ if (this.warehouse) {
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.axios
|
|
|
|
+ .get("/api/warehouse_stock_number", {
|
|
|
|
+ params: {
|
|
|
|
+ material_id: row.material_id,
|
|
|
|
+ material_detail_id: row.material_detail_id,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.warehouse= res.data
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // this.warehouse.num = this.warehouseTotal[index].num;
|
|
|
|
+ // this.warehouse.warehouseName = this.warehouseTotal[index].warehouseName
|
|
|
|
+ },
|
|
initData (purchase_order_no) {
|
|
initData (purchase_order_no) {
|
|
this.axios({
|
|
this.axios({
|
|
method: 'get',
|
|
method: 'get',
|
|
@@ -800,6 +849,7 @@ export default {
|
|
type,
|
|
type,
|
|
title: '参照请购单',
|
|
title: '参照请购单',
|
|
then: (result, data) => {
|
|
then: (result, data) => {
|
|
|
|
+ console.log(result)
|
|
result.forEach(element => {
|
|
result.forEach(element => {
|
|
element.num = 0
|
|
element.num = 0
|
|
element.no_tax_price = 0
|
|
element.no_tax_price = 0
|