This commit is contained in:
weipengfei 2024-05-11 16:09:33 +08:00
parent 87a6298543
commit 18c5a55658
2 changed files with 80 additions and 10 deletions

View File

@ -13,7 +13,7 @@
</div> </div>
<el-table :data="pager.lists" border style="width: 100%; margin-top: 10px"> <el-table :data="pager.lists" border style="width: 100%; margin-top: 10px">
<el-table-column prop="id" label="ID" width="120" /> <el-table-column prop="id" label="ID" width="120" />
<el-table-column prop="order_id" label="采购订单id" width="120" /> <!-- <el-table-column prop="order_id" label="采购订单id" width="120" /> -->
<el-table-column <el-table-column
label="商品名称" label="商品名称"
prop="goods_name" prop="goods_name"
@ -61,18 +61,60 @@
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
type="primary" type="primary"
v-if="row.is_adopt === 0" v-if="row.is_adopt === 0 && row.price > 0"
size="small" size="small"
@click="offerGood(row)" @click="offerGood(row, 0)"
>采纳</el-button >采纳</el-button
> >
<span v-else>商品已采纳</span> <span v-if="row.is_storage">已入库</span>
<el-button
type="success"
v-else-if="row.is_adopt === 1 && row.price > 0"
size="small"
@click="offerGood(row, 1)"
>入库</el-button
>
<span
v-if="row.is_adopt === 0 && row.price == 0"
style="color: #e6a23c"
>等待供应商报价</span
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="flex mt-4 justify-end"> <div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" /> <pagination v-model="pager" @change="getLists" />
</div> </div>
<el-dialog v-model="dialogVisible" title="入库" width="600">
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions-item label="供应商名称">
{{ updateInfo.supplier_name }}
</el-descriptions-item>
<el-descriptions-item label="商品名称">
{{ updateInfo.goods_name }}
</el-descriptions-item>
<el-descriptions-item label="商品报价">
¥ {{ updateInfo.price }} / {{ updateInfo.unit_name }}
</el-descriptions-item>
<el-descriptions-item label="应入库数量">
{{ updateInfo.q_nums }}
</el-descriptions-item>
<el-descriptions-item label="实际入库数量">
<el-input-number v-model="updateInfo.nums" :step="1" :min="1" />
</el-descriptions-item>
<el-descriptions-item label="备注">
<el-input v-model="updateInfo.notes" type="textarea" placeholder="请输入备注"></el-input>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="goodsOfferUpdate">
确认
</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
@ -104,12 +146,39 @@ const changeType = (e: any) => {
getLists(); getLists();
}; };
const offerGood = (row: any) => { const dialogVisible = ref(false);
apiOpurchaseclassGoodsOfferUpdate({ const updateInfo = ref({
id: row.id, id: "",
}).then((res) => { type: 0,
getLists(); notes: "", //
nums: 0,//
q_nums: 0, //
}); });
const offerGood = (row: any, type: number) => {
//type:0 1
updateInfo.value = Object.assign(
{
id: "",
type: type,
notes: "", //
nums: 0,
},
row
);
if(type==0) return goodsOfferUpdate(); // ,
updateInfo.value.q_nums = row.nums;
dialogVisible.value = true;
}; };
const goodsOfferUpdate = () => {
apiOpurchaseclassGoodsOfferUpdate({
id: updateInfo.value.id,
type: updateInfo.value.type,
notes: updateInfo.value.notes, //
nums: updateInfo.value.nums,
}).then((res) => {
getLists();
dialogVisible.value = false;
});
};
</script> </script>

View File

@ -37,6 +37,7 @@
<el-table-column prop="unit_name" label="单位" /> <el-table-column prop="unit_name" label="单位" />
<el-table-column prop="nums" label="数量" /> <el-table-column prop="nums" label="数量" />
<el-table-column prop="total" label="合计(元)" /> <el-table-column prop="total" label="合计(元)" />
<el-table-column prop="nums_count" label="已采纳数量" />
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="子订单" name="order"> <el-tab-pane label="子订单" name="order">