|
|
|
@ -4,7 +4,7 @@ |
|
|
|
<view class="list"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<view>供应商</view> |
|
|
|
<view class="lf-icon" @click="$url('/pages/canteen/classification/index')"> |
|
|
|
<view class="lf-icon" @click="$url('/pages/canteen/classification/index?type=1')"> |
|
|
|
<u-icon name="plus-circle" size="42"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
<view class="list"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<view>采购清单</view> |
|
|
|
<view class="lf-icon" @click="$url('/pages/canteen/classification/index')"> |
|
|
|
<view class="lf-icon" @click="$url('/pages/canteen/classification/index?type=2')"> |
|
|
|
<u-icon name="plus-circle" size="42"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -24,19 +24,21 @@ |
|
|
|
<!-- 收货时间 --> |
|
|
|
<view class="lf-row-between lf-p-30 lf-p-l-32 lf-p-r-32 lf-font-28"> |
|
|
|
<view class="lf-color-black">收货时间</view> |
|
|
|
<view class="lf-color-555">2021-07-23</view> |
|
|
|
<picker mode="date" :value="date" @change="pickerChange"> |
|
|
|
<view class="lf-color-555 lf-text-right" style="width: 400rpx;">{{ date }}</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<self-line></self-line> |
|
|
|
<!-- 物料table --> |
|
|
|
<view class="lf-p-32 lf-p-t-30 lf-p-b-30 lf-w-100 lf-h-maxcontent lf-border-box"> |
|
|
|
<view class="lf-m-b-20 lf-font-32 lf-font-bold">物资明细</view> |
|
|
|
<wyb-table :headers="headers" contentBgColor="#ecfaf5" :first-line-fixed="true" :contents="contents" @onInputChange="onInputChange" width="100%" height="800rpx"></wyb-table> |
|
|
|
<wyb-table :headers="headers" contentBgColor="#ecfaf5" :first-line-fixed="true" :contents="contents" @onInputChange="onInputChange" width="max-content" height="800rpx"></wyb-table> |
|
|
|
</view> |
|
|
|
<!-- 操作按钮 --> |
|
|
|
<view style="height: 100rpx;"></view> |
|
|
|
<view class="fixed-bottom"> |
|
|
|
<button class="btn btn1">临时保存</button> |
|
|
|
<button class="btn btn2">保存并发单</button> |
|
|
|
<button class="btn btn1" @click="save(1)">临时保存</button> |
|
|
|
<button class="btn btn2" @click="save(2)">保存并发单</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -58,81 +60,61 @@ |
|
|
|
key: 'spec' |
|
|
|
},{ |
|
|
|
label: '税前价', |
|
|
|
key: 'preTax' |
|
|
|
key: 'pre_tax_price' |
|
|
|
},{ |
|
|
|
label: '税后价', |
|
|
|
key: 'afterTax' |
|
|
|
key: 'after_tax_price' |
|
|
|
}], |
|
|
|
contents: [{ |
|
|
|
name: '黄瓜', |
|
|
|
spec: '一打/500g', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
},{ |
|
|
|
name: '黄豆', |
|
|
|
spec: '5kg', |
|
|
|
preTax: {edit: true, value: ''}, |
|
|
|
afterTax: {edit: true, value: ''} |
|
|
|
}] |
|
|
|
contents: [], |
|
|
|
date: this.$shared.recordTime(new Date(), '-', 'date') |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
|
|
|
|
this.getMaterialList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getMaterialList(){ |
|
|
|
this.$http(this.API.API_CANTEEN_MATERIALLIST, { |
|
|
|
// category_id: 1 // 分类id 不传则显示默认分类 |
|
|
|
}).then(res => { |
|
|
|
let list = res.data.material || []; |
|
|
|
let contents = list.map(item => { |
|
|
|
return { |
|
|
|
name: item.material.m_name, |
|
|
|
spec: item.name, |
|
|
|
pre_tax_price: {edit: true, value: item.tax_standard_price}, |
|
|
|
after_tax_price: {edit: true, value: item.non_tax_standard_price}, |
|
|
|
spec_id: item.id, |
|
|
|
material_id: item.material.id |
|
|
|
} |
|
|
|
}) |
|
|
|
this.contents = contents; |
|
|
|
}) |
|
|
|
}, |
|
|
|
onInputChange(event){ |
|
|
|
console.log("检测到table input被更改", event); |
|
|
|
this.contents[event.contentIndex][event.key].value = event.detailValue; |
|
|
|
}, |
|
|
|
pickerChange(event){ |
|
|
|
this.date = event.detail.value; |
|
|
|
}, |
|
|
|
save(){ |
|
|
|
// todo |
|
|
|
console.log("dddddd", this.contents) |
|
|
|
let list = this.contents.map(item => { |
|
|
|
return { |
|
|
|
m_id: item.material_id, |
|
|
|
m_spec_id: item.spec_id, |
|
|
|
tax_price: item.pre_tax_price.value, |
|
|
|
non_tax_price: item.after_tax_price.value |
|
|
|
} |
|
|
|
}); |
|
|
|
this.$http(this.API.API_CANTEEN_PURCHASEAPPLY, { |
|
|
|
data: list |
|
|
|
}).then(res => { |
|
|
|
console.log("save", res); |
|
|
|
this.$msg('操作成功'); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|