耗材单位模块

This commit is contained in:
duan 2024-10-29 18:17:03 +08:00
parent 99da7fcf5a
commit 4caaa3770f
4 changed files with 147 additions and 7 deletions

View File

@ -173,7 +173,14 @@ export function tbProductStockOperateOutAndOn(data) {
data
});
}
// 副单位
export function unittbConsInfo(params) {
return request({
url: `/api/tbConsInfo`,
method: "put",
data:params
});
}
/**
* 库存列表
* @returns

View File

@ -42,12 +42,12 @@
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button>
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button> -->
<el-select clearable v-model="query.sort" @change="getTableData" placeholder="排序">
<el-select clearable v-model="query.sort" @change="getTableData" placeholder="排序">
<el-option label="创建时间" value="createTime,desc" />
<el-option label="数量由低到高" value="balance,asc" />
</el-select>
</div>
</div>
<div class="row_wrap" style="margin-top: 12px">
<div class="row">
@ -242,7 +242,7 @@
<span>
{{ scope.row.conUnit }}
</span>
<i class="el-icon-edit" @click="editorHandle(scope.row)"></i>
<i class="el-icon-edit" @click="editorHandles(scope.row)"></i>
</template>
</el-table-column>
@ -352,7 +352,6 @@
</el-form>
</el-dialog>
<!-- 修改和增加 -->
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="80%">
<template v-if="dialogtitle != '编辑'">
<div v-for="(item, index) in ruleForms" :key="index">
@ -482,6 +481,39 @@
</el-form>
</template>
</el-dialog>
<!-- 单位修改 -->
<el-dialog :title="unitItem ? unitItem.conName : ''" :visible.sync="dialogtitleunit" width="40%">
<template>
<div class="unitStyle unitWidth">
<div>主单位</div>
<div>{{ unitItem ? unitItem.conUnit : '' }}</div>
<div style="display: flex;align-items: center;">
<div style="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> 订货单位
</div>
</div>
<div class="unitStyleBottom unitWidth" @click="switchs = 1" v-if="switchs == 2">
<span style="margin-right: 10px;">+</span> 添加单位
</div>
<div class="unitStyle unitWidth " style="margin-top: 20px;" v-else>
<div>副单位</div>
<div><input style="width: 100px;" type="text" v-model="unitItem.conUnitTwo"> </div>
<div style="display: flex;align-items: center;">
<div style="width: 9px;height: 9px;background-color: #D9D9D9;border-radius: 50%;margin:0 6px;"></div> 订货单位
<input type="text" disabled placeholder="1">
<div style="width: 80px;">{{ unitItem.conUnitTwo }}</div>= <input v-model="unitItem.conUnitTwoConvert"
type="number">{{
unitItem.conUnit }}
</div>
</div>
<div style="display: flex; justify-content: center;margin-top: 20px;">
<el-button @click="dialogtitleunit = false"> </el-button>
<el-button type="primary" @click="submitUnit()">
</el-button>
</div>
</template>
</el-dialog>
<el-dialog title="选择类型" :visible.sync="typedialogshow">
<div class="head-container">
@ -592,7 +624,7 @@ import {
tbConsInfoFlowstock
} from "@/api/consumable";
import AddConsTakin from "../components/addConsTakin";
import { tbConsInfodownload, tbConsInfoinputStock } from '@/api/invoicing'
import { tbConsInfodownload, tbConsInfoinputStock, unittbConsInfo } from '@/api/invoicing'
import { downloadFile } from "@/utils";
import UploadExcel from '@/components/UploadExcel'
import consRecordDetail from "../components/cons_record_detail";
@ -676,6 +708,9 @@ export default {
total: 0
},
ruleFormLoading: false,
dialogtitleunit: false,
unitItem: { switchs: 2 },
switchs: 2,
ruleForms: [],
ruleForm: {
conCode: "",
@ -768,6 +803,15 @@ export default {
}
})
},
async submitUnit() {
const res = await unittbConsInfo([{
conUnitTwoConvert: this.unitItem.conUnitTwoConvert * 1,
conUnitTwo: this.unitItem.conUnitTwo,
id: this.unitItem.id
}])
this.unitItem = {}
this.dialogtitleunit = false
},
//
toGoodslist(orderNo) {
this.$router.push({
@ -842,13 +886,18 @@ export default {
console.log(error);
}
},
//
editorHandles(row) {
this.unitItem = row;
this.dialogtitleunit = true;
},
//
editorHandle(row) {
this.dialogtitle = "编辑";
for (let key in this.ruleForm) {
this.ruleForm[key] = row[key];
}
console.log(row, '调试1')
this.ruleForm.id = row.id;
this.dialogshow = true;
},
@ -1305,4 +1354,70 @@ export default {
}
}
}
.unitStyle {
display: flex;
align-items: center;
border-radius: 2px 2px 2px 2px;
>div:first-child {
width: 95px;
height: 42px;
line-height: 42px;
text-align: center;
border-right: 1px solid #DDDFE6;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #999999;
}
>div:nth-child(2) {
width: 120px;
height: 42px;
line-height: 42px;
text-align: center;
border-right: 1px solid #DDDFE6;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #3F9EFF;
}
>div:last-child {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #999999;
>input {
width: 39px;
height: 28px;
background: #FFFFFF;
border-radius: 2px 2px 2px 2px;
border: 1px solid #DDDFE6;
margin: 0 16px;
}
}
}
.unitStyleBottom {
margin-top: 30px;
line-height: 42px;
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #3F9EFF;
}
.unitWidth {
// width: 418px;
height: 42px;
border-radius: 2px 2px 2px 2px;
border: 1px solid #DDDFE6;
}
</style>

View File

@ -122,6 +122,15 @@
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
</template>
</el-table-column>
<el-table-column label="单位">
<template v-slot="scope">
<el-select @change="consCountTotal($event, scope.row, 'unit')" v-model="scope.row.conUnit" :placeholder="scope.row.conUnit">
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"> </el-option>
<el-option :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo" v-if="scope.row.conUnitTwo"> </el-option>
</el-select>
<div class="tips"> &nbsp;</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly

View File

@ -120,6 +120,15 @@
<div class="tips">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
</template>
</el-table-column>
<el-table-column label="单位">
<template v-slot="scope">
<el-select @change="consCountTotal($event, scope.row, 'unit')" v-model="scope.row.conUnit" :placeholder="scope.row.conUnit">
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"> </el-option>
<el-option :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo" v-if="scope.row.conUnitTwo"> </el-option>
</el-select>
<div class="tips"> &nbsp;</div>
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
<el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly