Merge remote-tracking branch 'origin/master'

This commit is contained in:
Lihx 2024-09-19 18:03:28 +08:00
commit 76f5f58678
41 changed files with 2398 additions and 235 deletions

View File

@ -6,6 +6,8 @@ VUE_APP_TITLE = "车联通"后台管理系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:48080'
# 附件请求地址前缀
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -9,6 +9,8 @@ VUE_APP_BASE_API = '/prod-api'
# 根据服务器或域名修改
PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
# 附件请求地址前缀
VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 二级部署路径
VUE_APP_APP_NAME ='yudao-admin'

View File

@ -102,3 +102,11 @@ export function getCompanyList(){
method: 'get'
})
}
// 当前登录用户的门店信息
export function getNowCompany(){
return request({
url: "/base/company/now",
method: "get"
})
}

View File

@ -67,3 +67,11 @@ export function exportCustomerMainExcel(params) {
responseType: 'blob'
})
}
// 用户列表
export function getCustomerList(){
return request({
url: "/base/custom/list",
method: "get"
})
}

View File

@ -0,0 +1,30 @@
import request from '@/utils/request'
const preUrl = "/repair/so"
// 采购单\领料单 新增
export function createRepairSo(data){
return request({
url: preUrl + "/create",
method: "post",
data
})
}
// 分页
export function getRepairSoPage(params){
return request({
url: preUrl + "/page",
method: "get",
params
})
}
// 作废
export function voidSo(data){
return request({
url: preUrl + "/void",
method: "post",
data
})
}

View File

@ -0,0 +1,12 @@
import request from '@/utils/request'
const preUrl= "/repair/soi"
// 分页查询
export function getSoiPage(params){
return request({
url: preUrl + "/page",
method: "get",
params
})
}

View File

@ -0,0 +1,21 @@
import request from '@/utils/request'
const preUrl = '/repair/st'
// 新增
export function createSt(data){
return request({
url: preUrl + "/create",
method: "post",
data
})
}
// 分页查
export function getStPage(params){
return request({
url: preUrl + "/page",
method: "get",
params
})
}

View File

@ -0,0 +1,12 @@
import request from '@/utils/request'
const preUrl = "/repair/sti"
// 调拨单子表 分页
export function getStiPage(params){
return request({
url: preUrl + "/page",
method: "get",
params
})
}

View File

@ -51,3 +51,11 @@ export function exportBaseSupplierExcel(params) {
responseType: 'blob'
})
}
// 获得所有供应商
export function getBaseSupplierList(){
return request({
url: '/supplier/baseSupplier/list',
method: 'get'
})
}

View File

@ -0,0 +1 @@
import request from '@/utils/request'

View File

@ -0,0 +1 @@
import request from '@/utils/request'

View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 创建配件库
export function createWares(data) {
return request({
url: '/repair/wares/create',
method: 'post',
data: data
})
}
// 更新配件库
export function updateWares(data) {
return request({
url: '/repair/wares/update',
method: 'put',
data: data
})
}
// 删除配件库
export function deleteWares(id) {
return request({
url: '/repair/wares/delete?id=' + id,
method: 'delete'
})
}
// 获得配件库
export function getWares(id) {
return request({
url: '/repair/wares/get?id=' + id,
method: 'get'
})
}
// 获得配件库分页
export function getWaresPage(params) {
return request({
url: '/repair/wares/page',
method: 'get',
params
})
}

View File

@ -72,6 +72,7 @@ export default {
return {
number: 0,
uploadList: [],
viewFileUrl: process.env.VUE_APP_FILE_API,
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, //
@ -88,7 +89,7 @@ export default {
//
this.fileList = list.map(item => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;

View File

@ -88,6 +88,7 @@ export default {
number: 0,
uploadList: [],
baseUrl: "",
viewFileUrl: process.env.VUE_APP_FILE_API,
headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/uploadDetail", //
@ -110,7 +111,7 @@ export default {
const list = Array.isArray(val)? val : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
@ -134,7 +135,7 @@ export default {
const list = Array.isArray(this.value)? this.value : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;

View File

@ -76,6 +76,7 @@ export default {
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
viewFileUrl: process.env.VUE_APP_FILE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", //
headers: { Authorization: "Bearer " + getAccessToken() }, //
fileList: []
@ -91,7 +92,7 @@ export default {
this.fileList = list.map(item => {
if (typeof item === "string") {
// edit by
item = { name: item, url: item };
item = { name: item, url: this.viewFileUrl+item };
}
return item;
});

View File

@ -196,6 +196,12 @@ export const DICT_TYPE = {
REPAIR_SO_STATUS: 'repair_so_status',
// 维修旧件处理方式
REPAIR_PART_DISPOSAL: 'repair_part_disposal',
//单位
REPAIR_UNIT: 'repair_unit',
//配件属性
REPAIR_WARES_ATTRIBUTE: 'wares_attribute',
//配件来源
REPAIR_WARES_DATA_FORM: 'wares_data_form',
}
/**

View File

@ -133,7 +133,8 @@ export default {
},
data() {
return {
tenantCode:"lighting",
tenantCode:"lighting", // TODO
// tenantCode:"lanan",
codeUrl: "",
//
captchaEnable: false,

View File

@ -1,19 +1,49 @@
<template>
<el-select v-model="corpSelected" clearable filterable>
<el-option v-for="staff in corpList" :key="staff.id" :label="staff.name" :value="staff.id"/>
<el-option v-for="staff in corpList" :key="staff.id" :label="staff.corpName" :value="staff.id"/>
</el-select>
</template>
<script>
import {getCompanyList} from "@/api/base/company";
export default {
name: "",
props:{
value:{
type: Object,
default: null
}
},
data() {
return {
corpSelected: undefined,
corpList: null
}
},
methods: {}
watch:{
corpSelected(val) {
const company = this.corpList.find(item => item.id === val);
this.$emit("input", company);
},
value(val){
if (val){
this.corpSelected = val.id
}else {
this.corpSelected = null
}
}
},
mounted() {
this.listCompany()
},
methods: {
async listCompany(){
const res = await getCompanyList();
this.corpList = res.data
}
}
}
</script>

View File

@ -1,6 +1,21 @@
<template>
<el-select v-model="partSelected" clearable filterable style="width: 45rem">
<el-option v-for="part in partList" :key="part.id" :label="part.name" :value="part.id"/>
<el-select v-model="partSelected" ref="selectTable" clearable style="width: 45rem">
<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%" @row-click="handleSelectionChange">
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" width="120"/>
<el-table-column label="规格" prop="model" width="120"/>
<el-table-column label="商品编码" prop="code" width="120"/>
<el-table-column label="可用库存" prop="stock" width="80"/>
<el-table-column label="成本" prop="price" width="80"/>
<el-table-column label="仓库" prop="warehouse" width="80"/>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
</el-select>
</template>
@ -9,8 +24,56 @@ export default {
name: "PartChoose",
data(){
return{
partSelected: undefined,
partList: null,
partSelected: null,
partList: [
{
id: 1,
tenantId: 1,
barCode: "12344564632463",
code: "12312312",
name: "测试1",
model: "12321",
price: "100",
type: "不知道",
unit: "个",
warehouse: "6335b519fde3cabf298e763bc1c38df1",
miniStock: 100,
maxStock: 100,
stock: 20,
img: '',
attribute: "123213123",
corpId: 1,
coverImage: '',
carModel: "大车",
remark: "没有",
},
{
id: 2,
tenantId: 1,
barCode: "12344564632463",
code: "12312312",
name: "测试2",
model: "12321",
price: "10",
type: "不知道",
unit: "个",
warehouse: "6335b519fde3cabf298e763bc1c38df1",
miniStock: 10,
maxStock: 10,
stock: 5,
img: '',
attribute: "123213123",
corpId: 1,
coverImage: '',
carModel: "大车",
remark: "没有",
}
],
queryParams:{
pageNo: 1,
pageSize: 10
},
total: 2
}
},
mounted() {
@ -20,11 +83,18 @@ export default {
// TODO
async listPart(){
},
handleSelectionChange(data){
this.$emit("selected", data)
this.$refs.selectTable.blur()
}
}
}
</script>
<style scoped lang="scss">
.pagination-container{
margin: 0 auto !important;
padding: 0 !important;
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div>
<el-select v-model="repairSelected">
<el-option v-for="repair in repairList" :key="repair.id" :label="repair.name" :value="repair.id" />
</el-select>
</div>
</template>
<script>
import {getBaseTypeList} from "@/api/base/type";
export default {
name: "RepairTypeChoose",
data() {
return {
repairList: [],
repairSelected: undefined,
}
},
watch:{
repairSelected(val){
const repair = this.repairList.find(item => item.id === val)
this.$emit('selected', repair)
}
},
mounted() {
this.listRepair()
},
methods: {
async listRepair(){
const res = await getBaseTypeList({type: "03"})
this.repairList = res.data
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -10,6 +10,12 @@ import {getStaffList} from "@/api/company/staff";
export default {
name: "StaffChoose",
props:{
value: {
type: Object,
defaultValue: null
}
},
data() {
return {
staffList: [],
@ -19,7 +25,14 @@ export default {
watch:{
staffSelected(val) {
const staff = this.staffList.find(item => item.id === val);
this.$emit("selected", staff);
this.$emit("input", staff);
},
value(newVal){
if (newVal){
this.staffSelected = newVal.id
}else {
this.staffSelected = null
}
}
},
mounted() {

View File

@ -1,20 +1,50 @@
<template>
<el-select v-model="supplierSelected">
<el-select v-model="supplierSelected" clearable filterable>
<el-option v-for="supplier in supplierList" :key="supplier.id" :label="supplier.name"
:value="supplier.id"/>
</el-select>
</template>
<script>
import {getBaseSupplierList} from "@/api/repair/supplier";
export default {
name: "",
name: "SupplierChoose",
props: {
value: {
type: Object,
defaultValue: null
}
},
data() {
return {
supplierSelected: undefined,
supplierList: null
}
},
methods: {}
watch: {
supplierSelected(val) {
const supplier = this.supplierList.find(item => item.id === val)
this.$emit("input", supplier);
},
value(newVal) {
if (newVal) {
this.supplierSelected = newVal.id
} else {
this.supplierSelected = null
}
}
},
mounted() {
this.listSupplier()
},
methods: {
async listSupplier() {
const res = await getBaseSupplierList();
this.supplierList = res.data
}
}
}
</script>

View File

@ -1,19 +1,36 @@
<template>
<el-select v-model="selected" clearable filterable >
<el-option v-for="user in userList" :key="user.id" :label="user.name" :value="user.id" />
<el-select v-model="userSelected" clearable filterable >
<el-option v-for="user in userList" :key="user.id" :label="user.cusName" :value="user.id" />
</el-select>
</template>
<script>
import {getCustomerList} from "@/api/base/customer";
export default {
name: "UserChoose",
data() {
return {
userList: [],
selected: undefined,
userSelected: undefined,
}
},
methods: {}
watch:{
userSelected(val){
const user = this.userList.find(item => item.id === val)
this.$emit("selected", user)
}
},
mounted() {
this.listCustomer()
},
methods: {
async listCustomer(){
const res = await getCustomerList()
this.userList = res.data
}
}
}
</script>

View File

@ -0,0 +1,81 @@
<template>
<div>
<el-select class="main-select-tree" clearable ref="selectTree" v-model="warehouseSelected" @blur="$emit('input-blur', $event)">
<el-option v-for="warehouse in optionData(warehouseList)"
:key="warehouse.value"
:label="warehouse.label"
:value="warehouse.value" style="display: none"/>
<el-tree class="main-select-el-tree" ref="selectedTree"
:data="warehouseList"
:props="treeProps"
highlight-current
@node-click="handleNodeClick"
:expand-on-click-node="expandOnClickNode"
default-expand-all />
</el-select>
</div>
</template>
<script>
import {getBaseWarehouseList} from "@/api/base/warehouse";
export default {
name: "WarehouseChoose",
props:{
value:{
type: String,
default: "",
required:false
}
},
data() {
return {
warehouseSelected: undefined,
expandOnClickNode: true,
warehouseList: [],
treeProps:{
label: "name",
children: "children"
}
}
},
watch:{
value(val){
if (val){
this.warehouseSelected = val
}else {
this.warehouseSelected = null
}
},
},
created() {
this.listWarehouse()
},
methods: {
async listWarehouse(){
const res = await getBaseWarehouseList()
this.warehouseList = this.handleTree(res.data, 'id', 'parentId',"children","0")
},
optionData(array, result=[]){
array.forEach(item => {
result.push({label: item.name, value: item.id})
if (item.children && item.children.length !== 0){
this.optionData(item.children, result)
}
})
return JSON.parse(JSON.stringify(result))
},
handleNodeClick(node){
this.$emit("input", node.name)
this.$emit("change")
this.warehouseSelected = node.name
this.$refs.selectTree.blur()
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
@ -15,20 +15,18 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="成本" prop="cost">
<el-input v-model="formData.cost" placeholder="请输入成本"/>
<el-input-number v-model="formData.cost" :precision="2" :step="0.1" :max="10"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="售价" prop="price">
<el-input v-model="formData.price" placeholder="请输入售价"/>
<el-input-number v-model="formData.price" :precision="2" :step="0.1" :max="10"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="规格" prop="spec">
@ -37,17 +35,22 @@
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-input v-model="formData.unit" placeholder="请输入单位"/>
<el-select v-model="formData.unit" placeholder="请选择单位">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_UNIT)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="分类" prop="type">
<el-select v-model="formData.type" placeholder="请选择分类">
<el-option label="请选择字典生成" value=""/>
</el-select>
<TreeSelect
v-model="formData.type"
:options="baseTypeTree"
:normalizer="normalizer"
placeholder="请选择分类"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -60,12 +63,24 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="是否自助" prop="isSelf">
<el-input v-model="formData.isSelf" placeholder="请输入是否自助"/>
<el-switch
v-model="formData.isSelf"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分店公用" prop="isPublic">
<el-input v-model="formData.isPublic" placeholder="请输入是否允许分店公用此产品"/>
<el-switch
v-model="formData.isPublic"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
@ -85,10 +100,12 @@
<script>
import * as RepairProjectApi from '@/api/repair/project';
import * as BaseTypeApi from '@/api/base/type';
import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "RepairProjectForm",
components: {},
components: {TreeSelect},
data() {
return {
//
@ -109,13 +126,19 @@ export default {
type: undefined,
manHour: undefined,
isSelf: undefined,
isPublic: undefined,
remark: undefined,
isPublic: '0',
remark: '0',
corpId:'',
corpIds:[],
},
//
formRules: {},
formRules: {
// name: [{required: true, message: '', trigger: 'blur'}],
// code: [{required: true, message: '', trigger: 'blur'}],
// type: [{required: true, message: '', trigger: 'blur'}],
// unit: [{required: true, message: '', trigger: 'blur'}],
},
baseTypeTree:[],
};
},
methods: {
@ -135,7 +158,33 @@ export default {
}
}
this.title = "新增维修项目";
//
await this.getBaseTypeTree();
},
/** 获得配置类型树 */
async getBaseTypeTree() {
this.baseTypeTree = [];
let param = {
type:'02'
}
const res = await BaseTypeApi.getBaseTypeList(param);
const root = {id: 0, name: '顶级配置类型', children: []};
root.children = this.handleTree(res.data, 'id', 'parentId',"children","0")
this.baseTypeTree.push(root)
},
/** 转换配置类型数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
},
/** 提交按钮 */
async submitForm() {
//
@ -173,8 +222,8 @@ export default {
type: undefined,
manHour: undefined,
isSelf: undefined,
isPublic: undefined,
remark: undefined,
isPublic: '0',
remark: '0',
corpId:'',
corpIds:[],
};

View File

@ -39,8 +39,12 @@
<el-table-column label="规格" align="center" prop="spec"/>
<el-table-column label="售价" align="center" prop="price"/>
<el-table-column label="编码" align="center" prop="code"/>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="分类" align="center" prop="type"/>
<el-table-column label="单位" align="center" prop="unit">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" :value="scope.row.unit" />
</template>
</el-table-column>
<el-table-column label="分类" align="center" prop="typeName"/>
<el-table-column label="工时" align="center" prop="manHour"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">

View File

@ -4,6 +4,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
type="daterange"
range-separator="至"
@ -12,7 +13,7 @@
</el-date-picker>
</el-form-item>
<el-form-item v-if="soByType && !goodsYes" label="供应商" prop="supplierId">
<SupplierChoose />
<SupplierChoose v-model="queryParams.supplier"/>
</el-form-item>
<el-form-item v-if="goodsYes" label="关键字" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
@ -21,14 +22,18 @@
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item v-if="soByType" label="状态" prop="soStatus">
<el-select v-model="queryParams.soStatus">
<el-select v-model="queryParams.soStatus" clearable>
<el-option v-for="item in getStatus"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-if="!soByType" label="领料人" prop="userId">
<StaffChoose @selected="getStaff"/>
<StaffChoose v-model="queryParams.user" @selected="getStaff"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose />
<CorpChoose v-model="queryParams.corp" @selected="getCompany"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -51,19 +56,19 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="商品名称" align="center" width="180" prop="name" />
<el-table-column label="规格" align="center" width="180" prop="name" />
<el-table-column label="商品编码" align="center" width="180" prop="name" />
<el-table-column label="所属分类" align="center" width="150" prop="name" />
<el-table-column label="数量" align="center" width="150" prop="name" />
<el-table-column label="单位" align="center" width="150" prop="name" />
<el-table-column label="成本" align="center" width="150" prop="name" />
<el-table-column label="供应商" align="center" width="180" prop="name" />
<el-table-column label="仓库" align="center" width="150" prop="name" />
<el-table-column label="状态" align="center" width="150" prop="name" />
<el-table-column label="时间" align="center" width="150" prop="name" />
<el-table-column label="门店" align="center" width="180" prop="name" />
<el-table-column label="单号" align="center" prop="soId" width="200"/>
<el-table-column label="商品名称" align="center" width="180" prop="name"/>
<el-table-column label="规格" align="center" width="180" prop="name"/>
<el-table-column label="商品编码" align="center" width="180" prop="name"/>
<el-table-column label="所属分类" align="center" width="150" prop="name"/>
<el-table-column label="数量" align="center" width="150" prop="name"/>
<el-table-column label="单位" align="center" width="150" prop="name"/>
<el-table-column label="成本" align="center" width="150" prop="name"/>
<el-table-column label="供应商" align="center" width="180" prop="name"/>
<el-table-column label="仓库" align="center" width="150" prop="name"/>
<el-table-column label="状态" align="center" width="150" prop="name"/>
<el-table-column label="时间" align="center" width="150" prop="name"/>
<el-table-column label="门店" align="center" width="180" prop="name"/>
<el-table-column label="操作" align="center" width="180" fixed="right">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
@ -80,29 +85,38 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="数量" align="center" prop="itemCount" width="150" />
<el-table-column label="金额" align="center" prop="totalPrice" width="150" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150" />
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150" />
<el-table-column label="登记时间" align="center" prop="createTime" width="150" />
<el-table-column label="门店" align="center" prop="corpName" width="180" />
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150" />
<el-table-column label="备注" align="center" prop="remark" width="180" />
<el-table-column label="单号" align="center" prop="soNo" width="200"/>
<el-table-column label="数量" align="center" prop="itemCount" width="150"/>
<el-table-column label="金额" align="center" prop="totalPrice" width="150"/>
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150"/>
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="200"/>
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150"/>
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="门店" align="center" prop="corpName" width="180"/>
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_SO_STATUS" :value="scope.row.soStatus"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
<el-table-column label="操作" fixed="right" width="180" align="center">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-close"
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoidSo(scope.row)"
>作废
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
/>
</div>
</template>
@ -112,15 +126,24 @@
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {DICT_TYPE} from "@/utils/dict";
import {getRepairSoPage, voidSo} from "@/api/repair/stockOperate/stockOperate";
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
export default {
name: "SoIndex",
components:{
computed: {
getStatus() {
const data = this.getDictDatas(DICT_TYPE.REPAIR_SO_STATUS)
return data.filter(item => item.label.toString().indexOf("领料") === -1)
}
},
components: {
StaffChoose,
SupplierChoose,
CorpChoose
},
props:{
props: {
soByType: {
type: Boolean,
defaultValue: true,
@ -132,19 +155,41 @@ export default {
required: false
}
},
watch: {
'queryParams.supplier'(val) {
this.queryParams.supplierId = val ? val.id : null
},
'queryParams.corp'(val) {
this.queryParams.corpId = val ? val.id : null
},
'queryParams.user'(val) {
this.queryParams.userId = val ? val.id : null
}
},
data() {
return {
queryParams:{
queryParams: {
pageNo: 1,
pageSize: 10,
searchTimeArray:[],
searchTimeArray: [],
soNo: null,
supplier: null,
supplierId: null,
supplierName: null,
soStatus: null,
corp: null,
corpId: null,
user: null,
userId: null,
userName: null
userName: null,
soType: this.soByType ? "01" : "02",
purchaseType: this.goodsYes ? "02" : "01",
goodsType: this.goodsYes ? "1" : "0"
},
formData: {
remark: null,
id: null,
soStatus: "06"
},
showSearch: true,
list: [],
@ -152,18 +197,73 @@ export default {
total: 0
}
},
mounted() {
this.pageSo();
},
methods: {
//
async pageSo() {
if (this.soByType && this.goodsYes) {
try {
this.loading = true
const res = await getSoiPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
} finally {
this.loading = false
}
} else {
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
} finally {
this.loading = false
}
}
},
//
handleQuery(){},
handleQuery() {
this.queryParams.pageNo = 1
this.pageSo()
},
//
resetQuery(){
resetQuery() {
this.resetForm('queryForm')
this.queryParams.supplier = null
this.queryParams.corp = null
this.queryParams.user = null
this.handleQuery()
},
//
getStaff(data){
getStaff(data) {
this.queryParams.userId = data.id
this.queryParams.userName = data.name
},
//
getCompany(data) {
console.log(data)
},
//
handleVoidSo(row) {
this.$prompt('作废备注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.formData.id = row.id
this.formData.remark = value
this.doVoidSo()
}).catch(() => {
})
},
async doVoidSo() {
try {
await voidSo(this.formData)
this.$modal.msgSuccess("作废成功")
await this.pageSo()
} catch {
}
}
}
}

View File

@ -4,8 +4,8 @@
<el-row :gutter="20">
<el-col :span="24">
<!-- 供应商 组件 -->
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
<SupplierChoose />
<el-form-item v-if="soByType" label="供应商" prop="supplier">
<SupplierChoose v-model="formData.supplier"/>
</el-form-item>
<!-- 日期 内嵌 -->
<el-form-item label="日期" prop="soTime">
@ -20,8 +20,8 @@
<el-input disabled v-model="formData.soNo" style="width: 20rem"/>
</el-form-item>
<!-- 采购员/领料人 组件 -->
<el-form-item :label="staffRole" prop="userId">
<StaffChoose @selected="getStaff"/>
<el-form-item :label="staffRole" prop="user">
<StaffChoose v-model="formData.user"/>
</el-form-item>
</el-col>
</el-row>
@ -29,27 +29,32 @@
<!-- 选择商品 组件 -->
<el-col :span="12">
<el-form-item label="选择商品">
<PartChoose />
<PartChoose @selected="getPart"/>
</el-form-item>
</el-col>
</el-row>
<!-- 商品表格 组件 -->
<el-row :gutter="20">
<el-col :span="24">
<SoTable :so-by-type="soByType"/>
<SoTable @tableData="tableData" :part-list="partList" :so-by-type="soByType" @deleteItem="deleteItem"/>
</el-col>
</el-row>
<el-row :gutter="2" style="margin-top: 1rem">
<el-row :gutter="4" style="margin-top: 1rem">
<el-col :span="6">
<el-form-item label="应付金额" prop="totalPrice">
<el-input disabled v-model="formData.totalPrice"/>
</el-form-item>
</el-col>
<!-- 备注 -->
<el-col :span="12">
<el-form-item label="备注">
<el-input style="width: 45rem" />
<el-form-item label="备注" prop="remark">
<el-input style="width: 40rem" v-model="formData.remark"/>
</el-form-item>
</el-col>
<!-- 按钮操作 -->
<el-col :span="12" style="text-align: right">
<el-button v-if="soByType" type="danger">结算</el-button>
<el-button v-else type="primary">确定</el-button>
<el-col :span="6" style="text-align: right">
<el-button v-if="soByType" type="danger" @click="handleSubmit">结算</el-button>
<el-button v-else type="primary" @click="handleSubmit">确定</el-button>
</el-col>
</el-row>
</el-form>
@ -63,6 +68,7 @@ import PartChoose from "@/views/repair/Components/PartChoose.vue";
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";
export default {
name: "SoInfo",
@ -72,36 +78,122 @@ export default {
SoTable,
SupplierChoose
},
props:{
soByType:{
props: {
soByType: {
type: Boolean,
defaultValue: true,
required: true
}
},
},
data() {
return {
formData: {
soNo: null,
supplierId: null,
supplierName: null,
supplier: null,
soTime: Date.now(),
userId: null,
userName: null,
partList: []
user: null,
goodsList: [],
totalPrice: null,
soType: this.soByType ? "01" : "02",
purchaseType: "01",
itemCount: 0,
soStatus: this.soByType ? "01" : "04",
remark: null,
},
staffRole: "采购员"
staffRole: "采购员",
partList: [],
}
},
mounted() {
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.init()
},
methods: {
//
//
getStaff(data) {
this.formData.userId = data.id
this.formData.userName = data.name
},
//
getSupplier(data) {
this.formData.supplierId = data.id
this.formData.supplierName = data.name
},
//
async getPart(data) {
const flag = this.partList.find(item => item.id === data.id)
if (flag) {
try {
await this.$modal.confirm(`${data.name}已存在,确定要重复添加?`)
this.partList.push(data)
} catch {
}
} else {
this.partList.push(data)
}
},
//
deleteItem(index) {
this.partList.splice(index, 1)
},
//
tableData(data){
this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
this.formData.goodsList = data.map(item => {
return {
goodsId: item.id,
goodsType: "0",
wareId: "0",
goodsCount: item.count,
goodsPrice: item.newPrice,
remark: item.remark
}
})
},
//
async handleSubmit(){
try {
this.createInit()
await createRepairSo(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
}catch{
}
},
//
init(){
this.formData = {
soNo: null,
supplier: null,
soTime: Date.now(),
user: null,
goodsList: [],
totalPrice: null,
soType: this.soByType ? "01" : "02",
purchaseType: "01",
itemCount: 0,
soStatus: this.soByType ? "01" : "04",
remark: null,
}
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.partList = []
},
//
createInit(){
const data = this.formData
this.formData = {
...data,
userId: data.user.id,
userName: data.user.name,
}
if (this.soByType){
this.formData = {
...data,
supplierId: data.supplier.id,
supplierName: data.supplier.name
}
}
}
}
}

View File

@ -1,24 +1,53 @@
<template>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
show-summary
:summary-method="getSummaries"
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@cell-click="handleCellClick"
>
<el-table-column label="序号" align="center">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" width="200"/>
<el-table-column label="规格" align="center" width="180"/>
<el-table-column label="商品编码" align="center" width="180"/>
<el-table-column label="仓库" align="center" width="150"/>
<el-table-column label="库存" align="center" width="150" />
<el-table-column label="单位" align="center" width="150"/>
<el-table-column label="数量" align="center" width="150"/>
<el-table-column :label="soByType ? '上次进价' : '成本'" align="center" width="150"/>
<el-table-column v-if="soByType" label="采购进价" align="center" width="150"/>
<el-table-column :label="soByType ? '采购金额' : '合计'" align="center" width="150"/>
<el-table-column label="备注" align="center" width="180"/>
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
<el-table-column label="规格" align="center" width="180" prop="model"/>
<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.warehouse" />
<span class="item__txt">{{ scope.row.warehouse }}</span>
</div>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="stock"/>
<el-table-column label="单位" align="center" width="150" prop="unit"/>
<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>
<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 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>
<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>
<span class="item__txt">{{ scope.row.remark }}</span>
</div>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-delete"
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
>删除
</el-button>
</template>
@ -27,27 +56,173 @@
</template>
<script>
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
export default {
name: "SoTable",
props:{
soByType:{
components: {WarehouseChoose},
props: {
soByType: {
type: Boolean,
defaultValue: true,
required: true
},
partList: {
type: Array,
defaultValue: false,
required: true
}
},
data() {
return {
loading: false,
list: [],
includeColumn: ['count', 'totalPrice'],
//
editProp: this.soByType ? ['warehouse', 'count', 'newPrice', 'remark'] : ['count', 'remark'],
// cell
clickCellMap: {}
}
},
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 = []
}
},
list: {
handler(newVal, oldVal) {
this.$emit("tableData", newVal)
},
deep: true
}
},
methods: {
//
deleteItem(index) {
this.$emit("deleteItem", index)
},
//
getSummaries(param) {
const {columns, data} = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (this.includeColumn.includes(column.property)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
}
});
return sums
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__txt').classList.add('item__txt--hover')
}
},
/** 鼠标移出cell */
handleCellLeave(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__txt').classList.remove('item__txt--hover')
}
},
/** 点击cell */
handleCellClick(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
// cell
this.saveCellClick(row, cell)
cell.querySelector('.item__txt').style.display = 'none'
cell.querySelector('.item__input').style.display = 'inline'
cell.querySelector('input').focus()
}
},
/** 取消编辑状态 */
cancelEditable(cell) {
cell.querySelector('.item__txt').style.display = 'inline'
cell.querySelector('.item__input').style.display = 'none'
},
/** 保存进入编辑的cell */
saveCellClick(row, cell) {
const id = row.id
if (this.clickCellMap[id] !== undefined) {
if (!this.clickCellMap[id].includes(cell)) {
this.clickCellMap[id].push(cell)
}
} else {
this.clickCellMap[id] = [cell]
}
},
/** 保存数据 */
save (row) {
//
row.totalPrice = row.count * row.newPrice
const id = row.id
// cell
this.clickCellMap[id].forEach(cell => {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
}
}
}
</script>
<style scoped lang="scss">
.item {
.item__input {
display: none;
width: 100px;
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__inner {
height: 24px !important;
}
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__suffix {
i {
font-size: 12px !important;
line-height: 26px !important;
}
}
}
.item__txt {
box-sizing: border-box;
border: 1px solid transparent;
width: 100px;
line-height: 24px;
padding: 0 8px;
}
.item__txt--hover {
border: 1px solid #dddddd;
border-radius: 4px;
cursor: text;
}
}
</style>

View File

@ -4,6 +4,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="作废时间" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
type="daterange"
range-separator="至"
@ -12,20 +13,20 @@
</el-date-picker>
</el-form-item>
<el-form-item v-if="soByType" label="供应商" prop="supplierId">
<SupplierChoose />
<SupplierChoose v-model="queryParams.supplier" />
</el-form-item>
<el-form-item label="单据号" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item v-if="!soByType" label="领料人" prop="userId">
<StaffChoose @selected="getStaff"/>
<StaffChoose v-model="queryParams.user" @selected="getStaff"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose />
<CorpChoose v-model="queryParams.corp" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button icon="el-icon-refresh">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="handleResetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作 -->
@ -38,20 +39,28 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="数量" align="center" width="150" prop="name" />
<el-table-column label="单号" align="center" prop="soNo" width="200" />
<el-table-column label="数量" align="center" width="150" prop="itemCount" />
<el-table-column label="金额" align="center" prop="totalPrice" width="150" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150" />
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150" />
<el-table-column label="登记时间" align="center" prop="createTime" width="150" />
<el-table-column label="作废时间" align="center" prop="createTime" width="150" />
<el-table-column label="作废人" align="center" prop="createTime" width="150" />
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="作废时间" align="center" prop="updateTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="作废人" align="center" prop="updater" width="150" />
<el-table-column label="门店" align="center" prop="corpName" width="180" />
<el-table-column label="作废备注" align="center" prop="remark" width="180" />
</el-table>
<!-- 分页 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
</div>
</template>
@ -60,6 +69,7 @@
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {getRepairSoPage} from "@/api/repair/stockOperate/stockOperate";
export default {
name: "SoVoid",
@ -71,6 +81,17 @@ export default {
required: true
},
},
watch:{
'queryParams.supplier'(val){
this.queryParams.supplierId = val ? val.id : null
},
'queryParams.corp'(val){
this.queryParams.corpId = val ? val.id : null
},
'queryParams.user'(val){
this.queryParams.userId = val ? val.id : null
}
},
data() {
return {
queryParams:{
@ -78,11 +99,17 @@ export default {
pageSize: 10,
searchTimeArray:[],
soNo: null,
supplier: null,
supplierId: null,
supplierName: null,
corp: null,
corpId: null,
user: null,
userId: null,
userName: null
userName: null,
soType: this.soByType ? "01" : "02",
purchaseType: this.goodsYes ? "02" : "01",
soStatus: "06"
},
showSearch: true,
loading: false,
@ -90,12 +117,38 @@ export default {
total: 0,
}
},
mounted() {
this.pageSo()
},
methods: {
async pageSo(){
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
//
getStaff(data){
this.queryParams.userId = data.id
this.queryParams.userName = data.name
},
//
handleQuery(){
this.queryParams.pageNo = 1
this.pageSo()
},
//
handleResetQuery(){
this.resetForm('queryForm')
this.queryParams.supplier = null
this.queryParams.corp = null
this.queryParams.user = null
this.handleQuery()
}
}
}
</script>

View File

@ -4,6 +4,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
type="daterange"
range-separator="至"
@ -14,18 +15,18 @@
<el-form-item label="关键字" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
</el-form-item>
<el-form-item v-if="soByType" label="规格" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
<el-form-item v-if="soByType" label="规格" prop="standard">
<el-input v-model="queryParams.standard" style="width: 18rem" placeholder="请输入规格"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose />
<CorpChoose v-model="queryParams.corp" />
</el-form-item>
<el-form-item v-if="soByType" label="所属库位" prop="corpId">
<CorpChoose />
<el-form-item v-if="soByType" label="所属库位" prop="warehouseId">
<WarehouseChoose v-model="queryParams.warehouseId" @selected="getWarehouse"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button icon="el-icon-refresh">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="handleResetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作 -->
@ -44,7 +45,7 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="单号" align="center" prop="soId" width="200" />
<el-table-column label="商品名称" align="center" prop="soNo" width="180" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="soNo" width="180" />
<el-table-column label="商品编码" align="center" prop="soNo" width="180" />
@ -67,10 +68,12 @@
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {getSoiPage} from "@/api/repair/stockOperate/stockOperateItem";
export default {
name: "SoiTable",
components: {CorpChoose},
components: {WarehouseChoose, CorpChoose},
props: {
soByType: {
type: Boolean,
@ -78,6 +81,11 @@ export default {
required: true
},
},
watch:{
'queryParams.corp'(val){
this.queryParams.corpId = val ? val.id : null
}
},
data() {
return {
queryParams:{
@ -86,6 +94,9 @@ export default {
searchTimeArray:[],
soNo: null,
corpId: null,
soiType: this.soByType ? "01" : "02",
warehouseId: null,
corp: null,
},
showSearch: true,
loading: false,
@ -93,7 +104,36 @@ export default {
total: 0,
}
},
methods: {}
mounted() {
this.pageSoi()
},
methods: {
//
getWarehouse(data){
},
//
async pageSoi(){
try {
this.loading = true
const res = await getSoiPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
//
handleQuery(){
this.queryParams.pageNo = 1
this.pageSoi()
},
//
handleResetQuery(){
this.resetForm('queryForm')
this.queryParams.corp = null
this.handleQuery()
}
}
}
</script>

View File

@ -13,19 +13,21 @@
<el-form-item :label="stByType ? '单据号' : '关键字'" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item label="调出门店" prop="corpId">
<CorpChoose />
<el-form-item label="调出门店" prop="outCorpId">
<CorpChoose v-model="queryParams.outCorp"/>
</el-form-item>
<el-form-item label="调入门店" prop="corpId">
<CorpChoose />
<el-form-item label="调入门店" prop="inCorpId">
<CorpChoose v-model="queryParams.inCorp"/>
</el-form-item>
<el-form-item label="审核状态">
<el-select v-model="queryParams.is">
<el-form-item label="审核状态" prop="stStatus">
<el-select v-model="queryParams.stStatus">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_ST_STATUS)" :key="item.value" :label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button icon="el-icon-refresh">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
@ -37,27 +39,27 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="调出门店" align="center" prop="corpName" width="180" />
<el-table-column label="调入门店" align="center" prop="corpName" width="180" />
<el-table-column label="调拨数量" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="调拨成本" align="center" prop="itemCount" width="150" />
<el-table-column label="调拨总额" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="差额" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="本次优惠" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="本次收款" align="center" prop="itemCount" width="150" />
<el-table-column v-if="stByType" label="本次欠款" align="center" prop="itemCount" width="150" />
<el-table-column label="调拨日期" align="center" prop="itemCount" width="150" />
<el-table-column label="调拨人" align="center" prop="itemCount" width="150" />
<el-table-column v-if="!stByType" label="审核日期" align="center" prop="itemCount" width="150" />
<el-table-column label="状态" align="center" prop="itemCount" width="150" />
<el-table-column label="备注" align="center" prop="itemCount" width="180" />
<el-table-column v-if="!stByType" label="退回备注" align="center" prop="itemCount" width="180" />
<el-table-column label="单号" align="center" prop="stNo" width="200"/>
<el-table-column label="调出门店" align="center" prop="outCorpId" width="180"/>
<el-table-column label="调入门店" align="center" prop="inCorpId" width="180"/>
<el-table-column label="调拨数量" align="center" prop="itemCount" width="150"/>
<el-table-column v-if="stByType" label="调拨成本" align="center" prop="totalPrice" width="150"/>
<el-table-column label="调拨总额" align="center" prop="totalPrice" width="150"/>
<el-table-column v-if="stByType" label="差额" align="center" prop="itemCount" width="150"/>
<el-table-column v-if="stByType" label="本次优惠" align="center" prop="discountPrice" width="150"/>
<el-table-column v-if="stByType" label="本次收款" align="center" prop="thisCollection" width="150"/>
<el-table-column v-if="stByType" label="本次欠款" align="center" prop="thisDebt" width="150"/>
<el-table-column label="调拨日期" align="center" prop="stTime" width="150"/>
<el-table-column label="调拨人" align="center" prop="userName" width="150"/>
<el-table-column v-if="!stByType" label="审核日期" align="center" prop="itemCount" width="150"/>
<el-table-column label="状态" align="center" prop="stStatus" width="150"/>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
<el-table-column v-if="!stByType" label="退回备注" align="center" prop="remark" width="180"/>
<el-table-column label="操作" fixed="right" width="180" align="center">
<template v-if="stByType" v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
>修改
</el-button>
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button size="mini" type="text" icon="el-icon-close"
>作废
</el-button>
@ -72,34 +74,72 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
</div>
</template>
<script>
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import {getStPage} from "@/api/repair/stockTransfer/stockTransfer";
export default {
name: "StIndex",
components: {CorpChoose},
props:{
stByType:{
props: {
stByType: {
type: Boolean,
defaultValue: true,
required: true
}
},
watch:{
'queryParams.outCorp'(val){
this.queryParams.outCorpId = val ? val.id : null
},
'queryParams.inCorp'(val){
this.queryParams.inCorpId = val ? val.id : null
}
},
data() {
return {
queryParams:{},
queryParams: {
pageNo: 1,
pageSize: 10,
stStatus: null,
outCorp: null,
outCorpId: null,
inCorp:null,
inCorpId: null,
searchTimeArray: [],
stNo: null,
},
showSearch: true,
loading: false,
list: [],
total: 0
}
},
methods: {}
mounted() {
this.getList()
},
methods: {
async getList() {
const res = await getStPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
},
handleQuery() {
this.queryParams.pageNo = 1
this.getList()
},
handleReset() {
this.resetForm('queryForm')
this.queryParams.outCorp = null
this.queryParams.inCorp = null
this.handleQuery()
}
}
}
</script>

View File

@ -3,15 +3,15 @@
<el-form :model="formData" size="small" :inline="true" label-width="80px">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="调出门店">
<CorpChoose/>
<el-form-item label="调出门店" prop="oldCorp">
<CorpChoose v-model="formData.oldCorp"/>
</el-form-item>
<el-form-item label="调入门店">
<CorpChoose/>
<el-form-item label="调入门店" prop="newCorp">
<CorpChoose v-model="formData.newCorp"/>
</el-form-item>
<el-form-item label="日期">
<el-form-item label="日期" prop="stTime">
<el-date-picker
v-model="formData"
v-model="formData.stTime"
type="date"
placeholder="选择日期">
</el-date-picker>
@ -19,43 +19,43 @@
<el-form-item label="单据编号" prop="stNo">
<el-input disabled v-model="formData.stNo" style="width: 20rem"/>
</el-form-item>
<el-form-item label="调拨人">
<StaffChoose @selected="getStaff"/>
<el-form-item label="调拨人" prop="user">
<StaffChoose v-model="formData.user"/>
</el-form-item>
<el-form-item label="选择商品">
<PartChoose/>
<el-form-item label="选择商品" prop="goodsList">
<PartChoose @selected="getPart"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<StTable/>
<StTable @tableData="tableData" :part-list="partList" @deleteItem="deleteItem"/>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-top: 1rem">
<el-col :span="24">
<el-form-item label="应收金额">
<el-input v-model="formData"/>
<el-form-item label="应收金额" prop="totalPrice">
<el-input disabled v-model="formData.totalPrice"/>
</el-form-item>
<el-form-item label="优惠金额">
<el-input v-model="formData"/>
<el-form-item label="优惠金额" prop="discountPrice">
<el-input v-model="formData.discountPrice" @blur="handleDiscountPriceChange"/>
</el-form-item>
<el-form-item label="本次收款">
<el-input v-model="formData"/>
<el-form-item label="本次收款" prop="thisCollection">
<el-input v-model="formData.thisCollection" @blur="handleThisCollection"/>
</el-form-item>
<el-form-item label="本次欠款">
<el-input v-model="formData"/>
<el-form-item label="本次欠款" prop="thisDebt">
<el-input disabled v-model="formData.thisDebt"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="备注">
<el-input style="width: 45rem"/>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" style="width: 45rem"/>
</el-form-item>
</el-col>
<el-col :span="12" style="text-align: right">
<el-button type="danger">结算</el-button>
<el-button type="danger" @click="handleSubmit">结算</el-button>
</el-col>
</el-row>
</el-form>
@ -68,6 +68,8 @@ import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import PartChoose from "@/views/repair/Components/PartChoose.vue";
import StTable from "@/views/repair/stockTransfer/Components/StTable.vue";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import {getNowCompany} from "@/api/base/company";
import {createSt} from "@/api/repair/stockTransfer/stockTransfer";
export default {
name: "StInfo",
@ -81,15 +83,121 @@ export default {
return {
formData: {
stNo: null,
newCorp: null,
oldCorp: null,
stTime: Date.now(),
user: null,
goodsList: [],
totalPrice: 0,
discountPrice: 0,
thisCollection: 0,
thisDebt: 0,
remark: null,
itemCount: 0,
stStatus: "01"
},
partList: []
}
},
mounted() {
this.formData.stNo = createUniqueCodeByHead("DB")
this.init()
},
methods: {
getStaff(data) {
// TODO init
async companyInit() {
try {
const res = await getNowCompany()
} catch {
}
},
//
async getPart(data) {
const flag = this.partList.find(item => item.id === data.id)
if (flag) {
try {
await this.$modal.confirm(`${data.name}已存在,确定要重复添加?`)
this.partList.push(data)
} catch {
}
} else {
this.partList.push(data)
}
},
//
deleteItem(index) {
this.partList.splice(index, 1)
},
//
tableData(data) {
const tempPrice = data.reduce((x, y) => {
return x + y.totalPrice
}, 0)
const itemCount = data.reduce((x, y) => {
return x + y.goodsCount
}, 0)
this.formData.totalPrice = tempPrice
this.formData.thisDebt = tempPrice
this.formData.itemCount = itemCount
this.formData.goodsList = data.map(item => {
return {
...item,
goodsId: item.id,
goodsCount: item.goodsCount,
goodsPrice: item.goodsPrice,
remark: item.remark
}
})
},
//
handleDiscountPriceChange() {
this.formData.thisDebt -= this.formData.discountPrice
},
//
handleThisCollection() {
this.formData.thisDebt -= this.formData.thisCollection
},
//
async handleSubmit() {
try {
this.createInit()
await createSt(this.formData)
this.$modal.msgSuccess("新增成功")
this.init()
} catch {
}
},
//
createInit() {
const data = this.formData
this.formData = {
...data,
outCorpId: data.oldCorp.id,
inCorpId: data.newCorp.id,
userId: data.user.id,
userName: data.user.name,
}
},
//
init(){
// TODO
this.companyInit()
this.formData = {
stNo: null,
newCorp: null,
oldCorp: null,
stTime: Date.now(),
user: null,
goodsList: [],
totalPrice: 0,
discountPrice: 0,
thisCollection: 0,
thisDebt: 0,
remark: null,
itemCount: 0,
stStatus: "01"
}
this.formData.stNo = createUniqueCodeByHead("DB")
this.partList = []
}
}
}

View File

@ -1,23 +1,45 @@
<template>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table v-loading="loading"
:data="list" :stripe="true"
:show-overflow-tooltip="true" show-summary
:summary-method="getSummaries"
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@cell-click="handleCellClick"
>
<el-table-column label="序号" align="center">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" width="200"/>
<el-table-column label="规格" align="center" width="180"/>
<el-table-column label="单位" align="center" width="150"/>
<el-table-column label="原库位" align="center" width="150"/>
<el-table-column label="账上数量" align="center" width="150"/>
<el-table-column label="调拨数量" align="center" width="150"/>
<el-table-column label="参考成本" align="center" width="150"/>
<el-table-column label="结算单价" align="center" width="150"/>
<el-table-column label="结算金额" align="center" width="150"/>
<el-table-column label="备注" align="center" width="180"/>
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
<el-table-column label="规格" align="center" width="180" prop="model"/>
<el-table-column label="单位" align="center" width="150" prop="unit"/>
<el-table-column label="原库位" align="center" width="150" prop="warehouse"/>
<el-table-column label="账上数量" align="center" width="150" prop="stock"/>
<el-table-column label="调拨数量" align="center" width="150" prop="goodsCount">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.goodsCount" placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.goodsCount }}</span>
</div>
</el-table-column>
<el-table-column label="参考成本" align="center" width="150" prop="price"/>
<el-table-column label="结算单价" align="center" width="150" prop="goodsPrice">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.goodsPrice" placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.goodsPrice }}</span>
</div>
</el-table-column>
<el-table-column label="结算金额" 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>
<span class="item__txt">{{ scope.row.remark }}</span>
</div>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-delete"
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
>删除
</el-button>
</template>
@ -28,16 +50,163 @@
<script>
export default {
name: "StTable",
props: {
partList: {
type: Array,
defaultValue: false,
required: true
}
},
data() {
return {
loading: false,
list: [],
//
includeColumn: ['goodsCount', 'totalPrice'],
//
editProp: ['goodsCount', 'goodsPrice', 'remark'],
// cell
clickCellMap: {}
}
},
methods: {}
watch: {
partList(val) {
if (val && val.length > 0) {
const data = val[val.length - 1]
const newData = {
...data,
goodsCount: 1,
totalPrice: data.price * 1,
remark: '',
goodsPrice: data.price,
}
this.list.push(newData)
} else {
this.list = []
}
},
list: {
handler(val) {
this.$emit("tableData", val)
},
deep: true
},
},
methods: {
//
deleteItem(index) {
this.$emit("deleteItem", index)
},
getSummaries(param) {
const {columns, data} = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (this.includeColumn.includes(column.property)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
}
});
return sums
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__txt').classList.add('item__txt--hover')
}
},
/** 鼠标移出cell */
handleCellLeave(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
cell.querySelector('.item__txt').classList.remove('item__txt--hover')
}
},
/** 点击cell */
handleCellClick(row, column, cell, event) {
const property = column.property
if (this.editProp.includes(property)) {
// cell
this.saveCellClick(row, cell)
cell.querySelector('.item__txt').style.display = 'none'
cell.querySelector('.item__input').style.display = 'inline'
cell.querySelector('input').focus()
}
},
/** 取消编辑状态 */
cancelEditable(cell) {
cell.querySelector('.item__txt').style.display = 'inline'
cell.querySelector('.item__input').style.display = 'none'
},
/** 保存进入编辑的cell */
saveCellClick(row, cell) {
const id = row.id
if (this.clickCellMap[id] !== undefined) {
if (!this.clickCellMap[id].includes(cell)) {
this.clickCellMap[id].push(cell)
}
} else {
this.clickCellMap[id] = [cell]
}
},
/** 保存数据 */
save (row) {
//
row.totalPrice = row.goodsCount * row.goodsPrice
const id = row.id
// cell
this.clickCellMap[id].forEach(cell => {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
}
}
}
</script>
<style scoped lang="scss">
.item {
.item__input {
display: none;
width: 100px;
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__inner {
height: 24px !important;
}
/* 调整elementUI中样式 如果不需要调整请忽略 */
.el-input__suffix {
i {
font-size: 12px !important;
line-height: 26px !important;
}
}
}
.item__txt {
box-sizing: border-box;
border: 1px solid transparent;
width: 100px;
line-height: 24px;
padding: 0 8px;
}
.item__txt--hover {
border: 1px solid #dddddd;
border-radius: 4px;
cursor: text;
}
}
</style>

View File

@ -13,15 +13,15 @@
<el-form-item label="关键字" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、商品名称或编码"/>
</el-form-item>
<el-form-item label="调出门店" prop="corpId">
<CorpChoose />
<el-form-item label="调出门店" prop="outCorpId">
<CorpChoose v-model="queryParams.outCorp" />
</el-form-item>
<el-form-item label="调入门店" prop="corpId">
<CorpChoose />
<el-form-item label="调入门店" prop="inCorpId">
<CorpChoose v-model="queryParams.inCorp"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button icon="el-icon-refresh">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
@ -38,8 +38,8 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo" width="180" />
<el-table-column label="商品名称" align="center" prop="soNo" width="180" />
<el-table-column label="单号" align="center" prop="stId" width="180" />
<el-table-column label="商品名称" align="center" prop="goodsId" width="180" />
<el-table-column label="规格" align="center" prop="soNo" width="180" />
<el-table-column label="商品编码" align="center" prop="soNo" width="180" />
<el-table-column v-if="!stByType" label="条形码" align="center" prop="soNo" width="180" />
@ -54,7 +54,7 @@
<el-table-column label="调入门店" align="center" prop="itemCount" width="180" />
<el-table-column label="调入仓库" align="center" prop="itemCount" width="180" />
<el-table-column label="调拨时间" align="center" prop="itemCount" width="180" />
<el-table-column label="备注" align="center" prop="itemCount" width="180" />
<el-table-column label="备注" align="center" prop="remark" width="180" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
@ -62,6 +62,7 @@
</template>
<script>
import {getStiPage} from "@/api/repair/stockTransfer/stockTransferItem";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
export default {
@ -74,16 +75,51 @@ export default {
required: true
}
},
watch:{
'queryParams.outCorp'(val){
this.queryParams.outCorpId = val ? val.id : null
},
'queryParams.inCorp'(val){
this.queryParams.inCorpId = val ? val.id : null
}
},
data() {
return {
queryParams: {},
queryParams: {
pageNo: 1,
pageSize: 10,
searchTimeArray: [],
outCorp: null,
outCorpId: null,
inCorp: null,
inCorpId: null
},
showSearch: true,
loading: false,
list: [],
total: 0,
}
},
methods: {}
mounted() {
this.getList()
},
methods: {
async getList(){
const res = await getStiPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
},
handleQuery(){
this.queryParams.pageNo = 1
this.getList()
},
handleReset(){
this.resetForm("queryForm")
this.queryParams.outCorp = null
this.queryParams.inCorp = null
this.handleQuery()
}
}
}
</script>

View File

@ -16,8 +16,13 @@
<el-form-item v-if="TicketType === 'tp'" label="服务顾问" prop="userId">
<StaffChoose />
</el-form-item>
<el-form-item v-if="!(TicketType === 'tv')" label="维修类别" prop="userId">
<StaffChoose />
<el-form-item v-if="TicketType === 'tu'" label="维修类别" prop="repairType">
<el-select v-model="queryParams.repairType" size="small">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item v-if="TicketType === 'tp'" label="类型" prop="repairType">
<RepairTypeChoose @selected="getRepairType" />
</el-form-item>
<el-form-item label="门店" prop="userId">
<SupplierChoose />
@ -45,13 +50,15 @@
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue";
import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue";
export default {
name: "TicketSearch",
components: {
TicketTable,
StaffChoose,
SupplierChoose
SupplierChoose,
RepairTypeChoose
},
props:{
TicketType:{
@ -67,7 +74,12 @@ export default {
total: 0,
}
},
methods: {}
methods: {
//
getRepairType(data){
console.log(data)
}
}
}
</script>

View File

@ -10,7 +10,7 @@
<template slot="label">
用户选择
</template>
<UserChoose />
<UserChoose @selected="getUser"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
@ -99,14 +99,17 @@
<el-button size="small">质保说明</el-button>
</el-col>
<el-col :span="4.8">
<el-button size="small">终检</el-button>
<el-button size="small" v-if="formData.endCheck" @click="formData.endCheck = 0">终检</el-button>
<el-button size="small" v-if="!formData.endCheck" @click="formData.endCheck = 1">不终检</el-button>
</el-col>
<el-col :span="4.8">
<el-select size="small">
<el-select v-model="formData.partDisposal" size="small">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_PART_DISPOSAL)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
<el-col :span="4.8">
<el-select size="small">
<el-select v-model="formData.repairType" size="small">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
</el-row>
@ -190,12 +193,22 @@ export default {
}
},
data() {
return {}
return {
formData:{
endCheck: 1,
partDisposal:'01',
repairType: '01',
}
}
},
methods: {}
methods: {
//
getUser(data){
console.log(data)
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,346 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-collapse v-model="activeNames">
<!--基本信息-->
<el-collapse-item title="商品基本信息" name="1">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="条形码" prop="barCode">
<el-input v-model="formData.barCode" placeholder="请输入条形码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商品编码" prop="code">
<el-input v-model="formData.code" placeholder="请输入商品编码"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="商品名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入商品名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="model">
<el-input v-model="formData.model" placeholder="请输入规格型号"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属分类" prop="type">
<TreeSelect
v-model="formData.type"
:options="baseTypeTree"
:normalizer="normalizer"
placeholder="请选择所属分类"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="unit">
<el-select v-model="formData.unit" placeholder="请选择单位">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_UNIT)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<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" :max="10"></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>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="最低库存" prop="miniStock">
<el-input-number v-model="formData.miniStock" :max="10"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最高库存" prop="maxStock">
<el-input-number v-model="formData.maxStock" :max="10"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="当前库存" prop="stock">
<el-input-number v-model="formData.stock" :max="10"></el-input-number>
</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>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="来源" prop="dataForm">
<el-select v-model="formData.dataForm" placeholder="请选择来源">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_WARES_DATA_FORM)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配件属性" prop="attribute">
<el-select v-model="formData.attribute" placeholder="请选择单位">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_WARES_ATTRIBUTE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="适用子公司" prop="corpId">
<el-select v-model="formData.corpIds" multiple placeholder="请选择">
<el-option
v-for="item in companyList"
:key="item.id"
:label="item.corpName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="适用车型" prop="carModel">
<el-input type="textarea" v-model="formData.carModel" placeholder="请输入适用车型"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="formData.remark" placeholder="请输入备注"/>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
<el-collapse-item title="附件信息" name="2">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="产品图片" prop="img">
<ImageUpload v-model="formData.img" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="封面图片" prop="coverImg">
<ImageUpload :limit="1" v-model="formData.coverImg" />
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as WaresApi from '@/api/repair/wares';
import * as BaseTypeApi from '@/api/base/type';
import {getCompanyList} from '@/api/base/company'
import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import * as BaseWarehouseApi from '@/api/base/warehouse';
import ImageUpload from '@/components/ImageUpload';
export default {
name: "WaresForm",
components: {TreeSelect,ImageUpload},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
barCode: undefined,
code: undefined,
name: undefined,
model: undefined,
price: undefined,
type: undefined,
unit: undefined,
warehouse: undefined,
miniStock: undefined,
maxStock: undefined,
stock: undefined,
img: undefined,
attribute: undefined,
corpId: undefined,
coverImg: undefined,
carModel: undefined,
remark: undefined,
dataForm: undefined,
corpIds: [],
status: '01',
},
//
formRules: {
name: [{required: true, message: '商品名称不能为空', trigger: 'blur'}],
barCode: [{required: true, message: '条形码不能为空', trigger: 'blur'}],
price: [{required: true, message: '销售价格不能为空', trigger: 'blur'}],
unit: [{required: true, message: '计量单位不能为空', trigger: 'blur'}],
type: [{required: true, message: '所属分类不能为空', trigger: 'blur'}],
},
activeNames: ['1', '2'],
//
baseTypeTree: [],
//
companyList: [],
//
baseWarehouseTree: []
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await WaresApi.getWares(id);
this.formData = res.data;
this.title = "修改配件库";
} finally {
this.formLoading = false;
}
}
this.title = "新增配件库";
//
await this.getBaseTypeTree();
//
await this.listCompany();
//
await this.getBaseWarehouseTree();
},
/** 获得配置类型树 */
async getBaseTypeTree() {
this.baseTypeTree = [];
let param = {
type: '02'
}
const res = await BaseTypeApi.getBaseTypeList(param);
const root = {id: 0, name: '顶级配置类型', children: []};
root.children = this.handleTree(res.data, 'id', 'parentId', "children", "0")
this.baseTypeTree.push(root)
},
/** 查询子公司 */
async listCompany() {
const res = await getCompanyList()
this.companyList = res.data
},
/** 获得仓库树 */
async getBaseWarehouseTree() {
this.baseWarehouseTree = [];
const res = await BaseWarehouseApi.getBaseWarehouseList();
const root = {id: 0, name: '顶级仓库', children: []};
root.children = this.handleTree(res.data, 'id', 'parentId', "children", "0")
this.baseWarehouseTree.push(root)
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
this.formData.corpId = this.formData.corpIds + ''
const data = this.formData;
//
if (data.id) {
await WaresApi.updateWares(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await WaresApi.createWares(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 转换仓库数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
},
/** 表单重置 */
reset() {
this.formData = {
barCode: undefined,
code: undefined,
name: undefined,
model: undefined,
price: undefined,
type: undefined,
unit: undefined,
warehouse: undefined,
miniStock: undefined,
maxStock: undefined,
stock: undefined,
img: undefined,
attribute: undefined,
corpId: undefined,
coverImg: undefined,
carModel: undefined,
remark: undefined,
dataForm: undefined,
corpIds: [],
status: '01',
};
this.resetForm("formRef");
}
}
};
</script>

View File

@ -0,0 +1,174 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品编码" prop="code">
<el-input v-model="queryParams.code" placeholder="请输入商品编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="商品名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['repair:wares:create']">新增
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="商品名称" align="left" prop="name"/>
<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="price"/>
<el-table-column label="条形码" align="left" prop="barCode"/>
<el-table-column label="计量单位" align="center" prop="unit">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" :value="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="配件属性" align="center" prop="attribute">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.REPAIR_WARES_ATTRIBUTE" :value="scope.row.attribute"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template v-slot="scope">
<el-tag v-if="scope.row.status == '01'" type="success">正常</el-tag>
<el-tag v-if="scope.row.status == '02'" type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="所属子公司" align="left" prop="corpNames"/>
<el-table-column label="默认仓库" align="left" prop="warehouseName"/>
<el-table-column label="来源" align="center" prop="dataForm">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.REPAIR_WARES_DATA_FORM" :value="scope.row.dataForm"/>
</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="openForm(scope.row.id)"
v-hasPermi="['repair:wares:update']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['repair:wares:delete']">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<WaresForm ref="formRef" @success="getList"/>
</div>
</template>
<script>
import * as WaresApi from '@/api/repair/wares';
import WaresForm from './WaresForm.vue';
export default {
name: "Wares",
components: {
WaresForm,
},
data() {
return {
//
loading: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
isExpandAll: true,
//
refreshTable: true,
//
currentRow: {},
//
queryParams: {
pageNo: 1,
pageSize: 10,
barCode: null,
code: null,
name: null,
model: null,
price: null,
type: null,
unit: null,
warehouse: null,
miniStock: null,
maxStock: null,
stock: null,
img: null,
attribute: null,
corpId: null,
coverImg: null,
carModel: null,
remark: null,
createTime: [],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
async getList() {
try {
this.loading = true;
const res = await WaresApi.getWaresPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
},
/** 删除按钮操作 */
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除配件库编号为"' + id + '"的数据项?')
try {
await WaresApi.deleteWares(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {
}
},
}
};
</script>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询app轮播图列表
export function listSwiper(query) {
return request({
url: '/system/appSwiper/list',
method: 'get',
params: query
})
}
// 查询app轮播图详细
export function getSwiper(swiperId) {
return request({
url: '/system/appSwiper/' + swiperId,
method: 'get'
})
}
// 新增app轮播图
export function addSwiper(data) {
return request({
url: '/system/appSwiper/add',
method: 'post',
data: data
})
}
// 修改app轮播图
export function updateSwiper(data) {
return request({
url: '/system/appSwiper/edit',
method: 'post',
data: data
})
}
// 删除app轮播图
export function delSwiper(swiperId) {
return request({
url: '/system/appSwiper/del?idList=' + swiperId,
method: 'post'
})
}

View File

@ -0,0 +1,266 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="板块名称" prop="moudleName">
<el-select v-model="queryParams.moudleName" placeholder="请选择板块名称" clearable>
<el-option
v-for="dict in dict.type.app_module_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="swiperList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="板块名称" align="center" prop="moudleName">
<template slot-scope="scope">
<dict-tag :options="dict.type.app_module_type" :value="scope.row.moudleName"/>
</template>
</el-table-column>
<el-table-column label="轮播图照片" align="center" prop="swiperPicture" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.swiperPicture" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="排序" align="center" prop="listOrder" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="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>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改app轮播图对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="板块名称" prop="moudleName">
<el-select v-model="form.moudleName" placeholder="请选择板块名称">
<el-option
v-for="dict in dict.type.app_module_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮播图名称" prop="swiperName">
<el-input v-model="form.swiperName" placeholder="请输入轮播图名称" />
</el-form-item>
<el-form-item label="轮播图照片" prop="swiperPicture">
<image-upload :limit="5" v-model="form.swiperPicture"/>
</el-form-item>
<el-form-item label="跳转地址" prop="jumpUrl">
<el-input v-model="form.jumpUrl" placeholder="请输入跳转地址" />
</el-form-item>
<el-form-item label="排序" prop="listOrder">
<el-input v-model="form.listOrder" placeholder="请输入排序" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSwiper, getSwiper, delSwiper, addSwiper, updateSwiper } from "./api";
import request from "@/utils/request";
import DictTag from '@/components/DictTagOld/index.vue'
export default {
name: "Swiper",
components:{DictTag},
dicts: ['app_module_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// app
swiperList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
moudleName: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.dict = {type:{}}
for (let i = 0; i < this.$options.dicts.length; i++) {
request({
url: '/rescue/dict/data/type/'+this.$options.dicts[i],
method: 'get'
}).then(res=>{
this.$set(this.dict.type,this.$options.dicts[i],res.data)
})
}
this.getList();
},
methods: {
/** 查询app轮播图列表 */
getList() {
this.loading = true;
listSwiper(this.queryParams).then(response => {
this.swiperList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
swiperId: null,
moudleName: null,
swiperName: null,
swiperPicture: null,
jumpUrl: null,
listOrder: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.swiperId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加app轮播图";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const swiperId = row.swiperId || this.ids
getSwiper(swiperId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改app轮播图";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.swiperId != null) {
updateSwiper(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSwiper(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const swiperIds = row.swiperId || this.ids;
this.$modal.confirm('是否确认删除app轮播图编号为"' + swiperIds + '"的数据项?').then(function() {
return delSwiper(swiperIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/swiper/export', {
...this.queryParams
}, `swiper_${new Date().getTime()}.xlsx`)
}
}
};
</script>