This commit is contained in:
lzttt 2024-10-12 12:41:42 +08:00
commit ff1d7088ef
10 changed files with 230 additions and 85 deletions

View File

@ -0,0 +1,59 @@
<template>
<div class="long-text">
<div>{{ truncatedText }}</div>
<el-button type="text" @click="toggleShowAll" v-if="isExpanded">{{showAll?'收起':'展开'}}</el-button>
</div>
</template>
<script>
export default {
props: {
text: {
type: String,
required: true
},
maxLength: {
type: Number,
default: 20
}
},
data() {
return {
showAll: false,
localMaxLength: this.maxLength,
}
},
computed: {
truncatedText() {
if (this.text.length <= this.localMaxLength) {
return this.text;
}
return `${this.text.substring(0, this.maxLength)}...`;
},
isExpanded() {
return this.text.length > this.maxLength;
}
},
methods: {
toggleShowAll() {
if (this.showAll) { //true->false
this.localMaxLength = this.maxLength;
;
}
if (!this.showAll) {
this.localMaxLength = Infinity;
}
this.showAll = !this.showAll
}
}
}
</script>
<style scoped>
.long-text {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
</style>

View File

@ -6,7 +6,8 @@
</el-form-item>
<el-form-item label="公告状态" prop="status">
<el-select v-model="queryParams.status" placeholder="公告状态" clearable>
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" :key="parseInt(dict.value)" :label="dict.label"
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" :key="parseInt(dict.value)"
:label="dict.label"
:value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
@ -19,14 +20,18 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpdate"
>新增
>新增
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="公告标题" align="center" prop="title" :show-overflow-tooltip="true"/>
<el-table-column label="公告类型" align="center" prop="type" width="100">
<template v-slot="scope">
@ -38,18 +43,22 @@
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="内容" align="center" prop="content" :show-overflow-tooltip="true" />
<el-table-column label="内容" align="center" prop="content">
<template slot-scope="scope">
<TruncatedText :text="scope.row.content"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
>修改
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
>删除
>删除
</el-button>
<!-- <el-button size="mini" type="text" @click="handlePush(scope.row.id)"-->
<!-- >推送-->
<!-- </el-button>-->
<!-- <el-button size="mini" type="text" @click="handlePush(scope.row.id)"-->
<!-- >推送-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
@ -63,24 +72,25 @@
<script>
import {pageNotice, removeNotice} from '@/api/base/notice'
import BaseNoticeForm from "@/views/base/notice/form/BaseNoticeForm.vue";
import TruncatedText from "@/components/truncatedText/TruncatedText.vue";
export default {
name: "BaseNotice",
components: {BaseNoticeForm},
props:{
parentServer:{
components: {TruncatedText, BaseNoticeForm},
props: {
parentServer: {
type: String,
default: null,
required: true,
},
server:{
server: {
type: String,
default: null,
required: true
}
},
data(){
return{
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
@ -98,20 +108,20 @@ export default {
mounted() {
this.getList();
},
methods:{
methods: {
/** 查询公告列表 */
async getList(){
async getList() {
this.loading = true
try {
const res = await pageNotice(this.queryParams)
this.noticeList = res.data.records
this.total = res.data.total
}finally {
} finally {
this.loading = false
}
},
/** 搜索按钮操作 */
handleQuery(){
handleQuery() {
this.queryParams.pageNo = 1
this.getList();
},
@ -132,10 +142,11 @@ export default {
await removeNotice(ids)
await this.getList()
this.$modal.msgSuccess("删除成功")
}catch {}
} catch {
}
},
/** 推送按钮操作 */
handlePush(id){
handlePush(id) {
}
}
@ -143,5 +154,4 @@ export default {
</script>
<style scoped lang="scss">
</style>

View File

@ -1,5 +1,5 @@
<template>
<el-select v-model="partSelected" ref="selectTable" clearable :style="'width: ' + selectWidth" @blur="$emit('input-blur', $event)">
<el-select v-model="partSelected" ref="selectTable" clearable filterable :filter-method="listPart" :style="'width: ' + selectWidth" @blur="$emit('input-blur', $event)">
<el-option style="display: none" v-for="part in partList" :key="part.id" :label="part.name" :value="part.id"/>
<el-table :data="partList" style="width: 100%" v-loading="loading" @row-click="handleSelectionChange">
<el-table-column label="序号" align="center" width="80">
@ -8,20 +8,21 @@
</template>
</el-table-column>
<!-- <el-table-column label="商品名称" prop="name" width="120"/>-->
<el-table-column
width="180"
align="right">
<template slot="header" slot-scope="scope">
<el-input
v-model="queryParams.name"
size="mini"
@keyup.enter.native="listPart"
placeholder="输入关键字搜索"/>
</template>
<template slot-scope="scope">
{{scope.row.name}}
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- width="180"-->
<!-- align="right">-->
<!-- <template slot="header" slot-scope="scope">-->
<!-- <el-input-->
<!-- v-model="queryParams.name"-->
<!-- size="mini"-->
<!-- @keyup.enter.native="listPart"-->
<!-- placeholder="输入关键字搜索"/>-->
<!-- </template>-->
<!-- <template slot-scope="scope">-->
<!-- {{scope.row.name}}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="商品名称" prop="name" width="180" />
<el-table-column label="规格" prop="model" width="120"/>
<el-table-column label="商品编码" prop="code" width="120"/>
<el-table-column label="可用库存" prop="stock" width="80"/>
@ -110,7 +111,8 @@ export default {
},
methods: {
// TODO
async listPart() {
async listPart(val) {
this.queryParams.name = val
try{
this.loading = true
const res = await getWaresPage(this.queryParams)

View File

@ -21,7 +21,7 @@
</el-form-item>
<!-- 采购员/领料人 组件 -->
<el-form-item :label="staffRole" prop="user">
<StaffChoose v-model="formData.user"/>
<StaffChoose v-model="formData.user" :is-get="'true'"/>
</el-form-item>
</el-col>
</el-row>
@ -32,6 +32,10 @@
<PartChoose @selected="getPart"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button v-if="soByType" type="primary" size="small" @click="newWares">新增商品</el-button>
<el-button v-else type="primary" size="small" @click="newInStock">急件采购</el-button>
</el-col>
</el-row>
<!-- 商品表格 组件 -->
<el-row :gutter="20">
@ -58,6 +62,7 @@
</el-col>
</el-row>
</el-form>
<WaresForm ref="waresForm" @success="pushData" />
</div>
</template>
@ -69,10 +74,14 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
import {getWaresByName} from "@/api/repair/wares";
import WaresForm from "@/views/repair/wares/WaresForm.vue";
import router from "@/router";
export default {
name: "SoInfo",
components: {
WaresForm,
StaffChoose,
PartChoose,
SoTable,
@ -84,6 +93,11 @@ export default {
defaultValue: true,
required: true
},
soType:{
type: String,
default: "",
required: false
}
},
data() {
return {
@ -108,6 +122,9 @@ export default {
this.init()
},
methods: {
router() {
return router
},
//
getStaff(data) {
this.formData.userId = data.id
@ -142,11 +159,12 @@ export default {
this.formData.goodsList = data.map(item => {
return {
goodsId: item.id,
goodsType: "0",
goodsType: this.soType ? "1": "0",
wareId: item.wareId,
goodsCount: item.count,
goodsPrice: item.newPrice,
remark: item.remark
remark: item.remark,
soiType: this.soByType ? "01" : "02"
}
})
},
@ -178,6 +196,10 @@ export default {
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.partList = []
if (this.soType){
this.formData.soType = this.soType
this.formData.purchaseType = '02'
}
},
//
async createInit(){
@ -194,6 +216,23 @@ export default {
supplierName: data?.supplier?.name
}
}
},
//
newWares(){
this.$refs.waresForm.open(null);
},
//
async pushData(name){
const res = await getWaresByName(name)
const data = res.data
this.partList.push({
...data,
wareId: data.warehouse
})
},
//
newInStock(){
this.$router.push("/repair/stock/repair-soi?active=purchaseCreate&soType=03")
}
}
}

View File

@ -19,7 +19,8 @@
<el-table-column label="商品编码" align="center" width="180" prop="code"/>
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
<div class="item" slot-scope="scope">
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.ware" @change="changeWare(scope.row)"/>
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.ware"
@change="changeWare(scope.row)"/>
<span class="item__txt">{{ scope.row.warehouseName }}</span>
</div>
</el-table-column>
@ -31,21 +32,24 @@
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="count">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count" placeholder="请输入内容"></el-input>
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.count }}</span>
</div>
</el-table-column>
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150" prop="price"/>
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150" prop="purPrice"/>
<el-table-column v-if="soByType" label="采购单价" align="center" width="150" prop="newPrice">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.newPrice" placeholder="请输入内容"></el-input>
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.newPrice"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.newPrice }}</span>
</div>
</el-table-column>
<el-table-column :label="soByType ? '采购金额' : '合计'" align="center" width="150" prop="totalPrice"/>
<el-table-column label="备注" align="center" width="180" prop="remark">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark" placeholder="请输入内容"></el-input>
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.remark }}</span>
</div>
</el-table-column>
@ -91,16 +95,16 @@ export default {
watch: {
partList(val) {
if (val && val.length > 0) {
const data = val[val.length - 1]
const newData = {
...data,
count: 1,
totalPrice: data.price * 1,
remark: '',
newPrice: data.price,
}
this.list.push(newData)
}else {
this.list = val.map(item => {
return {
...item,
count: 1,
totalPrice: item.purPrice * 1,
remark: '',
newPrice: item.purPrice,
}
})
} else {
this.list = []
}
},
@ -182,7 +186,11 @@ export default {
}
},
/** 保存数据 */
save (row) {
save(row) {
if (!this.soByType && row.stock < row.count){
row.count = 1
this.$modal.msgError("库存数量不足")
}
//
row.totalPrice = row.count * row.newPrice
const id = row.id
@ -192,8 +200,8 @@ export default {
})
this.clickCellMap[id] = []
},
changeWare(row){
if (row.ware){
changeWare(row) {
if (row.ware) {
row['wareId'] = row.ware.id
row['warehouse'] = row.ware.id
row['warehouseName'] = row.ware.name

View File

@ -1,12 +1,12 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab">
<el-tabs v-model="activeTab" @tab-click="changeTab">
<el-tab-pane label="采购单据" name="purchase">
<SoIndex :so-by-type="soByType"/>
</el-tab-pane>
<!-- <el-tab-pane label="急件单据" name="urgentPurchase">-->
<!-- <SoIndex :so-by-type="soByType" :goods-yes="true"/>-->
<!-- </el-tab-pane>-->
<el-tab-pane label="急件单据" name="urgentPurchase">
<SoIndex :so-by-type="soByType" :goods-yes="true"/>
</el-tab-pane>
<el-tab-pane label="作废单据" name="voidPurchase">
<SoVoid :so-by-type="soByType" />
</el-tab-pane>
@ -14,7 +14,7 @@
<SoiTable :so-by-type="soByType" />
</el-tab-pane>
<el-tab-pane label="采购单" name="purchaseCreate">
<SoInfo :so-by-type="soByType"/>
<SoInfo :so-by-type="soByType" :so-type="soType"/>
</el-tab-pane>
</el-tabs>
</div>
@ -39,10 +39,12 @@ export default {
return {
activeTab: "purchase",
soByType: true,
soType: null
}
},
created() {
this.isType()
this.init()
},
methods: {
//
@ -50,6 +52,22 @@ export default {
const url = this.$route.path
this.soByType = url.includes("soi")
},
//
async init(){
const active = this.$route.query.active
if (active){
this.activeTab = active
}
const soType = this.$route.query.soType
if (soType){
this.soType = soType
}
},
changeTab(tab, event){
// if (this.soType){
// this.$router.push("/repair/stock/repair-soi")
// }
}
}
}
</script>

View File

@ -20,7 +20,7 @@
<el-input disabled v-model="formData.stNo" style="width: 20rem"/>
</el-form-item>
<el-form-item label="调拨人" prop="user">
<StaffChoose v-model="formData.user"/>
<StaffChoose v-model="formData.user" is-get="true"/>
</el-form-item>
<el-form-item label="选择商品" prop="goodsList">
<PartChoose @selected="getPart"/>

View File

@ -506,7 +506,7 @@ export default {
},
// init
createInit() {
this.formData.bookingId = this.formData?.bookingId.toString() || null
this.formData.bookingId = this.formData?.bookingId?.toString() || null
//
this.formData.ticketNo = this.formData.ticketNo || createUniqueCodeByHead("GD")
//

View File

@ -54,18 +54,13 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="销售价格" prop="price">
<el-input-number v-model="formData.price" :precision="2" :step="0.1" ></el-input-number>
<el-form-item label="进价" prop="purPrice">
<el-input-number v-model="formData.purPrice" :precision="2" :step="0.1" ></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认仓库" prop="warehouse">
<TreeSelect
v-model="formData.warehouse"
:options="baseWarehouseTree"
:normalizer="normalizer"
placeholder="请选择仓库"
/>
<el-form-item label="销售价格" prop="price">
<el-input-number v-model="formData.price" :precision="2" :step="0.1" ></el-input-number>
</el-form-item>
</el-col>
</el-row>
@ -85,19 +80,18 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="当前库存" prop="stock">
<el-input-number v-model="formData.stock"></el-input-number>
<el-form-item label="默认仓库" prop="warehouse">
<TreeSelect
v-model="formData.warehouse"
:options="baseWarehouseTree"
:normalizer="normalizer"
placeholder="请选择仓库"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-switch
v-model="formData.status"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="01"
inactive-value="02">
</el-switch>
<el-form-item label="当前库存" prop="stock">
<el-input-number v-model="formData.stock"></el-input-number>
</el-form-item>
</el-col>
</el-row>
@ -122,6 +116,17 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-switch
v-model="formData.status"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="01"
inactive-value="02">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="适用子公司" prop="corpId">
<el-select v-model="formData.corpIds" multiple placeholder="请选择">
@ -212,10 +217,12 @@ export default {
dataForm: undefined,
corpIds: [],
status: '01',
purPrice: undefined
},
//
formRules: {
name: [{required: true, message: '商品名称不能为空', trigger: 'blur'}],
purPrice: [{required: true, message: '进价不能为空', trigger: 'blur'}],
price: [{required: true, message: '销售价格不能为空', trigger: 'blur'}],
unit: [{required: true, message: '计量单位不能为空', trigger: 'blur'}],
type: [{required: true, message: '所属分类不能为空', trigger: 'blur'}],
@ -337,6 +344,7 @@ export default {
dataForm: undefined,
corpIds: [],
status: '01',
purPrice: undefined
};
this.resetForm("formRef");
}

View File

@ -35,6 +35,7 @@
<el-table-column label="规格" align="left" prop="model"/>
<el-table-column label="商品编码" align="left" prop="code"/>
<el-table-column label="所属分类" align="left" prop="typeName"/>
<el-table-column label="进价" align="right" prop="purPrice" />
<el-table-column label="销售价格" align="right" prop="price"/>
<el-table-column label="条形码" align="left" prop="barCode"/>
<el-table-column label="计量单位" align="center" prop="unit">