Merge branch 'gyq' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
@@ -416,3 +416,20 @@ export function isPcBowser() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保留小数n位,不进行四舍五入
|
||||||
|
* num你传递过来的数字,
|
||||||
|
* decimal你保留的几位,默认保留小数后两位
|
||||||
|
*/
|
||||||
|
export function formatDecimal(num, decimal = 2) {
|
||||||
|
num = num.toFixed(3).toString();
|
||||||
|
const index = num.indexOf(".");
|
||||||
|
if (index !== -1) {
|
||||||
|
num = num.substring(0, decimal + index + 1);
|
||||||
|
} else {
|
||||||
|
num = num.substring(0);
|
||||||
|
}
|
||||||
|
//截取后保留两位小数
|
||||||
|
return parseFloat(num).toFixed(decimal);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
<!-- 新增库存盘点 -->
|
<!-- 新增库存盘点 -->
|
||||||
<template>
|
<template>
|
||||||
<el-dialog title="库存盘点" :visible.sync="dialogVisible">
|
<el-dialog title="库存盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
||||||
<el-form-item label="账存数量">
|
<el-form-item label="账存数量">
|
||||||
<el-input v-model="detail.stockNumber" readonly></el-input>
|
<el-input v-model="detail.stockNumber" readonly style="width: 180px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="实际数量" prop="stocktakinNum">
|
<el-form-item label="实际数量">
|
||||||
<el-input-number v-model="form.stocktakinNum"></el-input-number>
|
<el-input-number v-model="form.stocktakinNum" :min="0" :step="1" step-strictly
|
||||||
|
style="width: 180px;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="盈亏数量">
|
<el-form-item label="盈亏数量">
|
||||||
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"></el-input>
|
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
|
||||||
|
style="width: 180px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单价">
|
<el-form-item label="单价">
|
||||||
<el-input v-model="detail.salePrice" readonly></el-input>
|
<el-input v-model="detail.salePrice" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="盈亏金额">
|
<el-form-item label="盈亏金额">
|
||||||
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"></el-input>
|
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
|
||||||
|
style="width: 180px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.note" placeholder="请输入备注"></el-input>
|
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
@@ -44,14 +47,14 @@
|
|||||||
¥{{ scope.row.price }}
|
¥{{ scope.row.price }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="库存" prop="stock"></el-table-column>
|
<el-table-column label="帐存库存" prop="stock"></el-table-column>
|
||||||
<el-table-column label="盈亏数量" prop="phaseNum"></el-table-column>
|
<el-table-column label="盈亏数量" prop="phaseNum"></el-table-column>
|
||||||
<el-table-column label="盈亏金额" prop="phasePrice">
|
<el-table-column label="盈亏金额" prop="phasePrice">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
¥{{ scope.row.phasePrice }}
|
¥{{ scope.row.phasePrice }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="盘点数量" prop="inventoryStock"></el-table-column>
|
<el-table-column label="实际库存" prop="inventoryStock"></el-table-column>
|
||||||
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||||
<el-table-column label="盘点备注" prop="note"></el-table-column>
|
<el-table-column label="盘点备注" prop="note"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -63,6 +66,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { formatDecimal } from '@/utils'
|
||||||
import { tbProductStocktakin, tbProductStocktakinGet } from '@/api/invoicing'
|
import { tbProductStocktakin, tbProductStocktakinGet } from '@/api/invoicing'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -109,7 +113,7 @@ export default {
|
|||||||
return this.form.stocktakinNum - this.detail.stockNumber
|
return this.form.stocktakinNum - this.detail.stockNumber
|
||||||
},
|
},
|
||||||
profitPrice() {
|
profitPrice() {
|
||||||
return (this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice
|
return formatDecimal((this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -130,7 +134,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.dialogVisible = false
|
this.loading = false
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +172,7 @@ export default {
|
|||||||
name: this.searhForm.name,
|
name: this.searhForm.name,
|
||||||
skuId: this.searhForm.category,
|
skuId: this.searhForm.category,
|
||||||
productId: this.searhForm.productId,
|
productId: this.searhForm.productId,
|
||||||
sort: 'id',
|
sort: 'id,desc',
|
||||||
})
|
})
|
||||||
this.tableData.list = res.content
|
this.tableData.list = res.content
|
||||||
this.tableData.total = res.totalElements
|
this.tableData.total = res.totalElements
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 新增库存盘点 -->
|
<!-- 新增库存盘点 -->
|
||||||
<AddStockTakin ref="AddStockTakin" @success="getTableData" />
|
<AddStockTakin ref="AddStockTakin" @success="resetHandle" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user