完成资产管理相关开发
This commit is contained in:
parent
f0f1d45a0f
commit
a8cfb8ea44
@ -120,3 +120,13 @@ export const apiGetRePrintCode = (data, code) => {
|
||||
return http({ url: `/lz_management/oneCode/re/print?code=${code}`, method: 'get', data })
|
||||
}
|
||||
|
||||
// 批量生成制定数量的编码
|
||||
export const apiGetNewPrintCodes = (data, count) => {
|
||||
return http({ url: `/lz_management/oneCode/new/prints?counts=${count}`, method: 'get', data })
|
||||
}
|
||||
|
||||
// 获取编码
|
||||
export const apiGetCodes = data => {
|
||||
return http({ url: `/lz_management/oneCode/get/getPrints`, method: 'post', data })
|
||||
}
|
||||
|
||||
|
||||
BIN
src/assets/img/equipment/ding_sao_yi_sao.png
Normal file
BIN
src/assets/img/equipment/ding_sao_yi_sao.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@ -33,10 +33,7 @@ const dingtalkRoutes=[
|
||||
{ path: '/devicemark', component: _import('modules/device/device-mark'), name: 'devicemark', meta: { title: '设备备注' } },
|
||||
{ path: '/devicestaff', component: _import('modules/device/device-staff-device'), name: 'devicestaff', meta: { title: '人员资产信息' } },
|
||||
{ path: '/devicestaffdepat', component: _import('modules/device/device-staff-depat'), name: 'devicestaffdepat', meta: { title: '搜索人员' } },
|
||||
{ path: '/devicespec', component: _import('modules/device-manage/device-spec'), name: 'devicespec', meta: { title: '设备规格管理' } },
|
||||
{ path: '/devicetypes', component: _import('modules/device-manage/device-type'), name: 'devicetypes', meta: { title: '设备类型管理' } },
|
||||
{ path: '/devicebrand', component: _import('modules/device-manage/device-brand'), name: 'devicebrand', meta: { title: '设备品牌管理' } },
|
||||
{ path: '/devicelist', component: _import('modules/device-manage/device-list'), name: 'devicelist', meta: { title: '设备列表管理' } },
|
||||
|
||||
{ path: '/devicedetail', component: _import('modules/device/device-detail'), name: 'devicedetail', meta: { title: '资产盘点设备详情页' } }
|
||||
]
|
||||
|
||||
@ -108,13 +105,13 @@ router.beforeEach((to, from, next) => {
|
||||
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
|
||||
next()
|
||||
} else if (fnIsInRoutes(to, dingtalkRoutes)) {//判断是否全屏路由
|
||||
/*if(fnCheckToken()){
|
||||
if(fnCheckToken()){
|
||||
next()
|
||||
} else {
|
||||
clearLoginInfo()
|
||||
next({ name: 'login' })
|
||||
}*/
|
||||
next()
|
||||
}
|
||||
//next()
|
||||
/*console.log(to)
|
||||
let newpage = router.resolve({
|
||||
name: to.path,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="!id ? '新增规格' : '编辑规格'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
<el-dialog :title="!id ? '新增品牌' : '编辑品牌'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
>
|
||||
|
||||
<el-form :inline="true">
|
||||
@ -25,8 +25,8 @@
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="warning" @click="save">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-button type="warning" @click="save(0)">取消</el-button>
|
||||
<el-button type="primary" @click="save(1)">保存</el-button>
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
@ -93,7 +93,11 @@ export default {
|
||||
console.log(val)
|
||||
|
||||
},
|
||||
save(){
|
||||
save(val){
|
||||
if(val == 0){
|
||||
this.visible = false
|
||||
return
|
||||
}
|
||||
if(this.specReq.typeId == null){
|
||||
this.$message.error('请选择类型')
|
||||
return
|
||||
|
||||
@ -19,15 +19,14 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<el-button type="primary" @click="getData()">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addNewSpec()">新增品牌</el-button>
|
||||
<el-button type="success" @click="addNewSpec()">新增品牌</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="dataListLoading" :data="data" style="width: 100%" @row-click="rowClick">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
|
||||
<el-table-column prop="typeName" header-align="center" align="center" label="类型"></el-table-column>
|
||||
<el-table-column prop="brand" header-align="center" align="center" label="品牌"></el-table-column>
|
||||
@ -117,7 +116,7 @@ export default {
|
||||
|
||||
},
|
||||
changeDepartment(type) {
|
||||
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
|
||||
},
|
||||
@ -193,6 +192,7 @@ export default {
|
||||
});
|
||||
},
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
|
||||
40
src/views/modules/device-manage/device-list-add.vue
Normal file
40
src/views/modules/device-manage/device-list-add.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<el-dialog :title="'新增绑定信息'" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="使用钉钉扫一扫">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
:src="url"
|
||||
:fit="fit"></el-image>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="save">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
url: require('@/assets/img/equipment/ding_sao_yi_sao.png')
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
async init(obj, types, brands) {
|
||||
console.log('device-list-add init')
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
save() {
|
||||
|
||||
this.visible = false
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="!id ? '新增规格' : '编辑规格'" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-dialog :title="!id ? '新增' : '编辑设备信息'" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="类型">
|
||||
<el-select v-model="type" :disabled="departmentReaderOnly" @change="changeType"></el-select>
|
||||
@ -78,8 +78,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="warning" @click="save">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-button type="warning" @click="save(0)">取消</el-button>
|
||||
<el-button type="primary" @click="save(1)">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -176,7 +176,12 @@ export default {
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
save() {
|
||||
save(val) {
|
||||
if(val == 0){
|
||||
this.visible = false
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
this.specReq.id = this.id
|
||||
this.specReq.buyAmount = this.buyAmount;
|
||||
@ -187,6 +192,7 @@ export default {
|
||||
this.specReq.originalCode = this.originalCode;
|
||||
this.specReq.no = this.no;
|
||||
this.editSpecs();
|
||||
|
||||
},
|
||||
editSpecs() {
|
||||
console.log("editSpecs");
|
||||
|
||||
@ -92,12 +92,12 @@
|
||||
<el-input v-model="specReq.user" placeholder="使用人信息" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="现有编号">
|
||||
<el-input v-model="specReq.code" placeholder="现有编号" clearable></el-input>
|
||||
<el-form-item label="现有编码">
|
||||
<el-input v-model="specReq.code" placeholder="现有编码" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="自带编号">
|
||||
<el-input v-model="specReq.qr" placeholder="自带编号" clearable></el-input>
|
||||
<el-form-item label="自带标识">
|
||||
<el-input v-model="specReq.qr" placeholder="设备自带标识" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
@ -110,19 +110,21 @@
|
||||
<el-form-item>
|
||||
<el-button type="warning" @click="clearGet()">清空筛选</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="addNew()">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="dataListLoading" :data="data" style="width: 100%" @row-click="rowClick">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
|
||||
<el-table-column prop="type" header-align="center" align="center" label="类型"></el-table-column>
|
||||
<el-table-column prop="brandName" header-align="center" align="center" label="品牌"></el-table-column>
|
||||
<el-table-column prop="specType" header-align="center" align="center" label="规格"></el-table-column>
|
||||
<el-table-column prop="user" header-align="center" align="center" label="使用方"></el-table-column>
|
||||
<el-table-column prop="code" header-align="center" align="center" label="现有标识"></el-table-column>
|
||||
|
||||
<el-table-column prop="code" header-align="center" align="center" label="现有编码"></el-table-column>
|
||||
|
||||
<el-table-column prop="originalCode" header-align="center" align="center" label="自带标识"></el-table-column>
|
||||
<el-table-column prop="gmtOutbound" header-align="center" align="center" label="出库时间"></el-table-column>
|
||||
<el-table-column prop="gmtInbound" header-align="center" align="center" label="入库时间"></el-table-column>
|
||||
<el-table-column prop header-align="center" align="center" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<div class="conatnt-name">
|
||||
@ -130,10 +132,14 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mark" header-align="center" align="center" label="备注"></el-table-column>
|
||||
<el-table-column prop="gmtOutbound" header-align="center" align="center" label="出库时间"></el-table-column>
|
||||
<el-table-column prop="gmtInbound" header-align="center" align="center" label="入库时间"></el-table-column>
|
||||
|
||||
<el-table-column prop="buyAmount" header-align="center" align="center" label="买入金额"></el-table-column>
|
||||
<el-table-column prop="saleAmount" header-align="center" align="center" label="出售金额"></el-table-column>
|
||||
<el-table-column prop="no" header-align="center" align="center" label="审批编号"></el-table-column>
|
||||
<el-table-column prop="mark" header-align="center" align="center" label="备注"></el-table-column>
|
||||
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="handleAddOrUpdate(scope.row)">编辑</el-button>
|
||||
@ -152,6 +158,7 @@
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
<device-list-detail v-if="isShowDetail" ref="deviceListDetail" @refreshDataList="getData"></device-list-detail>
|
||||
<device-list-add v-if="isShowAdd" ref="deviceListAdd" @refreshDataList="getData"></device-list-add>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -164,13 +171,16 @@ import {
|
||||
} from "@/api/api_equipment";
|
||||
import * as dd from "dingtalk-jsapi";
|
||||
import DeviceListDetail from "./device-list-detail.vue";
|
||||
import DeviceListAdd from "./device-list-add.vue";
|
||||
export default {
|
||||
components: {
|
||||
DeviceListDetail,
|
||||
DeviceListAdd,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowSearch: true,
|
||||
isShowAdd: true,
|
||||
data: [],
|
||||
types: [],
|
||||
brands: [],
|
||||
@ -251,40 +261,13 @@ export default {
|
||||
}
|
||||
return status;
|
||||
},
|
||||
clearGet() {
|
||||
this.specReq.page = 1
|
||||
this.specReq.sort = null
|
||||
this.specReq.order = null
|
||||
this.specReq.id = null
|
||||
this.specReq.gmtCreate = null
|
||||
this.specReq.gmtModified = null
|
||||
this.specReq.specType = null
|
||||
this.specReq.type = null
|
||||
this.specReq.num = null
|
||||
this.specReq.qr = null
|
||||
this.specReq.unit = null
|
||||
this.specReq.user = null
|
||||
this.specReq.owner = null
|
||||
this.specReq.originalCode = null
|
||||
this.specReq.code = null
|
||||
this.specReq.mark = null
|
||||
this.specReq.gmtOutbound = null
|
||||
this.specReq.gmtInbound = null
|
||||
this.specReq.equipmentState = null
|
||||
this.specReq.buyAmount = null
|
||||
this.specReq.saleAmount = null
|
||||
this.specReq.no = null
|
||||
this.specReq.brandId = null
|
||||
this.specReq.typeId = null
|
||||
this.specReq.gmtInStartTime = null
|
||||
this.specReq.gmtInEndTime = null
|
||||
this.specReq.gmtOutStartTime = null
|
||||
this.specReq.gmtOutEndTime = null
|
||||
this.specReq.other = null
|
||||
this.inTime = null
|
||||
this.outTime = null
|
||||
this.getData()
|
||||
addNew() {
|
||||
setTimeout(() => {
|
||||
this.$refs.deviceListAdd.init(null, this.types, this.brands);
|
||||
}, 500);
|
||||
this.isShowDetail = true;
|
||||
},
|
||||
|
||||
changeOutData(val) {
|
||||
console.log(val)
|
||||
if(val){
|
||||
@ -295,8 +278,7 @@ export default {
|
||||
this.specReq.gmtOutEndTime = null
|
||||
}
|
||||
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
this.btnSearch()
|
||||
},
|
||||
changeInData(val) {
|
||||
console.log(val)
|
||||
@ -308,8 +290,7 @@ export default {
|
||||
this.specReq.gmtInEndTime = null
|
||||
}
|
||||
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
this.btnSearch()
|
||||
},
|
||||
changeDepartment(type) {
|
||||
this.specReq.page = 1;
|
||||
@ -318,17 +299,46 @@ export default {
|
||||
this.getBrands();
|
||||
this.specReq.brandId = null;
|
||||
} else {
|
||||
this.getData();
|
||||
this.btnSearch()
|
||||
}
|
||||
},
|
||||
sizeChangeHandle(val) {
|
||||
this.specReq.page = 1;
|
||||
this.specReq.rows = val;
|
||||
this.getData();
|
||||
this.btnSearch()
|
||||
},
|
||||
getData() {
|
||||
console.log("获取数据");
|
||||
console.log(this.name);
|
||||
console.log(this.categorys);
|
||||
this.dataListLoading = true;
|
||||
apiGetUseDeviceList(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.data = data.rows;
|
||||
this.totalPage = data.total;
|
||||
this.types = data.types;
|
||||
this.tCounts = data.tCounts;
|
||||
this.specReq.count = data.curCount;
|
||||
} else {
|
||||
this.data = [];
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getBrands() {
|
||||
apiGetDeviceBrands(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.brands = data.brands;
|
||||
this.btnSearch()
|
||||
} else {
|
||||
this.brands = [];
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
currentChangeHandle(val) {
|
||||
this.specReq.page = val;
|
||||
this.getData();
|
||||
this.btnSearch()
|
||||
},
|
||||
// 新增 / 编辑
|
||||
handleAddOrUpdate(val) {
|
||||
@ -410,38 +420,43 @@ export default {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
console.log("获取数据");
|
||||
console.log(this.name);
|
||||
console.log(this.categorys);
|
||||
this.dataListLoading = true;
|
||||
apiGetUseDeviceList(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.data = data.rows;
|
||||
this.totalPage = data.total;
|
||||
this.types = data.types;
|
||||
this.tCounts = data.tCounts;
|
||||
this.specReq.count = data.curCount;
|
||||
} else {
|
||||
this.data = [];
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
getBrands() {
|
||||
apiGetDeviceBrands(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.brands = data.brands;
|
||||
this.getData();
|
||||
} else {
|
||||
this.brands = [];
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
clearGet() {
|
||||
this.specReq.page = 1
|
||||
this.specReq.sort = null
|
||||
this.specReq.order = null
|
||||
this.specReq.id = null
|
||||
this.specReq.gmtCreate = null
|
||||
this.specReq.gmtModified = null
|
||||
this.specReq.specType = null
|
||||
this.specReq.type = null
|
||||
this.specReq.num = null
|
||||
this.specReq.qr = null
|
||||
this.specReq.unit = null
|
||||
this.specReq.user = null
|
||||
this.specReq.owner = null
|
||||
this.specReq.originalCode = null
|
||||
this.specReq.code = null
|
||||
this.specReq.mark = null
|
||||
this.specReq.gmtOutbound = null
|
||||
this.specReq.gmtInbound = null
|
||||
this.specReq.equipmentState = null
|
||||
this.specReq.buyAmount = null
|
||||
this.specReq.saleAmount = null
|
||||
this.specReq.no = null
|
||||
this.specReq.brandId = null
|
||||
this.specReq.typeId = null
|
||||
this.specReq.gmtInStartTime = null
|
||||
this.specReq.gmtInEndTime = null
|
||||
this.specReq.gmtOutStartTime = null
|
||||
this.specReq.gmtOutEndTime = null
|
||||
this.specReq.other = null
|
||||
this.inTime = null
|
||||
this.outTime = null
|
||||
this.getData()
|
||||
},
|
||||
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
|
||||
237
src/views/modules/device-manage/device-onecode.vue
Normal file
237
src/views/modules/device-manage/device-onecode.vue
Normal file
@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
|
||||
<el-form-item label="打印状态">
|
||||
<el-select
|
||||
v-model="specReq.isPrint"
|
||||
:disabled="departmentReaderOnly"
|
||||
@change="changeDepartment()"
|
||||
>
|
||||
<el-option v-for="item in stateList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码">
|
||||
<el-input v-model="specReq.code" placeholder="请输入编码" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getData()">查询</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="新打印数量">
|
||||
<el-input v-model="newCount" placeholder="请输入要新打印机编码数量" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="printNewCodes()">新打印</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="dataListLoading" :data="data" style="width: 100%" @row-click="rowClick">
|
||||
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
|
||||
<el-table-column prop="code" header-align="center" align="center" label="编码"></el-table-column>
|
||||
<el-table-column prop="isPrint" header-align="center" align="center" label="是否打印">
|
||||
<template slot-scope="scope">
|
||||
<div class="conatnt-name">
|
||||
<span>{{ getStatusStr(scope.row.isPrint) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="180" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handlePrint(scope.row)"
|
||||
>重新打印
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="specReq.page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="specReq.rows"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
<device-type-detail v-if="isShowDetail" ref="deviceTypeDetail" @refreshDataList="getData"></device-type-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { apiGetNewPrintCodes, apiGetCodes, apiGetRePrintCode } from "@/api/api_equipment";
|
||||
import DeviceTypeDetail from './device-type-detail.vue'
|
||||
export default {
|
||||
components: {
|
||||
DeviceTypeDetail
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
isShowSearch: true,
|
||||
data: [],
|
||||
dataListLoading: false,
|
||||
newCount: null,
|
||||
showHeader: false,
|
||||
totalPage: 1,
|
||||
departmentReaderOnly: false,
|
||||
specReq: {
|
||||
page: 1,
|
||||
rows: 10,
|
||||
id: null,
|
||||
isDelete: 0,
|
||||
isPrint: null,
|
||||
gmtCreate: null,
|
||||
gmtModified: null,
|
||||
code: null,
|
||||
},
|
||||
stateList:[
|
||||
{value: null, label: '全部'},
|
||||
{value: 0, label: '未打印'},
|
||||
{value: 1, label: '已打印'},
|
||||
],
|
||||
isShowDetail: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.handleGetImgCaptcha()
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
printNewCodes(){
|
||||
if(!this.newCount || this.newCount == 0){
|
||||
this.$message.error('请输入大于0的打印数量')
|
||||
return
|
||||
}
|
||||
apiGetNewPrintCodes({}, this.newCount).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.getData()
|
||||
this.$message("发送打印请求成功");
|
||||
|
||||
} else {
|
||||
this.$message.error("发送打印请求失败!" + data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
changeDepartment(){
|
||||
this.specReq.page = 1;
|
||||
this.getData()
|
||||
},
|
||||
sizeChangeHandle(val) {
|
||||
this.specReq.page = 1
|
||||
this.specReq.rows = val
|
||||
this.getData();
|
||||
},
|
||||
currentChangeHandle(val) {
|
||||
this.specReq.page = val
|
||||
this.getData();
|
||||
},
|
||||
getStatusStr(status) {
|
||||
if (status < 2) {
|
||||
return this.stateList[status + 1].label;
|
||||
}
|
||||
return status;
|
||||
},
|
||||
handlePrint(val) {
|
||||
apiGetRePrintCode({}, val.code).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.getData()
|
||||
this.$message("发送打印请求成功");
|
||||
|
||||
} else {
|
||||
this.$message.error("发送打印请求失败!" + data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getData() {
|
||||
console.log("获取数据")
|
||||
console.log(this.name)
|
||||
console.log(this.categorys)
|
||||
this.dataListLoading = true
|
||||
apiGetCodes(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.data = data.codes.list;
|
||||
this.totalPage = data.codes.totalCount
|
||||
} else {
|
||||
this.data = [];
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
rowClick(row, event, column) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.el-col {
|
||||
border-radius: 10px;
|
||||
}
|
||||
.bg-purple-dark {
|
||||
background: #99a9bf;
|
||||
}
|
||||
.bg-purple {
|
||||
background: #d3dce6;
|
||||
}
|
||||
.bg-purple-light {
|
||||
background: #e5f2f1;
|
||||
}
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
}
|
||||
.row-bg {
|
||||
padding: 10px 0;
|
||||
background-color: #f9fafc;
|
||||
}
|
||||
.div_height {
|
||||
height: 38px;
|
||||
}
|
||||
.div_width {
|
||||
width: 100%;
|
||||
}
|
||||
.width_100 {
|
||||
width: 100px;
|
||||
}
|
||||
.center {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
padding: 1em;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid;
|
||||
}
|
||||
.flex_son {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0x solid;
|
||||
}
|
||||
</style>
|
||||
@ -46,8 +46,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="warning" @click="save">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-button type="warning" @click="save(0)">取消</el-button>
|
||||
<el-button type="primary" @click="save(1)">保存</el-button>
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
@ -150,7 +150,11 @@ export default {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
save(){
|
||||
save(val){
|
||||
if(val == 0){
|
||||
this.visible = false
|
||||
return
|
||||
}
|
||||
if(this.specReq.typeId == null){
|
||||
this.$message.error('请选择类型')
|
||||
return
|
||||
|
||||
@ -28,15 +28,14 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<el-button type="primary" @click="getData()">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addNewSpec()">新增规格</el-button>
|
||||
<el-button type="success" @click="addNewSpec()">新增规格</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="dataListLoading" :data="data" style="width: 100%" @row-click="rowClick">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
|
||||
<el-table-column prop="type" header-align="center" align="center" label="类型"></el-table-column>
|
||||
<el-table-column prop="brand" header-align="center" align="center" label="品牌"></el-table-column>
|
||||
@ -142,6 +141,7 @@ export default {
|
||||
this.getBrands()
|
||||
this.specReq.brandId = null
|
||||
}else{
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
}
|
||||
},
|
||||
@ -224,6 +224,7 @@ export default {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.brands = data.brands
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
} else {
|
||||
this.brands = [];
|
||||
@ -232,6 +233,7 @@ export default {
|
||||
});
|
||||
},
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :title="!id ? '新增规格' : '编辑规格'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
<el-dialog :title="!id ? '新增类型' : '编辑类型'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
>
|
||||
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="warning" @click="save">取消</el-button>
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-button type="warning" @click="save(0)">取消</el-button>
|
||||
<el-button type="primary" @click="save(1)">保存</el-button>
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
@ -74,7 +74,11 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
save(){
|
||||
save(val){
|
||||
if(val == 0){
|
||||
this.visible = false
|
||||
return
|
||||
}
|
||||
if(!this.type || this.type.length == 0){
|
||||
this.$message.error('请输入类型名称')
|
||||
return
|
||||
|
||||
@ -8,15 +8,14 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="getData()">查询</el-button>
|
||||
<el-button type="primary" @click="getData()">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addNewSpec()">新增类型</el-button>
|
||||
<el-button type="success" @click="addNewSpec()">新增类型</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="dataListLoading" :data="data" style="width: 100%" @row-click="rowClick">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
|
||||
<el-table-column prop="type" header-align="center" align="center" label="类型"></el-table-column>
|
||||
<el-table-column prop="rank" header-align="center" align="center" label="排序"></el-table-column>
|
||||
@ -109,6 +108,7 @@ export default {
|
||||
this.getBrands()
|
||||
this.specReq.brandId = null
|
||||
}else{
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
}
|
||||
},
|
||||
@ -187,6 +187,7 @@ export default {
|
||||
console.log(data);
|
||||
if (data && data.code === 0) {
|
||||
this.brands = data.brands
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
} else {
|
||||
this.brands = [];
|
||||
@ -195,6 +196,7 @@ export default {
|
||||
});
|
||||
},
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user