Browse Source

zww -申请审核修改 ,仓库,库位新增 ,工具名称新增

master
zuowenwen 4 years ago
parent
commit
957deddb1c
  1. 17
      src/api/warehouse/location.js
  2. 17
      src/api/warehouse/warehouse.js
  3. 1
      src/views/modules/purchaseorder/procurementReview.vue
  4. 72
      src/views/modules/purchaseorder/purchaseRequisition.vue
  5. 971
      src/views/modules/warehouse/location.vue
  6. 994
      src/views/modules/warehouse/warehouse.vue

17
src/api/warehouse/location.js

@ -0,0 +1,17 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取库房信息
export const getLocationList = data => createAPI(`warehouse/getLocationList`,'POST',data)
// 保存库房信息
export const saveLocation = data => createAPI(`warehouse/saveLocation`,'POST',data)
// 删除库房信息
export const delLocation = data => createAPI(`warehouse/delLocation`,'POST',data)
// 获取库房信息
export const getWarehouseList = data => createAPI(`warehouse/getWarehouseList`,'POST',data)

17
src/api/warehouse/warehouse.js

@ -0,0 +1,17 @@
import { createAPI } from "@/utils/httpRequest.js";
// 获取库房信息
export const getWarehouseList = data => createAPI(`warehouse/getWarehouseList`,'POST',data)
// 保存库房信息
export const saveWarehouse = data => createAPI(`warehouse/saveWarehouse`,'POST',data)
// 删除库房信息
export const delWarehouse = data => createAPI(`warehouse/delWarehouse`,'POST',data)
// 删除库房类型信息
export const getWareHouseTypeList = data => createAPI(`factory/tblbasedata/getTblBaseList`,'POST',data)

1
src/views/modules/purchaseorder/procurementReview.vue

@ -691,6 +691,7 @@
this.saveData.id = row.id
this.saveData.approveResultComments = row.approveResultComments
this.saveData.partNo = this.currentReviewStepData.partno
this.saveData.partdesc = this.currentReviewStepData.partdesc
this.saveData.itemNo = this.currentReviewStepData.itemno
this.saveData.qty = this.currentReviewStepData.qty
this.saveData.authTypeDb = row.authTypeDb

72
src/views/modules/purchaseorder/purchaseRequisition.vue

@ -35,6 +35,14 @@
<el-option value="N" label="未审批"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="inputSearch4">
<el-select v-model="mainQueryData.approveresult" style="width: 110px;">
<el-option value="" label="全部"></el-option>
<el-option value="审批全通过" label="审批全通过"></el-option>
<el-option value="审批未通过" label="审批未通过"></el-option>
<el-option value="审批部分通过" label="审批部分通过"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList('Y')" type="primary">{{buttons.search}}</el-button>
<el-button @click="initAddModel(null)" type="primary">{{buttons.addLabelName}}</el-button>
@ -95,9 +103,9 @@
width="120"
:label="buttons.operating">
<template slot-scope="scope">
<a v-if="scope.row.authorizeFlag == '未审批'" @click="initAddModel(scope.row)">{{buttons.edit}}</a>
<a v-if="scope.row.authorizeFlag == '未审批'"@click="updateAuthorizeFlag(scope.row)">{{buttons.close}}</a>
<a v-if="scope.row.authorizeFlag == '已审批'"@click="initReapply(scope.row)">{{buttons.reapply}}</a>
<a v-if="scope.row.authorizeFlag == 'N'" @click="initAddModel(scope.row)">{{buttons.edit}}</a>
<a v-if="scope.row.authorizeFlag == 'N'"@click="updateAuthorizeFlag(scope.row)">{{buttons.close}}</a>
<a v-if="scope.row.authorizeFlag == 'Y' && scope.row.approvedFlag != 'Y' && scope.row.approveresult == '审批未通过'"@click="initReapply(scope.row)">{{buttons.reapply}}</a>
<a @click="initReviewDetails(scope.row.requisitionno)">{{buttons.reviewDetails}}</a>
</template>
</el-table-column>
@ -164,7 +172,7 @@
</el-dialog>
<el-dialog title="申请单信息" :visible.sync="addPRDetailFlag" width="522px" :close-on-click-modal="false"
<el-dialog title="申请单信息" :visible.sync="addPRDetailFlag" width="672px" :close-on-click-modal="false"
:close-on-press-escape="false" v-drag>
<el-form :inline="true" label-position="top">
<el-form-item :label="inputSearch5">
@ -190,7 +198,10 @@
</el-select>
</el-form-item>
<el-form-item :label="inputSearch6">
<el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.partno"></el-input>
<el-input style="text-align: left;width: 143px" onkeyup="this.value = this.value.toUpperCase()" v-model="currentPRDetailData.partno"></el-input>
</el-form-item>
<el-form-item :label="inputSearch11">
<el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.partdesc"></el-input>
</el-form-item>
<el-form-item :label="inputSearch7">
<el-input style="text-align: left;width: 143px" @change="getNumber()" oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
@ -204,7 +215,7 @@
v-model="currentPRDetailData.totalPrice"
:disabled="true"></el-input>
</el-form-item>
<el-form-item style="margin-top: 10px">
<!--<el-form-item style="margin-top: 10px">
<upload v-on:childByValue="childByValue"></upload>
</el-form-item>
<el-table
@ -240,7 +251,7 @@
<a @click="fileDownload(scope.row)">{{buttons.fileDownload}}</a>
</template>
</el-table-column>
</el-table>
</el-table>-->
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addPRDetailFlag = false">取消</el-button>
@ -329,6 +340,8 @@
inputSearch8: '预估单价',
inputSearch9: '预估总价',
inputSearch10: '供应商名称',
inputSearch11: '刀模名称',
inputSearch12: '审批结果',
currentPRDetailData: {
username: this.$store.state.user.name,
requisitionno: '',
@ -338,6 +351,7 @@
suppliername: '',
orderType: '',
partno: '',
partdesc : '',
qty: 0,
price: 0,
totalPrice: 0,
@ -355,6 +369,7 @@
orderType: '',
partno: '',
authorizeFlag: 'N',
approveresult : '',
site: this.$store.state.user.site,
userId: this.$store.state.user.name,
limit: '',
@ -449,6 +464,23 @@
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 2001,
serialNumber: 'PRHeader2001Partdesc',
tableId: "PRHeaderTable",
tableName: "PRHeader",
columnProp: "partdesc",
headerAlign: "center",
align: "center",
columnLabel: "刀模名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 2001,
@ -540,7 +572,7 @@
serialNumber: 'PRHeader2001AuthorizeFlag',
tableId: "PRHeaderTable",
tableName: "PRHeader",
columnProp: "authorizeFlag",
columnProp: "strAuthorizeFlag",
headerAlign: "center",
align: "center",
columnLabel: "是否审批",
@ -557,7 +589,7 @@
serialNumber: 'review2101AuthorizeFlag',
tableId: "review2101",
tableName: "PRHeader",
columnProp: "strApproveResult",
columnProp: "approveresult",
headerAlign: "center",
align: "left",
columnLabel: "审批结果",
@ -950,7 +982,7 @@
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 200;
this.height = window.innerHeight - 230;
})
},
activated() {
@ -1014,7 +1046,7 @@
savePRDetail() {
this.bannersBut = true
if (this.currentPRDetailData.orderType == null || this.currentPRDetailData.orderType.trim() === "") {
this.$alert('请选择处理类型!', '处理类型', {
this.$alert('请选择处理类型!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
@ -1022,7 +1054,7 @@
});
return
} else if (this.currentPRDetailData.supplierid == null || this.currentPRDetailData.supplierid.trim() === "") {
this.$alert('请选择供应商名称!', '供应商名称', {
this.$alert('请选择供应商名称!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
@ -1030,7 +1062,7 @@
});
return
} else if (this.currentPRDetailData.partno == null || this.currentPRDetailData.partno.trim() === "") {
this.$alert('请输入刀模编码!', '刀模编码', {
this.$alert('请输入刀模编码!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
@ -1038,7 +1070,7 @@
});
return
} else if (this.currentPRDetailData.qty === 0 || this.currentPRDetailData.qty <= 0) {
this.$alert('请输入申请数量!', '申请数量', {
this.$alert('请输入申请数量!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
@ -1046,7 +1078,15 @@
});
return
} else if (this.currentPRDetailData.price === 0 || this.currentPRDetailData.price <= 0) {
this.$alert('请输入预估单价!', '预估单价', {
this.$alert('请输入预估单价!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
}
});
return
}else if (this.currentPRDetailData.partDesc === 0 || this.currentPRDetailData.partDesc <= 0) {
this.$alert('请输入刀模名称!', '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.bannersBut = false
@ -1112,6 +1152,7 @@
this.currentPRDetailData.price = 0
this.currentPRDetailData.status = '已下达'
this.currentPRDetailData.taxCode = ''
this.currentPRDetailData.partdesc = ''
} else {
this.currentPRDetailData.requisitionno = row.requisitionno
this.currentPRDetailData.itemno = row.itemno
@ -1123,6 +1164,7 @@
this.currentPRDetailData.price = row.price
this.currentPRDetailData.status = ''
this.currentPRDetailData.taxCode = row.taxCode
this.currentPRDetailData.partDesc = row.partdesc
}
if(val != 'Y'){
this.currentPRDetailData.orderref1 = null

971
src/views/modules/warehouse/location.vue

@ -0,0 +1,971 @@
<template>
<div class="mod-config">
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg>
</span>
</div>
<el-form :inline="true" :model="querySysLanguagePack" @keyup.enter.native="getDataList()">
<el-form-item :label="inputLabel.headerInput.label1">
<el-input style="width: 100px;" v-model="queryHeaderData.locationId" ></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label2">
<el-input style="width: 100px;" v-model="queryHeaderData.locationName" ></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label3">
<el-select v-model="queryHeaderData.warehouseId" placeholder="请选择" style="width: 115px;">
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in selectList.select2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label4">
<el-select v-model="queryHeaderData.active" placeholder="请选择" style="width: 115px;">
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in selectList.select1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()" type="primary">{{buttons.search}}</el-button>
</el-form-item>
<el-form-item>
<el-button @click="initModel()" type="primary">{{buttons.add}}</el-button>
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:defaultValue="exportDefaultValue"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{buttons.download}}
</download-excel>
<el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
</el-button>
</el-form-item>
</el-form>
<el-table
id="commmon"
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="90"
:label="buttons.cz">
<template slot-scope="scope">
<a @click="initModel(scope.row)">{{buttons.edit}}</a>
<a @click="delHeaderData(scope.row)">{{buttons.delete}}</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="inputLabel.headerInput.label5" :visible.sync="setUp.reviewFlag" width="325px">
<el-form :inline="true" label-position="top">
<el-form-item :label="inputLabel.headerInput.label1">
<el-input style="width: 130px;" :readonly = "setUp.readonlyFlag" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.locationId"></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label2">
<el-input style="width: 130px;" v-model="saveHeaderData.locationName"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item :label="inputLabel.headerInput.label3">
<el-select v-model="saveHeaderData.warehouseId" placeholder="请选择" style="width: 130px;">
<el-option
v-for="item in selectList.select2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label4">
<el-select v-model="saveHeaderData.active" placeholder="请选择" style="width: 130px;">
<el-option
v-for="item in selectList.select1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="setUp.reviewFlag = false">取消</el-button>
<el-button type="primary" :disabled="setUp.saveButton" @click="saveHeaderFunction()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import column from "../common/column";
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne
} from "@/api/sysLanguage.js"
import getLodop from '@/utils/LodopFuncs.js'
import {
saveTableDefaultList,
saveTableUser,
getTableDefaultListLanguage,
getTableUserListLanguage
} from "@/api/table.js"
import {
userFavoriteList,
saveUserFavorite,
removeUserFavorite,
} from '@/api/userFavorite.js'
import {
getWarehouseList,
getLocationList,
saveLocation,
delLocation,
} from '@/api/warehouse/location.js'
export default {
components: {
column
},
data() {
return {
saveHeaderData :{
locationId : '',
locationName : '',
warehouseId : '',
active : '',
},
queryHeaderData : {
site : this.$store.state.user.site,
locationId : '',
locationName : '',
warehouseId : '',
active : '',
},
setUp: {
reviewFlag: false,
saveButton: false,
reviewFlag1 : false,
readonlyFlag : false,
},
inputLabel :{
headerInput : {
label1 : '库位编码',
label2 : '库位名称',
label3 : '仓库名称',
label4 : '状态',
label5 : '库位信息',
},
},
selectList: {
select1: [{
value: 'Y',
label: '启用'
}, {
value: 'N',
label: '禁用'
}],
select2: [],
},
site : this.$store.state.user.site,
userName : this.$store.state.user.name,
// table
height:450,
//
favorite: false,
addLanguage: false,
functionId: 2601,
tableId: "location2601",
value1: true,
visible: false,
showDefault: false,
// table
queryTable: {
functionId: 2601,
tableId: "location2601",
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: 2601,
tableId: "location2601",
status: true,
languageCode: this.$i18n.locale
},
//
querySysLanguageParam: {
languageCode: this.$i18n.locale
},
//
sysLanguageParams: [],
// table
userColumnList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 2601,
serialNumber: 'location2601LocationId',
tableId: "location2601",
tableName: "locationTable",
columnProp: "locationId",
headerAlign: "center",
align: "center",
columnLabel: "库位编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2601,
serialNumber: 'location2601LocationName',
tableId: "location2601",
tableName: "locationTable",
columnProp: "locationName",
headerAlign: "center",
align: "center",
columnLabel: "库位名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2601,
serialNumber: 'location2601WarehouseId',
tableId: "location2601",
tableName: "locationTable",
columnProp: "warehouseId",
headerAlign: "center",
align: "center",
columnLabel: "仓库编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2601,
serialNumber: 'location2601WarehouseName',
tableId: "location2601",
tableName: "locationTable",
columnProp: "warehouseName",
headerAlign: "center",
align: "center",
columnLabel: "仓库名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2601,
serialNumber: 'location2601StrActive',
tableId: "location2601",
tableName: "locationTable",
columnProp: "strActive",
headerAlign: "center",
align: "center",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
],
//
columnList1: [
// {
// userId: this.$store.state.user.name,
// functionId: 2601,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "functionId",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2601,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "objectId",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2601,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "objectType",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2601,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "languageValue",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2601,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "languageCode",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// }
],
//
dataList: [],
queryButton: {
functionId: 2601,
table_id: 'location2601',
languageCode: this.$i18n.locale,
objectType: 'button'
},
buttons: {
add: '新增',
edit: '编辑',
delete: '删除',
deleteList: '批量删除',
cz: '操作',
search: '查询',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置'
},
// start
exportData: [],
exportName: "页面功能语言",
exportHeader: ["页面功能语言"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
buttonList: [
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'add',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'edit',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'delete',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'deleteList',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'cz',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'search',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'download',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'settingTable',
// objectType: "button",
// tableId: "location2601"
// },
// {
// functionId: "2601",
// languageValue: '',
// objectId: 'defaultTable',
// objectType: "button",
// tableId: "location2601"
// }
],
languageList: [],
languageColumnList: [],
languageDataList: [],
queryLanguage: {},
//
querySysLanguagePack: {
functionId: '',
page: 1,
limit: 1,
languageValue: '',
objectType: '',
objectId: ''
},
//
pageIndex: 1,
pageSize: 100,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 215;
})
},
activated() {
this.getDataList()
this.getSelectList()
this.getLanguageList()
},
methods: {
getSelectList(){
let jsonData = {
site : this.site,
active : 'Y'
}
this.selectList.select2 = []
getWarehouseList(jsonData).then(({data}) =>{
let list = data.rows
if(list.length > 0){
for (let i = 0; i < list.length; i++) {
let selectData = {
value: list[i].wareHouseId,
label: list[i].wareHouseName,
}
this.selectList.select2.push(selectData);
}
}
})
},
delHeaderData(row){
this.$confirm(`确定删除该记录?`, '操作提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let jsonData ={
site : row.site,
locationId : row.locationId,
}
delLocation(jsonData).then(({data}) =>{
if(data.code == 0){
this.$message.success(data.msg)
this.getDataList()
}else {
this.$alert(data.msg, '操作提示', {
confirmButtonText: '确定',
callback: action => {
}
});
}
})
})
},
saveHeaderFunction(){
this.setUp.saveButton = true
if(this.saveHeaderData.locationId == ''){
this.$alert("请输入库位编码!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}else if(this.saveHeaderData.locationName == ''){
this.$alert("请输入库位名称!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}else if(this.saveHeaderData.warehouseId == ''){
this.$alert("请选择库房代码!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}
saveLocation(this.saveHeaderData).then(({data}) =>{
this.setUp.saveButton = false
if(data.code == 0){
this.$message.success(data.msg)
this.getDataList()
this.setUp.reviewFlag = false
}else {
this.$alert(data.msg, '操作提示', {
confirmButtonText: '确定',
callback: action => {
}
});
}
})
},
initModel(row){
this.setUp.reviewFlag = true
this.setUp.saveButton = false
this.setUp.readonlyFlag = false
this.saveHeaderData.id = 0
this.saveHeaderData.site = this.site
this.saveHeaderData.locationId = ''
this.saveHeaderData.locationName = ''
this.saveHeaderData.warehouseId = ''
this.saveHeaderData.active = 'Y'
if(row != null){
this.setUp.readonlyFlag = true
this.saveHeaderData.id = 1
this.saveHeaderData.locationId = row.locationId
this.saveHeaderData.locationName = row.locationName
this.saveHeaderData.warehouseId = row.warehouseId
this.saveHeaderData.active = row.active
}
},
//
printReport(){
alert( this.$store.state.user.site)
//
// const LODOP = getLodop()
// if (LODOP) {
// var strBodyStyle = '<style>'
// strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
// strBodyStyle += 'caption { line-height:2em; }'
// strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
// strBodyStyle += '</style>' //
// var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //
//
// LODOP.PRINT_INIT('') //
// LODOP.PRINT_DESIGN();
// //LODOP.PREVIEW();
// //LODOP.PRINT();
//
// LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //
// LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //
// LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //
// LODOP.PREVIEW()
// }
},
//
favoriteIsOk(){
let userFavorite ={
userId:this.$store.state.user.id,
languageCode:this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) =>{
let size = data.list.filter(item => item.userId==userFavorite.menuId).length;
if (size>0){
this.favorite = true
}else {
this.favorite = false
}
})
},
// OR
favoriteFunction(){
let userFavorite ={
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite){
//
this.$confirm(`确定取消收藏`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = false
})
})
}else {
//
saveUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = true
})
}
},
//
saveLanguageList(val) {
saveSysLanguageOne(val).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
} else {
this.$message.error(data.msg)
}
})
},
//
addLanguageFun() {
if (this.querySysLanguagePack.languageCode) {
this.addLanguage = true
this.languageColumnList = []
let query = {
functionId: 2601,
tableId: "common1002",
languageCode: this.$i18n.locale
}
getTableDefaultListLanguage(query).then(({data}) => {
if (data.rows.length > 0) {
this.languageColumnList = data.rows
}
})
this.languageColumnList = this.columnList
searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
this.languageDataList = data.rows
})
} else {
this.$message("请选中一种语言")
}
},
//
getLanguageList() {
searchSysLanguage(this.queryLanguage).then(({data}) => {
this.languageList = data.rows
})
},
// button
getFunctionButtonList() {
searchFunctionButtonList(this.queryButton).then(({data}) => {
if (JSON.stringify(data.data) != '{}' ) {
this.buttons = data.data
} else {
// saveButtonList(this.buttonList).then(({data}) => {
// })
}
})
},
//
getSysLanguageParamList() {
searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
this.sysLanguageParams = data.rows
})
},
//
userSetting() {
this.visible = true;
let queryTable = {
userId: this.$store.state.user.name,
functionId: 2601,
tableId: "location2601",
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable);
});
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
//
saveColumnList() {
saveTableDefaultList(this.columnList).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.$message.error(data.msg)
}
})
saveTableDefaultList(this.columnList1).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.$message.error(data.msg)
}
})
saveButtonList(this.buttonList).then(({data}) => {
})
this.getFunctionButtonList()
this.getFunctionButtonList();
this.getColumnList()
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (!data.rows.length == 0) {
this.showDefault = false
this.columnList = data.rows
} else {
this.showDefault = true
}
})
},
//
getDataList() {
this.dataListLoading = true
this.queryHeaderData.limit = this.pageSize
this.queryHeaderData.page = this.pageIndex
this.dataList = []
this.totalPage = 0
getLocationList(this.queryHeaderData).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.rows.list
this.totalPage = data.rows.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle(val) {
this.dataListSelections = val
},
//
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('//prd/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
//
fields(){
let json = "{"
this.columnList.forEach((item,index) =>{
if (index == this.columnList.length-1 ){
json +="\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""
}else {
json += "\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""+ ","
}
})
json +="}"
let s = eval("(" + json + ")")
return s
},
createExportData() {
// ,,
// TODO:
if(this.dataListSelections.length>0){
return this.dataListSelections;
}
return this.dataList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
}
},
created() {
this.getTableUserColumn()
this.getSysLanguageParamList()
this.getFunctionButtonList()
this.favoriteIsOk()
}
}
</script>
<style scoped >
.wrapper {
height: calc(100% - 40px);
}
.sl-input {
background-color: transparent;
border: 0 !important;
font-size: 12px !important;
height: 12px !important;
line-height: 14px !important;
background-color: transparent !important;
width: 140px;
}
.sl-input:focus, textarea:focus {
outline: none;
}
.sl-svg{
overflow: hidden;
float: right;
}
</style>

994
src/views/modules/warehouse/warehouse.vue

@ -0,0 +1,994 @@
<template>
<div class="mod-config">
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg>
</span>
</div>
<el-form :inline="true" :model="querySysLanguagePack" @keyup.enter.native="getDataList()">
<el-form-item :label="inputLabel.headerInput.label1">
<el-input style="width: 100px;" v-model="queryHeaderData.wareHouseId" ></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label2">
<el-input style="width: 100px;" v-model="queryHeaderData.wareHouseName" ></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label4">
<el-select v-model="queryHeaderData.active" placeholder="请选择" style="width: 100px;">
<el-option label="全部" value=""></el-option>
<el-option
v-for="item in selectList.select1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList('Y')" type="primary">{{buttons.search}}</el-button>
</el-form-item>
<el-form-item>
<el-button @click="initModel()" type="primary">{{buttons.add}}</el-button>
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:defaultValue="exportDefaultValue"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{buttons.download}}
</download-excel>
<el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
</el-button>
</el-form-item>
</el-form>
<el-table
id="commmon"
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="90"
:label="buttons.cz">
<template slot-scope="scope">
<a @click="initModel(scope.row)">{{buttons.edit}}</a>
<a @click="delHeaderData(scope.row)">{{buttons.delete}}</a>
</template>
</el-table-column>
</el-table>
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="inputLabel.headerInput.label5" :visible.sync="setUp.reviewFlag" width="325px">
<el-form :inline="true" label-position="top">
<el-form-item :label="inputLabel.headerInput.label1">
<el-input style="width: 130px;" :readonly = "setUp.readonlyFlag" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.wareHouseId"></el-input>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label2">
<el-input style="width: 130px;" v-model="saveHeaderData.wareHouseName"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top">
<el-form-item :label="inputLabel.headerInput.label3">
<el-select v-model="saveHeaderData.wareHouseTypeDb" placeholder="请选择" style="width: 130px;">
<el-option
v-for="item in selectList.select2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="inputLabel.headerInput.label4">
<el-select v-model="saveHeaderData.active" placeholder="请选择" style="width: 130px;">
<el-option
v-for="item in selectList.select1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="setUp.reviewFlag = false">取消</el-button>
<el-button type="primary" :disabled="setUp.saveButton" @click="saveHeaderFunction()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import column from "../common/column";
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne
} from "@/api/sysLanguage.js"
import getLodop from '@/utils/LodopFuncs.js'
import {
saveTableDefaultList,
saveTableUser,
getTableDefaultListLanguage,
getTableUserListLanguage
} from "@/api/table.js"
import {
userFavoriteList,
saveUserFavorite,
removeUserFavorite,
} from '@/api/userFavorite.js'
import {
getWarehouseList,
saveWarehouse,
delWarehouse,
getWareHouseTypeList,
} from '@/api/warehouse/warehouse.js'
export default {
components: {
column
},
data() {
return {
saveHeaderData :{
id : 0,
wareHouseId : '',
wareHouseName : '',
wareHouseType : '',
active : '',
wareHouseTypeDb : '',
},
queryHeaderData : {
site : this.$store.state.user.site,
wareHouseId : '',
wareHouseName : '',
wareHouseType : '',
active : '',
},
setUp: {
reviewFlag: false,
saveButton: false,
reviewFlag1 : false,
readonlyFlag : false,
},
inputLabel :{
headerInput : {
label1 : '仓库编码',
label2 : '仓库名称',
label3 : '库位类型',
label4 : '使用状态',
label5 : '库房信息',
},
},
selectList: {
select1: [{
value: 'Y',
label: '启用'
}, {
value: 'N',
label: '禁用'
}],
select2: [],
},
site : this.$store.state.user.site,
userName : this.$store.state.user.name,
// table
height:450,
//
favorite: false,
addLanguage: false,
functionId: 2501,
tableId: "wareHouse2501",
value1: true,
visible: false,
showDefault: false,
// table
queryTable: {
functionId: 2501,
tableId: "wareHouse2501",
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: 2501,
tableId: "wareHouse2501",
status: true,
languageCode: this.$i18n.locale
},
//
querySysLanguageParam: {
languageCode: this.$i18n.locale
},
//
sysLanguageParams: [],
// table
userColumnList: [],
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501WareHouseId',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "wareHouseId",
headerAlign: "center",
align: "center",
columnLabel: "仓库编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth : 100,
},
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501WareHouseName',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "wareHouseName",
headerAlign: "center",
align: "center",
columnLabel: "仓库名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501WareHouseType',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "wareHouseTypeDb",
headerAlign: "center",
align: "center",
columnLabel: "库房编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501WareHouseTypeDb',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "wareHouseType",
headerAlign: "center",
align: "center",
columnLabel: "库房类型",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
/* {
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501Keeper',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "keeper",
headerAlign: "center",
align: "center",
columnLabel: "管理人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501CompanyId',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "companyId",
headerAlign: "center",
align: "center",
columnLabel: "公司编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},*/
{
userId: this.$store.state.user.name,
functionId: 2501,
serialNumber: 'wareHouse2501StrActive',
tableId: "wareHouse2501",
tableName: "wareHouseTable",
columnProp: "strActive",
headerAlign: "center",
align: "center",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
},
],
//
columnList1: [
// {
// userId: this.$store.state.user.name,
// functionId: 2501,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "functionId",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2501,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "objectId",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2501,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "objectType",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2501,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "languageValue",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 2501,
// tableId: "common1002",
// tableName: "commonLanguage",
// columnProp: "languageCode",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false,
// }
],
//
dataList: [],
queryButton: {
functionId: 2501,
table_id: 'wareHouse2501',
languageCode: this.$i18n.locale,
objectType: 'button'
},
buttons: {
add: '新增',
edit: '编辑',
delete: '删除',
deleteList: '批量删除',
cz: '操作',
search: '查询',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置'
},
// start
exportData: [],
exportName: "页面功能语言",
exportHeader: ["页面功能语言"],
exportFooter: [],
exportDefaultValue: "这一行这一列没有数据",
// end
buttonList: [
{
functionId: "2501",
languageValue: '添加',
objectId: 'add',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '编辑',
objectId: 'edit',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '删除',
objectId: 'delete',
objectType: "button",
tableId: "wareHouse2501"
},
// {
// functionId: "2501",
// languageValue: '',
// objectId: 'deleteList',
// objectType: "button",
// tableId: "wareHouse2501"
// },
{
functionId: "2501",
languageValue: '操作',
objectId: 'cz',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '查询',
objectId: 'search',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '导出',
objectId: 'download',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '设置列表',
objectId: 'settingTable',
objectType: "button",
tableId: "wareHouse2501"
},
{
functionId: "2501",
languageValue: '设置默认配置',
objectId: 'defaultTable',
objectType: "button",
tableId: "wareHouse2501"
}
],
languageList: [],
languageColumnList: [],
languageDataList: [],
queryLanguage: {},
//
querySysLanguagePack: {
functionId: '',
page: 1,
limit: 1,
languageValue: '',
objectType: '',
objectId: ''
},
//
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 170;
})
},
activated() {
this.getTblBaseList()
this.getDataList()
this.getLanguageList()
},
methods: {
getTblBaseList(){
let jsonDate = {
site : this.site,
type : 'WareHouseType'
}
this.selectList.select2 = []
getWareHouseTypeList(jsonDate).then(({data}) =>{
let list = data.list
this.selectList.select2 = list.map(item =>{
let resultData = {
value: item.baseData,
label : item.baseDesc,
}
return resultData
})
})
},
delHeaderData(row){
this.$confirm(`确定删除该仓库及库位?`, '操作提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let jsonData ={
site : row.site,
wareHouseId : row.wareHouseId,
}
delWarehouse(jsonData).then(({data}) =>{
if(data.code == 0){
this.$message.success(data.msg)
this.getDataList()
}else {
this.$alert(data.msg, '操作提示', {
confirmButtonText: '确定',
callback: action => {
}
});
}
})
})
},
saveHeaderFunction(){
this.setUp.saveButton = true
if(this.saveHeaderData.wareHouseId == ''){
this.$alert("请输入库房编码!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}else if(this.saveHeaderData.wareHouseName == ''){
this.$alert("请输入库房名称!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}else if(this.saveHeaderData.wareHouseTypeDb == ''){
this.$alert("请选择库位类型!", '操作提示', {
confirmButtonText: '确定',
callback: action => {
this.setUp.saveButton = false
}
});
return
}
for (let i = 0; i < this.selectList.select2.length; i++) {
if(this.selectList.select2[i].value == this.saveHeaderData.wareHouseTypeDb){
this.saveHeaderData.wareHouseType = this.selectList.select2[i].label
}
}
saveWarehouse(this.saveHeaderData).then(({data}) =>{
this.setUp.saveButton = false
if(data.code == 0){
this.$message.success(data.msg)
this.getDataList()
this.setUp.reviewFlag = false
}else {
this.$alert(data.msg, '操作提示', {
confirmButtonText: '确定',
callback: action => {
}
});
}
})
},
initModel(row){
this.setUp.reviewFlag = true
this.setUp.saveButton = false
this.setUp.readonlyFlag = false
this.saveHeaderData.id = 0
this.saveHeaderData.site = this.site
this.saveHeaderData.wareHouseId = ''
this.saveHeaderData.wareHouseName = ''
this.saveHeaderData.wareHouseType = ''
this.saveHeaderData.wareHouseTypeDb = ''
this.saveHeaderData.active = 'Y'
this.saveHeaderData.useLocation = 'Y'
this.saveHeaderData.validStock = 'Y'
this.saveHeaderData.keeper = ''
this.saveHeaderData.companyId = ''
if(row != null){
this.setUp.readonlyFlag = true
this.saveHeaderData.id = 1
this.saveHeaderData.wareHouseId = row.wareHouseId
this.saveHeaderData.wareHouseName = row.wareHouseName
this.saveHeaderData.wareHouseType = row.wareHouseType
this.saveHeaderData.wareHouseTypeDb = row.wareHouseTypeDb
this.saveHeaderData.active = row.active
}
},
//
printReport(){
alert( this.$store.state.user.site)
//
// const LODOP = getLodop()
// if (LODOP) {
// var strBodyStyle = '<style>'
// strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
// strBodyStyle += 'caption { line-height:2em; }'
// strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
// strBodyStyle += '</style>' //
// var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //
//
// LODOP.PRINT_INIT('') //
// LODOP.PRINT_DESIGN();
// //LODOP.PREVIEW();
// //LODOP.PRINT();
//
// LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //
// LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //
// LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //
// LODOP.PREVIEW()
// }
},
//
favoriteIsOk(){
let userFavorite ={
userId:this.$store.state.user.id,
languageCode:this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) =>{
let size = data.list.filter(item => item.userId==userFavorite.menuId).length;
if (size>0){
this.favorite = true
}else {
this.favorite = false
}
})
},
// OR
favoriteFunction(){
let userFavorite ={
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite){
//
this.$confirm(`确定取消收藏`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = false
})
})
}else {
//
saveUserFavorite(userFavorite).then(({data})=>{
this.$message.success(data.msg)
this.favorite = true
})
}
},
//
saveLanguageList(val) {
saveSysLanguageOne(val).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
} else {
this.$message.error(data.msg)
}
})
},
//
addLanguageFun() {
if (this.querySysLanguagePack.languageCode) {
this.addLanguage = true
this.languageColumnList = []
let query = {
functionId: 2501,
tableId: "common1002",
languageCode: this.$i18n.locale
}
getTableDefaultListLanguage(query).then(({data}) => {
if (data.rows.length > 0) {
this.languageColumnList = data.rows
}
})
this.languageColumnList = this.columnList
searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
this.languageDataList = data.rows
})
} else {
this.$message("请选中一种语言")
}
},
//
getLanguageList() {
searchSysLanguage(this.queryLanguage).then(({data}) => {
this.languageList = data.rows
})
},
// button
getFunctionButtonList() {
searchFunctionButtonList(this.queryButton).then(({data}) => {
if (JSON.stringify(data.data) != '{}' ) {
this.buttons = data.data
} else {
// saveButtonList(this.buttonList).then(({data}) => {
// })
}
})
},
//
getSysLanguageParamList() {
searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
this.sysLanguageParams = data.rows
})
},
//
userSetting() {
this.visible = true;
let queryTable = {
userId: this.$store.state.user.name,
functionId: 2501,
tableId: "wareHouse2501",
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable);
});
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
//
saveColumnList() {
saveTableDefaultList(this.columnList).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.$message.error(data.msg)
}
})
saveTableDefaultList(this.columnList1).then(({data}) => {
if (data.code == 0) {
this.$message.success(data.msg)
this.showDefault = false
} else {
this.$message.error(data.msg)
}
})
saveButtonList(this.buttonList).then(({data}) => {
})
this.getFunctionButtonList()
this.getFunctionButtonList();
this.getColumnList()
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (!data.rows.length == 0) {
this.showDefault = false
this.columnList = data.rows
} else {
this.showDefault = true
}
})
},
//
getDataList() {
this.dataListLoading = true
getWarehouseList(this.queryHeaderData).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.rows
// this.totalPage = data.page.totalCount
} else {
this.dataList = []
// this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle(val) {
this.dataListSelections = val
},
//
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('//prd/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
//
fields(){
let json = "{"
this.columnList.forEach((item,index) =>{
if (index == this.columnList.length-1 ){
json +="\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""
}else {
json += "\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""+ ","
}
})
json +="}"
let s = eval("(" + json + ")")
return s
},
createExportData() {
// ,,
// TODO:
if(this.dataListSelections.length>0){
return this.dataListSelections;
}
return this.dataList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
}
},
created() {
this.getTableUserColumn()
this.getSysLanguageParamList()
this.getFunctionButtonList()
this.favoriteIsOk()
}
}
</script>
<style scoped >
.wrapper {
height: calc(100% - 40px);
}
.sl-input {
background-color: transparent;
border: 0 !important;
font-size: 12px !important;
height: 12px !important;
line-height: 14px !important;
background-color: transparent !important;
width: 140px;
}
.sl-input:focus, textarea:focus {
outline: none;
}
.sl-svg{
overflow: hidden;
float: right;
}
</style>
Loading…
Cancel
Save