|
|
@@ -23,6 +23,10 @@
|
|
|
<span style="font-size:13px;">{{ scope.row.stock?parseFloat(scope.row.stock):0 }}</span>
|
|
|
</template>
|
|
|
|
|
|
+ <template #table-column-showUsePrice="{ scope }">
|
|
|
+ <el-input v-model="scope.row.showUsePrice" placeholder="价格"></el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #table-column-bigCount="{ scope }">
|
|
|
<el-input v-model="scope.row.bigCount" placeholder="数量"></el-input>
|
|
|
</template>
|
|
|
@@ -41,9 +45,9 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
- name: 'loan-item',
|
|
|
+ name: 'simple-item',
|
|
|
props: {
|
|
|
- currentData: {
|
|
|
+ simpleData: {
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
|
}
|
|
|
@@ -78,25 +82,33 @@ export default {
|
|
|
this.showArea = false;
|
|
|
},
|
|
|
confirmAdd(info){
|
|
|
-
|
|
|
+ if(Number(info.bigCount)<=0){
|
|
|
+ this.$message.error('请填写数量')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let showUsePrice = Number(info.showUsePrice)>0 ? info.showUsePrice: 100
|
|
|
+ let data = [{id:info.id,bigCount:info.bigCount,price:showUsePrice}]
|
|
|
+ this.$service.orderItem.addItem({data:JSON.stringify(data),id:this.simpleData.id}).then(res => {
|
|
|
+ this.$notify({ title: '添加成功', message: '', type: 'success'})
|
|
|
+ this.$emit('renewArrival',this.simpleData)
|
|
|
+ this.closeFn()
|
|
|
+ })
|
|
|
},
|
|
|
onLoad({ ctx, app }) {
|
|
|
this.app = app;
|
|
|
-
|
|
|
let logHost = () => {
|
|
|
return this.$service.item.simpleList({name:this.search})
|
|
|
};
|
|
|
ctx.service({
|
|
|
page: logHost
|
|
|
})
|
|
|
-
|
|
|
.set('table', {
|
|
|
columns: [
|
|
|
{
|
|
|
label: 'ID',
|
|
|
prop: 'id',
|
|
|
align: 'center',
|
|
|
- width:80
|
|
|
+ width:70
|
|
|
},
|
|
|
{
|
|
|
label: '图片',
|
|
|
@@ -108,19 +120,25 @@ export default {
|
|
|
label: '名称',
|
|
|
prop: 'name',
|
|
|
align: 'center',
|
|
|
- width:300
|
|
|
+ width:200
|
|
|
},
|
|
|
{
|
|
|
- label: '可借',
|
|
|
+ label: '库存',
|
|
|
prop: 'stock',
|
|
|
align: 'center',
|
|
|
+ width:90
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '价格',
|
|
|
+ prop: 'showUsePrice',
|
|
|
+ align: 'center',
|
|
|
width:100
|
|
|
},
|
|
|
{
|
|
|
- label: '要借',
|
|
|
+ label: '数量',
|
|
|
prop: 'bigCount',
|
|
|
align: 'center',
|
|
|
- width:130
|
|
|
+ width:100
|
|
|
}
|
|
|
],
|
|
|
op: {
|