
68 changed files with 3906 additions and 225 deletions
@ -0,0 +1,115 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export default { |
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 查询维修项目列表 -- 查询相关维修单信息环节为已结算
|
|||
getServiceItemListPageNew: function(params) { |
|||
return request({ |
|||
url: '/as/v1/AsServiceItem/getServiceItemListPageNew', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 初始化
|
|||
fetchDetailsBySid: function(data) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/fetchDetailsBySid/' + data, |
|||
method: 'get' |
|||
}) |
|||
}, |
|||
saveOrUpdate: function(data) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/save', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
deleteBySids: function(data) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/delBySids', |
|||
method: 'DELETE', |
|||
data: data, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 提交流程
|
|||
submit: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/submitApply', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 流程审批(同意)
|
|||
complete: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/complete', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 流程审批(加签)
|
|||
delegate: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/delegate', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 流程审批(驳回)
|
|||
reject: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/reject', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 流程审批(终止)
|
|||
breakProcess: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/breakProcess', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 流程审批(撤回)
|
|||
revokeProcess: function(params) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/revokeProcess', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { 'Content-Type': 'application/json' } |
|||
}) |
|||
}, |
|||
// 审批流程(同意)获取下一环节
|
|||
getNextNodesForSubmit: function(data) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/getNextNodesForSubmit', |
|||
method: 'get', |
|||
params: data |
|||
}) |
|||
}, |
|||
// 审批流程(驳回)获取上一环节
|
|||
getPreviousNodesForReject: function(data) { |
|||
return request({ |
|||
url: '/as/v1/ashosesuppapply/getPreviousNodesForReject', |
|||
method: 'get', |
|||
params: data |
|||
}) |
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
import request from '@/utils/request' |
|||
// 仓库区域 接口
|
|||
export default { |
|||
|
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 区域查询
|
|||
getAllWarehousezone: function(params) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/listAll', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
// 根据仓库sid查询区域
|
|||
getAllWarehousezoneBysid: function(params) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/selectAll', |
|||
method: 'get', |
|||
params: params, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
// 修改是否可用状态
|
|||
updateIsEnable: function(sid, isEnable) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/updateIsEnable/' + sid + "/" + isEnable |
|||
}); |
|||
}, |
|||
|
|||
|
|||
// 新增、保存
|
|||
saveWarehousezone: function(data) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/saveOrUpdate', |
|||
method: 'post', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
// 初始化
|
|||
initWarehousezone: function(data) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/initialization/' + data, |
|||
method: 'get' |
|||
}); |
|||
}, |
|||
|
|||
|
|||
// 区域-- 删除
|
|||
deleteBySids: function(data) { |
|||
return request({ |
|||
url: '/wms/apiadmin/base/wmswarehousezone/delBySids', |
|||
method: 'DELETE', |
|||
data: data, |
|||
headers: { |
|||
'Content-Type': 'application/json' |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
} |
@ -0,0 +1,349 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!--列表页面--> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar view-title="工时提成抵顶配件费用申请管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<!--Start查询列表部分--> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> |
|||
<el-form-item label="分公司"> |
|||
<el-input v-model="listQuery.params.useOrgName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请部门"> |
|||
<el-input v-model="listQuery.params.deptName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请人"> |
|||
<el-input v-model="listQuery.params.createByName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="单据编号"> |
|||
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="申请日期"> |
|||
<el-date-picker v-model="listQuery.params.createTimeStart" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.createTimeEnd" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="办结日期"> |
|||
<el-date-picker v-model="listQuery.params.finishDateStart" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="listQuery.params.finishDateEnd" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="二级站"> |
|||
<el-input v-model="listQuery.params.secondStatName" placeholder="" clearable/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--End查询列表部分--> |
|||
<div class="listtop"> |
|||
<div class="tit">工时提成抵顶配件费用申请列表</div> |
|||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
<!--Start 主页面主要部分 --> |
|||
<div class=""> |
|||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" align="center" width="50" /> |
|||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" /> |
|||
<el-table-column label="操作" width="180" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="toEdit(scope.row)" :disabled="scope.row.nodeState =='发起申请' ? false : scope.row.nodeState == '待提交' ? false : true">办理</el-button> |
|||
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="流程状态" width="180" header-align="center"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="scope.row.nodeState=='待提交'" type="primary" size="mini">待提交</span> |
|||
<span v-else @click="flowRecord(scope.row)" class="bluezi">{{ scope.row.nodeState }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="billNo" label="单据编号" align="center" width="220" /> |
|||
<el-table-column prop="useOrgName" label="分公司" align="center" min-width="120" /> |
|||
<el-table-column prop="deptName" label="申请部门" align="center" min-width="120" /> |
|||
<el-table-column prop="createByName" label="申请人" align="center" width="120" /> |
|||
<el-table-column prop="createTime" label="申请日期" align="center" width="120" /> |
|||
<el-table-column prop="finishTime" label="办结日期" align="center" width="120" /> |
|||
<el-table-column prop="secondStatName" label="二级站" align="center" width="120" /> |
|||
<el-table-column prop="costTotal" label="商品总额" align="center" width="120" /> |
|||
<el-table-column prop="suppAmoutTotal" label="工时提成抵顶金额" align="center" width="180" /> |
|||
</el-table> |
|||
</div> |
|||
<!--End 主页面主要部分--> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> |
|||
</div> |
|||
<!--End查询列表部分--> |
|||
</div> |
|||
</div> |
|||
<!--新增及修改 --> |
|||
<topFittingAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList" /> |
|||
<!-- 详情 --> |
|||
<topFittingInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" /> |
|||
<!-- 流程审批记录 --> |
|||
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center> |
|||
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import req from '@/api/operation/topFitting' |
|||
import { getStorage } from '@/utils/auth' |
|||
import topFittingAdd from './topFittingAdd' |
|||
import topFittingInfo from './topFittingInfo' |
|||
|
|||
export default { |
|||
name: 'TopFitting', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
topFittingAdd, |
|||
topFittingInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
url: '', |
|||
dialogHeight: '80%', |
|||
centerDialogVisible: false, |
|||
btndisabled: false, |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'danger', |
|||
size: 'small', |
|||
icon: 'del', |
|||
btnKey: 'doDel', |
|||
btnLabel: '删除' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看 |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], // 用于导出的时候保存已选择的SIDs |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
// 翻页 |
|||
listQuery: { |
|||
current: 1, |
|||
size: 5, |
|||
total: 0, |
|||
params: { |
|||
useOrgName: '', |
|||
deptName: '', |
|||
createByName: '', |
|||
billNo: '', |
|||
createTimeStart: '', |
|||
createTimeEnd: '', |
|||
finishTimeStart: '', |
|||
finishTimeEnd: '', |
|||
orgPath: '', |
|||
userSid: '', |
|||
menuUrl: '', |
|||
secondStatName: '' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
// 初始化变量 |
|||
this.getList() |
|||
}, |
|||
mounted() { |
|||
// 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage |
|||
window.addEventListener('message', this.handleMessage) |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
async handleMessage(event) { |
|||
var code = '' |
|||
if (event.data.params !== null && event.data.params !== undefined) { |
|||
code = event.data.params.code |
|||
} |
|||
if (code === 1) { |
|||
this.centerDialogVisible = false |
|||
} else if (code === 2) { |
|||
this.dialogHeight = event.data.params.data |
|||
this.setIframeHeight(document.getElementById('iframe')) |
|||
} |
|||
}, |
|||
closeIt() { |
|||
this.url = '' |
|||
this.centerDialogVisible = false |
|||
}, |
|||
setIframeHeight(iframe) { |
|||
iframe.height = this.dialogHeight |
|||
}, |
|||
flowRecord(row) { |
|||
this.centerDialogVisible = true |
|||
var params = { |
|||
deployId: row.procDefId, |
|||
procInsId: row.procInstId, |
|||
token: getStorage() |
|||
} |
|||
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params))) |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'doDel': |
|||
this.doDel() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
// 信息条数 获取点击时当前的sid |
|||
handleSelectionChange(row) { |
|||
const aa = [] |
|||
row.forEach(element => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
}, |
|||
// 表中序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid') |
|||
this.listQuery.params.menuUrl = this.$route.path |
|||
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|||
req.listPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 点击重置 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 5, |
|||
total: 0, |
|||
params: { |
|||
useOrgName: '', |
|||
deptName: '', |
|||
createByName: '', |
|||
billNo: '', |
|||
createTimeStart: '', |
|||
createTimeEnd: '', |
|||
finishTimeStart: '', |
|||
finishTimeEnd: '', |
|||
orgPath: '', |
|||
userSid: '', |
|||
menuUrl: '', |
|||
secondStatName: '' |
|||
} |
|||
} |
|||
this.getList() |
|||
}, |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divAdd'].showAdd() |
|||
}, |
|||
toEdit(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divAdd'].showEdit(row) |
|||
}, |
|||
toInfo(row) { |
|||
this.viewState = 4 |
|||
this.$refs['divInfo'].showInfo(row) |
|||
}, |
|||
doDel() { |
|||
if (this.sids.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) |
|||
return |
|||
} |
|||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const loading = this.$loading({ |
|||
lock: true, |
|||
text: 'Loading', |
|||
spinner: 'el-icon-loading', |
|||
background: 'rgba(0, 0, 0, 0.7)' |
|||
}) |
|||
req.deleteBySids(this.sids).then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|||
} |
|||
this.getList() |
|||
loading.close() |
|||
}).catch(e => { |
|||
loading.close() |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
// 修改、编辑、详情返回列表页面 |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,507 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">二级站</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.secondStatSid" @change="changeSecondStat" clearable filterable placeholder=""> |
|||
<el-option v-for="item in secondStat_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表</div> |
|||
<el-table :key="commodityKey" :data="formobj.asHoseSuppGoodsDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column align="center" width="80"> |
|||
<template slot="header" slot-scope="scope"> |
|||
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="commodityAdd(scope.row)"></i> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="商品名称" align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-popover placement="right" trigger="click" width="500"> |
|||
<div> |
|||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row @current-change="commodityCurrentChange($event, scope.row)"> |
|||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center"/> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center"/> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center"/> |
|||
<el-table-column prop="unit" label="单位" align="center"/> |
|||
</el-table> |
|||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size" layout="total, pager" :total="commodityQuery.total"/> |
|||
</div> |
|||
<el-input slot="reference" v-model="scope.row.goodsSpuName" @input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称"/> |
|||
</el-popover> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="goodsID" label="商品ID" width="200" align="center" /> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
|||
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
|||
<el-table-column prop="warehouseName" label="仓库" min-width="100" align="center" /> |
|||
<el-table-column prop="warehouseRackCode" label="库位" width="100" align="center" /> |
|||
<el-table-column prop="cost" label="入库单价" align="center" width="150" /> |
|||
<el-table-column prop="count" label="库存数量" width="100" align="center" /> |
|||
</el-table> |
|||
<div class="title">维修项目</div> |
|||
<el-table :key="serviceKey" :data="formobj.asHoseSuppSitemDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column align="center" width="80"> |
|||
<template slot="header" slot-scope="scope"> |
|||
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="serviceAdd(scope.row)"></i> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<i class="el-icon-delete" @click="serviceDelete(scope.$index)"></i> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="维修项目" align="center" width="300"> |
|||
<template slot-scope="scope"> |
|||
<el-popover placement="right" width="600" trigger="click"> |
|||
<div> |
|||
<el-table :data="serviceData" v-loading="serviceLoading" highlight-current-row @current-change="serviceCurrentChange($event, scope.row)"> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" /> |
|||
</el-table> |
|||
<el-pagination :page.sync="serviceQuery.current" :page-size="serviceQuery.size" layout="total, pager" :total="serviceQuery.total" /> |
|||
</div> |
|||
<el-input slot="reference" v-model="scope.row.sitem" @input="serviceInput(scope.row.sitem)" clearable placeholder="项目名称、维修单号"/> |
|||
</el-popover> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" width="180" /> |
|||
<el-table-column prop="billType" label="维修单类型" align="center" width="140" /> |
|||
<el-table-column prop="subject" label="科目" align="center" width="100" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" width="140" /> |
|||
<el-table-column prop="serviceType" label="工种" align="center" width="100" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" width="150" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" width="150" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" width="150" /> |
|||
<el-table-column label="抵顶金额" align="center" min-width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.suppAmout" @keyup.native="scope.row.suppAmout = getNumber(scope.row.suppAmout, 2)" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">商品总额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ spTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">工时提成抵顶金额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ ddjeTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { selInvenGoodsByUseOrgSid, tranFive } from '@/api/Common/dictcommons' |
|||
import req from '@/api/operation/topFitting' |
|||
|
|||
export default { |
|||
name: 'TopFittingAdd', |
|||
computed: { |
|||
spTotal() { |
|||
let sp = '0' |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length > 0) { |
|||
this.formobj.asHoseSuppGoodsDetailList.forEach((e) => { |
|||
sp = Math.round((parseFloat(sp) + (parseFloat(e.cost !== '' ? e.cost : 0) * parseFloat(e.count !== '' ? e.count : 0))) * 100) / 100 |
|||
}) |
|||
} |
|||
return sp |
|||
}, |
|||
ddjeTotal() { |
|||
let ddje = '0' |
|||
if (this.formobj.asHoseSuppSitemDetailList.length > 0) { |
|||
this.formobj.asHoseSuppSitemDetailList.forEach((e) => { |
|||
ddje = Math.round((parseFloat(ddje) + parseFloat(e.suppAmout !== '' ? e.suppAmout : 0)) * 100) / 100 |
|||
}) |
|||
} |
|||
return ddje |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
submitdisabled: false, |
|||
index: 0, |
|||
secondStat_list: [], |
|||
// commodity商品 |
|||
commodityKey: 1, |
|||
commodityLoading: false, |
|||
commodityQuery: { |
|||
current: 1, |
|||
size: 2, |
|||
total: 0, |
|||
params: { |
|||
goodsName: '', |
|||
useOrgSid: '' |
|||
} |
|||
}, |
|||
commodityData: [], |
|||
// service服务 |
|||
serviceKey: 2, |
|||
serviceLoading: false, |
|||
serviceQuery: { |
|||
current: 1, |
|||
size: 2, |
|||
total: 0, |
|||
params: { |
|||
name: '', |
|||
useOrgSid: '' |
|||
} |
|||
}, |
|||
serviceData: [], |
|||
formobj: { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
getNumber(val, limit) { |
|||
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
|||
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
|||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
|||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
|||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|||
const reg = new RegExp(str) |
|||
if (limit === 0) { |
|||
// 不需要小数点 |
|||
val = val.replace(reg, '$1') |
|||
} else { |
|||
// 通过正则保留小数点后指定的位数 |
|||
val = val.replace(reg, '$1.$2') |
|||
} |
|||
return val |
|||
}, |
|||
showAdd() { |
|||
this.viewTitle = '【新增】工时提成抵顶配件费用申请' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|||
this.formobj.createByName = window.sessionStorage.getItem('name') |
|||
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|||
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
|||
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) |
|||
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) |
|||
var nowDate = new Date() |
|||
var date = { |
|||
year: nowDate.getFullYear(), |
|||
month: nowDate.getMonth() + 1, |
|||
day: nowDate.getDate() |
|||
} |
|||
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day) |
|||
tranFive(this.formobj.deptSid).then((res) => { |
|||
if (res.success) { |
|||
this.secondStat_list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
showEdit(row) { |
|||
this.viewTitle = '【编辑】工时提成抵顶配件费用申请' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(row.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.instanceId = res.data.procInstId |
|||
tranFive(this.formobj.deptSid).then((res) => { |
|||
if (res.success) { |
|||
this.secondStat_list = res.data |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
changeSecondStat(value) { |
|||
const choose = this.secondStat_list.filter((item) => item.sid === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.secondStatName = choose[0].name |
|||
} else { |
|||
this.formobj.secondStatName = '' |
|||
} |
|||
}, |
|||
commodityAdd() { |
|||
this.formobj.asHoseSuppGoodsDetailList.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
goodsID: '', // 商品ID |
|||
goodsSpuSid: '', |
|||
goodsSpuName: '', // 商品名称 |
|||
goodsSkuSid: '', |
|||
goodsSkuTitle: '', // 商品名称 |
|||
goodsSkuCode: '', // 商品编码(图号) |
|||
goodsSkuOwnSpec: '', // 规格型号 |
|||
unit: '', // 计量单位 |
|||
warehouseName: '', // 仓库名称 |
|||
warehouseSid: '', |
|||
warehouseRackCode: '', // 库位编号 |
|||
warehouseRackSid: '', |
|||
cost: '', // 入库单价 |
|||
count: '' // 库存数量 |
|||
}) |
|||
}, |
|||
commodityInput(value) { |
|||
this.commodityQuery.params.useOrgSid = this.formobj.deptSid |
|||
this.commodityQuery.params.goodsName = value |
|||
this.commodityLoading = true |
|||
selInvenGoodsByUseOrgSid(this.commodityQuery).then((response) => { |
|||
if (response.success) { |
|||
this.commodityLoading = false |
|||
this.commodityData = response.data.records |
|||
this.commodityQuery.total = response.data.total |
|||
} else { |
|||
this.commodityLoading = false |
|||
this.commodityData = [] |
|||
this.commodityQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
commodityCurrentChange(value, row) { |
|||
row.goodsID = value.goodsID |
|||
row.goodsSpuSid = value.goodsSpuSid |
|||
row.goodsSpuName = value.goodsSpuName |
|||
row.goodsSkuSid = value.goodsSkuSid |
|||
row.goodsSkuTitle = value.goodsSpuName |
|||
row.goodsSkuCode = value.goodsSkuCode |
|||
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec |
|||
row.unit = value.unit |
|||
row.warehouseName = value.warehouseName |
|||
row.warehouseSid = value.warehouseSid |
|||
row.warehouseRackCode = value.warehouseRackCode |
|||
row.warehouseRackSid = value.warehouseRackSid |
|||
row.cost = value.cost |
|||
row.count = value.count |
|||
document.body.click() |
|||
}, |
|||
commodityDelete(index) { |
|||
this.formobj.asHoseSuppGoodsDetailList.splice(index, 1) |
|||
}, |
|||
serviceAdd() { |
|||
this.formobj.asHoseSuppSitemDetailList.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
repairId: '', |
|||
billType: '', |
|||
subject: '', |
|||
sitem: '', |
|||
serviceType: '', |
|||
hours: '', |
|||
salePrice: '', |
|||
examineHourPrice: '', |
|||
suppAmout: '' |
|||
}) |
|||
}, |
|||
serviceInput(value) { |
|||
this.serviceQuery.params.useOrgSid = this.formobj.deptSid |
|||
this.serviceQuery.params.name = value |
|||
this.serviceLoading = true |
|||
req.getServiceItemListPageNew(this.serviceQuery).then((response) => { |
|||
if (response.success) { |
|||
this.serviceLoading = false |
|||
this.serviceData = response.data.records |
|||
this.serviceQuery.total = response.data.total |
|||
} else { |
|||
this.serviceLoading = false |
|||
this.serviceData = [] |
|||
this.serviceQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
serviceCurrentChange(value, row) { |
|||
row.repairId = value.repairId |
|||
row.billType = value.billType |
|||
row.subject = value.subject |
|||
row.sitem = value.sitem |
|||
row.serviceType = value.serviceType |
|||
row.hours = value.hours |
|||
row.salePrice = value.salePrice |
|||
row.examineHourPrice = value.examineHourPrice |
|||
document.body.click() |
|||
}, |
|||
serviceDelete(index) { |
|||
this.formobj.asHoseSuppSitemDetailList.splice(index, 1) |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
if (valid) { |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length === 0) { |
|||
this.$message({showClose: true, type: 'error', message: '商品列表不能为空'}) |
|||
return |
|||
} |
|||
if (this.formobj.asHoseSuppSitemDetailList.length === 0) { |
|||
this.$message({showClose: true, type: 'error', message: '维修项目列表不能为空'}) |
|||
return |
|||
} else { |
|||
for (var i = 0; i < this.formobj.asHoseSuppSitemDetailList.length; i++) { |
|||
if (this.formobj.asHoseSuppSitemDetailList[i].suppAmout === '') { |
|||
this.$message({showClose: true, type: 'error', message: '维修项目列表中抵顶金额不能为空'}) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
} |
|||
this.formobj.costTotal = this.spTotal |
|||
this.formobj.suppAmoutTotal = this.ddjeTotal |
|||
this.submitdisabled = true |
|||
req.saveOrUpdate(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
submit() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) |
|||
return |
|||
} |
|||
if (this.formobj.asHoseSuppSitemDetailList.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '维修项目列表不能为空' }) |
|||
return |
|||
} else { |
|||
for (var i = 0; i < this.formobj.asHoseSuppSitemDetailList.length; i++) { |
|||
if (this.formobj.asHoseSuppSitemDetailList[i].suppAmout === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '维修项目列表中抵顶金额不能为空' }) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
this.formobj.costTotal = this.spTotal |
|||
this.formobj.suppAmoutTotal = this.ddjeTotal |
|||
if (this.formobj.costTotal !== this.formobj.suppAmoutTotal) { |
|||
this.$message({ showClose: true, type: 'error', message: '因商品总额与工时提成抵顶金额不一致,操作失败' }) |
|||
return |
|||
} |
|||
this.submitdisabled = true |
|||
req.submit(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
this.handleReturn('true') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
} |
|||
this.submitdisabled = false |
|||
this.commodityData = [] |
|||
this.serviceData = [] |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,168 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="listconadd"> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">二级站</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.secondStatName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表</div> |
|||
<el-table :key="commodityKey" :data="formobj.asHoseSuppGoodsDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsID" label="商品ID" width="200" align="center" /> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
|||
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
|||
<el-table-column prop="warehouseName" label="仓库" min-width="100" align="center" /> |
|||
<el-table-column prop="warehouseRackCode" label="库位" width="100" align="center" /> |
|||
<el-table-column prop="cost" label="入库单价" align="center" width="150" /> |
|||
<el-table-column prop="count" label="库存数量" width="100" align="center" /> |
|||
</el-table> |
|||
<div class="title">维修项目</div> |
|||
<el-table :key="serviceKey" :data="formobj.asHoseSuppSitemDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" width="180" /> |
|||
<el-table-column prop="billType" label="维修单类型" align="center" width="140" /> |
|||
<el-table-column prop="subject" label="科目" align="center" width="100" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" width="140" /> |
|||
<el-table-column prop="serviceType" label="工种" align="center" width="100" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" width="150" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" width="150" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" width="150" /> |
|||
<el-table-column prop="suppAmout" label="抵顶金额" align="center" min-width="200" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">商品总额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.costTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">工时提成抵顶金额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.suppAmoutTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/operation/topFitting' |
|||
|
|||
export default { |
|||
name: 'TopFittingInfo', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
index: 0, |
|||
// commodity商品 |
|||
commodityKey: 1, |
|||
// service服务 |
|||
serviceKey: 2, |
|||
formobj: { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
methods: { |
|||
showInfo(row) { |
|||
this.viewTitle = '工时提成抵顶配件费用申请详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(row.sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
} |
|||
}) |
|||
}, |
|||
handleReturn() { |
|||
this.formobj = { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
} |
|||
this.$refs['form_obj'].resetFields() |
|||
this.$emit('doback') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,337 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar ref="btnbar" view-title="仓库区域管理" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow"> |
|||
{{ searchxianshitit }} |
|||
</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form :inline="true" class="tab-header"> |
|||
<el-form-item label="区域名称"> |
|||
<el-input v-model="queryParams.params.name" placeholder="" clearable /> |
|||
</el-form-item> |
|||
<el-form-item label="区域编码"> |
|||
<el-input v-model="queryParams.params.code" placeholder="" clearable /> |
|||
</el-form-item> |
|||
<el-form-item label="所属仓库"> |
|||
<el-select v-model="queryParams.params.warehouseSid" placeholder="所属仓库"> |
|||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" |
|||
:value="item.sid" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
|
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- Start 项目列表头部 --> |
|||
<div class="listtop"> |
|||
<div class="tit">仓库区域列表</div> |
|||
</div> |
|||
<!-- End 项目列表头部 --> |
|||
<!-- Start 项目列表 --> |
|||
<div class=""> |
|||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" |
|||
@selection-change="selectionLineChangeHandle"> |
|||
<el-table-column fixed width="50" type="selection" align="center" /> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" /> |
|||
<!-- <el-table-column label="操作" align="center" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">详情</el-button> |
|||
</template> |
|||
</el-table-column> --> |
|||
<el-table-column label="是否可用" align="center" width="140"> |
|||
<template slot-scope="scope"> |
|||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1" |
|||
inactive-value="0" @change="enableChange(scope.row.sid,scope.row.isEnable)" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="zoneName" label="区域名称" align="center" /> |
|||
<el-table-column prop="zoneCode" label="区域编码" align="center" /> |
|||
<el-table-column prop="volume" label="区域面积" align="center" /> |
|||
<el-table-column prop="unit" label="计量单位" align="center" /> |
|||
<el-table-column prop="remarks" label="备注" align="center" /> |
|||
<el-table-column prop="warehouseName" label="所属仓库" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
<!-- End 项目列表 --> |
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" |
|||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- End 查询和其列表部分 --> |
|||
<!-- 新增修改部分组件 --> |
|||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> |
|||
<!-- <divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" /> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/warehouse/warehouseZone.js' |
|||
import req2 from '@/api/warehouse/warehouse.js' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import divAdd from './warehouseZoneAdd.vue' |
|||
// import divInfo from './warehouseInfo.vue' |
|||
export default { |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
divAdd, |
|||
// divInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
tableLoading: false, |
|||
dataList: [], |
|||
btnList: [{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toEdit', |
|||
btnLabel: '编辑' |
|||
}, |
|||
{ |
|||
type: 'danger', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'doDel', |
|||
btnLabel: '删除' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
name: '', |
|||
code: "", |
|||
address: "" |
|||
} |
|||
}, |
|||
sids: [], |
|||
selectionList: [], |
|||
warehouseList: [], |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
created() { |
|||
this.loadList() |
|||
this.getwarehouse() |
|||
}, |
|||
methods: { |
|||
selectionLineChangeHandle(val) { |
|||
console.log("val", val); |
|||
|
|||
this.selectionList = val |
|||
|
|||
const aa = [] |
|||
val.forEach(element => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
|
|||
|
|||
}, |
|||
getwarehouse() { |
|||
var parpams = { |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|||
} |
|||
req2.getAllWarehouse(parpams).then(resp => { |
|||
console.log('>>>>>>>>>getAllWarehouse', resp) |
|||
this.warehouseList = resp.data |
|||
}).catch(() => {}) |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'toEdit': |
|||
this.toEdit() |
|||
break |
|||
case 'doDel': |
|||
this.doDel() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
loadList() { |
|||
this.tableLoading = true |
|||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid') |
|||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|||
this.queryParams.params.menuUrl = this.$route.path |
|||
req.listPage(this.queryParams).then((resp) => { |
|||
this.tableLoading = false |
|||
if (resp.success) { |
|||
const data = resp.data |
|||
this.queryParams.total = data.total |
|||
this.dataList = data.records |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
this.dataList = [] |
|||
this.queryParams.total = 0 |
|||
} |
|||
}).catch(() => { |
|||
this.tableLoading = false |
|||
}) |
|||
}, |
|||
|
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
dosearch() { |
|||
this.queryParams.current = 1 |
|||
this.loadList() |
|||
}, |
|||
resetQuery() { |
|||
this.queryParams = { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
name: '', |
|||
code: "", |
|||
address: "" |
|||
} |
|||
} |
|||
this.loadList() |
|||
}, |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd() |
|||
}, |
|||
|
|||
toEdit() { |
|||
if (this.selectionList.length != 1) { |
|||
this.$message({ |
|||
type: 'warning', |
|||
message: "请选择一条数据。", |
|||
showClose: true |
|||
}) |
|||
return |
|||
} |
|||
|
|||
this.viewState = 3 |
|||
this.$refs['divadd'].showEdit(this.selectionList[0]) |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
}, |
|||
toRelevancy(row) { |
|||
this.viewState = 4 |
|||
this.$refs['divinfo'].showEdit(row) |
|||
}, |
|||
|
|||
doDel() { |
|||
|
|||
if (this.sids.length > 0) { |
|||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const loading = this.$loading({ |
|||
lock: true, |
|||
text: 'Loading', |
|||
spinner: 'el-icon-loading', |
|||
background: 'rgba(0, 0, 0, 0.7)' |
|||
}) |
|||
req.deleteBySids(this.sids).then((resp) => { |
|||
loading.close() |
|||
if (resp.success) { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: resp.msg, |
|||
showClose: true |
|||
}) |
|||
this.loadList() |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}).catch(e => { |
|||
loading.close() |
|||
}) |
|||
}).catch(() => {}) |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请至少选择一条记录进行删除操作' |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
enableChange(sid, state) { |
|||
console.log('sid', sid) |
|||
console.log('state', state) |
|||
req.updateIsEnable(sid, state).then((resp) => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '状态已更新', |
|||
showClose: true |
|||
}) |
|||
} else { // 根据resp.code进行异常情况处理 |
|||
} |
|||
}).catch(e => { |
|||
console.log(e) |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<div> |
|||
|
|||
<div class="tab-header webtop"> |
|||
<!-- 标题 --> |
|||
<div>{{title}}仓库区域</div> |
|||
<!-- start 添加修改按钮 --> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
|
|||
<div class="listconadd"> |
|||
|
|||
|
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
|
|||
<el-row class="first_row"> |
|||
<el-col :span="8"> |
|||
|
|||
<div class="span-sty"><span class="must">*</span> 选择所属仓库</div> |
|||
<el-form-item prop="warehouseName"> |
|||
<el-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="addinputw addinputInfo" |
|||
@change="selectWarehouseChange"> |
|||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" |
|||
:value="item.sid" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="8"> |
|||
<div class="span-sty"><span class="must">*</span> 区域名称</div> |
|||
<el-form-item prop="zoneName"> |
|||
<el-input v-model="formobj.zoneName" placeholder="区域名称" class="addinputw addinputInfo" clearable /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="8"> |
|||
<div class="span-sty">区域编码</div> |
|||
<el-form-item prop="zoneCode"> |
|||
<span class="addinputw addinputInfo">{{formobj.zoneCode}}</span> |
|||
<!-- <el-input v-model="formobj.areaCode" placeholder="由系统自动生成" :readonly="true" class="addinputw addinputInfo" |
|||
clearable oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" /> --> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
|
|||
<el-row> |
|||
<el-col :span="8"> |
|||
|
|||
<div class="span-sty">区域面积</div> |
|||
<el-form-item> |
|||
<el-input v-model="formobj.volume" placeholder="区域面积" class="addinputw addinputInfo" clearable |
|||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="8"> |
|||
<div class="span-sty">计量单位</div> |
|||
<el-form-item> |
|||
<el-input v-model="formobj.unit" placeholder="计量单位" class="addinputw addinputInfo" clearable /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
<el-col :span="8"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item> |
|||
<el-input v-model="formobj.remarks" placeholder="备注" class="addinputw addinputInfo" clearable /> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/warehouse/warehouseZone.js' |
|||
import req2 from '@/api/warehouse/warehouse.js' |
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
title: "【新增】", |
|||
submitdisabled: false, |
|||
formobj: { |
|||
sid: '', |
|||
zoneName: '', |
|||
zoneCode: '由系统自动生成', |
|||
volume: '', |
|||
unit: '', |
|||
remarks: '', |
|||
warehouseName: '', |
|||
warehouseSid: '', |
|||
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|||
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|||
userSid: window.sessionStorage.getItem('userSid'), |
|||
|
|||
}, |
|||
warehouseList: [], |
|||
rules: { |
|||
warehouseName: [{ |
|||
required: true, |
|||
message: '请选择所属仓库', |
|||
trigger: 'change' |
|||
}], |
|||
|
|||
zoneName: [{ |
|||
required: true, |
|||
message: '区域名称不能为空', |
|||
trigger: 'blur' |
|||
}], |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.initData() |
|||
}, |
|||
methods: { |
|||
initData() { |
|||
var parpams = { |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|||
} |
|||
req2.getAllWarehouse(parpams).then(resp => { |
|||
this.warehouseList = resp.data |
|||
}) |
|||
|
|||
}, |
|||
|
|||
saveOrUpdate() { |
|||
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|||
|
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
|
|||
req.saveWarehousezone(this.formobj) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
this.handleReturn('true') |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: '', |
|||
zoneName: '', |
|||
zoneCode: '由系统自动生成', |
|||
volume: '', |
|||
unit: '', |
|||
remarks: '', |
|||
warehouseName: '', |
|||
warehouseSid: '', |
|||
useOrgSid: window.sessionStorage.getItem('departmentSid'), |
|||
orgPath: window.sessionStorage.getItem('defaultOrgPath'), |
|||
createOrgSid: window.sessionStorage.getItem('orgSid'), |
|||
userSid: window.sessionStorage.getItem('userSid'), |
|||
|
|||
} |
|||
this.$emit('doback') |
|||
}, |
|||
showAdd() { |
|||
this.title = "【新增】" |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
|
|||
}, |
|||
showEdit(row) { |
|||
this.title = "【编辑】", |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
|
|||
req.initWarehousezone(row.sid) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.formobj = resp.data |
|||
} |
|||
}) |
|||
.catch(e => { |
|||
this.formobj = row |
|||
}) |
|||
}, |
|||
selectWarehouseChange(val) { |
|||
const choose = this.warehouseList.filter((item) => item.sid == val) |
|||
console.log('>>>>>>>>>selectWarehouseChange', choose) |
|||
this.formobj.warehouseSid = choose[0].sid |
|||
this.formobj.warehouseName = choose[0].warehouseName |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
/deep/ .el-form-item__error { |
|||
margin-left: 120px !important; |
|||
} |
|||
|
|||
.must { |
|||
color: #f00; |
|||
} |
|||
|
|||
.span-sty { |
|||
width: 130px !important; |
|||
align-items: center; |
|||
} |
|||
|
|||
.addinputInfo { |
|||
margin-left: 120px !important; |
|||
} |
|||
|
|||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
|||
margin-left: 120px !important; |
|||
width: calc(100% - 115px); |
|||
} |
|||
|
|||
.first_row { |
|||
border-top: 1px solid #E0E3EB; |
|||
} |
|||
|
|||
.titleOne { |
|||
padding: 7px; |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
} |
|||
</style> |
@ -0,0 +1,389 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="openCountersign('加签')">加 签</el-button> |
|||
<el-button type="primary" size="small" @click="openAgree('同意')">同 意</el-button> |
|||
<el-button type="danger" size="small" @click="openReject('驳回')">驳 回</el-button> |
|||
<el-button type="danger" size="small" @click="openStop('终止')">终 止</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">二级站</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.secondStatName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表</div> |
|||
<el-table :key="commodityKey" :data="formobj.asHoseSuppGoodsDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsID" label="商品ID" width="200" align="center" /> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
|||
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
|||
<el-table-column prop="warehouseName" label="仓库" min-width="100" align="center" /> |
|||
<el-table-column prop="warehouseRackCode" label="库位" width="100" align="center" /> |
|||
<el-table-column prop="cost" label="入库单价" align="center" width="150" /> |
|||
<el-table-column prop="count" label="库存数量" width="100" align="center" /> |
|||
</el-table> |
|||
<div class="title">维修项目</div> |
|||
<el-table :key="serviceKey" :data="formobj.asHoseSuppSitemDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" width="180" /> |
|||
<el-table-column prop="billType" label="维修单类型" align="center" width="140" /> |
|||
<el-table-column prop="subject" label="科目" align="center" width="100" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" width="140" /> |
|||
<el-table-column prop="serviceType" label="工种" align="center" width="100" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" width="150" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" width="150" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" width="150" /> |
|||
<el-table-column prop="suppAmout" label="抵顶金额" align="center" min-width="200" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">商品总额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.costTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">工时提成抵顶金额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.suppAmoutTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/operation/topFitting' |
|||
import { selectStaffListss } from '@/api/Common/dictcommons' |
|||
|
|||
export default { |
|||
name: 'TopFittingDaiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
index: 0, |
|||
// commodity商品 |
|||
commodityKey: 1, |
|||
// service服务 |
|||
serviceKey: 2, |
|||
formobj: { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
}, |
|||
rules: {}, |
|||
options: [], |
|||
operation: '', // 点击操作按钮 |
|||
dialogList: { |
|||
comment: '' |
|||
}, |
|||
startTask: true, |
|||
current: { |
|||
taskDefKey: '', |
|||
taskName: '' // 当前环节名称 |
|||
}, |
|||
nextNode: {}, // 下一环节 |
|||
nodeDialogVisible: false, |
|||
currentLink: true, |
|||
countersignLink: false, |
|||
// 环节所需参数 |
|||
linkByParameter: { |
|||
businessSid: '', |
|||
comment: '', |
|||
instanceId: '', |
|||
taskId: '', |
|||
orgSidPath: '', |
|||
taskDefKey: '', |
|||
userSid: '' |
|||
}, |
|||
// 加签按钮所需参数 |
|||
countersign: { |
|||
taskId: '', |
|||
assignee: '', |
|||
userSid: '', |
|||
instanceId: '', |
|||
views: '' |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
console.log('iframe页面获取的obj:', obj) |
|||
// 点击(同意、终止、驳回、驳回)操作时所需的参数 |
|||
this.linkByParameter.businessSid = obj.businessSid |
|||
this.linkByParameter.instanceId = obj.instanceId |
|||
this.linkByParameter.taskId = obj.taskId |
|||
this.linkByParameter.taskDefKey = obj.taskDefKey |
|||
// this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath') |
|||
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid') |
|||
this.current.taskDefKey = obj.taskDefKey |
|||
this.current.taskName = obj.taskName |
|||
// 加签参数 |
|||
this.countersign.taskId = obj.taskId |
|||
this.countersign.userSid = window.sessionStorage.getItem('userSid') |
|||
this.countersign.instanceId = obj.instanceId |
|||
// 加载表单数据 |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '工时提成抵顶配件费用申请详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
} |
|||
}) |
|||
selectStaffListss().then((res) => { |
|||
if (res.success) { |
|||
this.options = res.data |
|||
} |
|||
}) |
|||
}, |
|||
// 加签 |
|||
openCountersign(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = true |
|||
this.dialogList.comment = '' |
|||
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 同意 |
|||
openAgree(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '同意' |
|||
req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 驳回 |
|||
openReject(val) { |
|||
this.operation = val |
|||
this.currentLink = true |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '' |
|||
req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { |
|||
if (resp.success) { |
|||
var arr = resp.data |
|||
this.nextNode = arr[0] |
|||
this.nodeDialogVisible = true |
|||
} |
|||
this.submitdisabled = false |
|||
}) |
|||
}, |
|||
// 终止 |
|||
openStop(val) { |
|||
this.operation = val |
|||
this.currentLink = false |
|||
this.countersignLink = false |
|||
this.dialogList.comment = '' |
|||
this.nodeDialogVisible = true |
|||
}, |
|||
reject() { |
|||
if (this.operation === '同意') { |
|||
this.handleAgree() |
|||
} else if (this.operation === '驳回') { |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
} else { |
|||
this.handleReject() |
|||
} |
|||
} else if (this.operation === '终止') { |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
} else { |
|||
this.handleStop() |
|||
} |
|||
} else if (this.operation === '加签') { |
|||
this.handleCountersign() |
|||
} |
|||
}, |
|||
/** 加签 */ |
|||
handleCountersign() { |
|||
if (this.countersign.assignee === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请选择加签人员' }) |
|||
return |
|||
} |
|||
if (this.dialogList.comment === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) |
|||
return |
|||
} |
|||
this.countersign.views = this.dialogList.comment |
|||
req.delegate(this.countersign).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 同意任务 */ |
|||
handleAgree() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.complete(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 驳回任务 */ |
|||
handleReject() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.reject(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
}, |
|||
/** 终止任务 */ |
|||
handleStop() { |
|||
this.linkByParameter.comment = this.dialogList.comment |
|||
req.breakProcess(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
.rowClass{ |
|||
border-top: 1px solid #E0E3EB; |
|||
} |
|||
</style> |
@ -0,0 +1,482 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">二级站</div> |
|||
<el-form-item> |
|||
<el-select class="addinputInfo" v-model="formobj.secondStatSid" @change="changeSecondStat" clearable filterable placeholder=""> |
|||
<el-option v-for="item in secondStat_list" :key="item.sid" :label="item.name" :value="item.sid"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表</div> |
|||
<el-table :key="commodityKey" :data="formobj.asHoseSuppGoodsDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column align="center" width="80"> |
|||
<template slot="header" slot-scope="scope"> |
|||
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="commodityAdd(scope.row)"></i> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="商品名称" align="center" width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-popover placement="right" trigger="click" width="500"> |
|||
<div> |
|||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row @current-change="commodityCurrentChange($event, scope.row)"> |
|||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center"/> |
|||
<el-table-column prop="goodsSkuCode" label="图号" align="center"/> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center"/> |
|||
<el-table-column prop="unit" label="单位" align="center"/> |
|||
</el-table> |
|||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size" layout="total, pager" :total="commodityQuery.total"/> |
|||
</div> |
|||
<el-input slot="reference" v-model="scope.row.goodsSpuName" @input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称"/> |
|||
</el-popover> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="goodsID" label="商品ID" width="200" align="center" /> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
|||
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
|||
<el-table-column prop="warehouseName" label="仓库" min-width="100" align="center" /> |
|||
<el-table-column prop="warehouseRackCode" label="库位" width="100" align="center" /> |
|||
<el-table-column prop="cost" label="入库单价" align="center" width="150" /> |
|||
<el-table-column prop="count" label="库存数量" width="100" align="center" /> |
|||
</el-table> |
|||
<div class="title">维修项目</div> |
|||
<el-table :key="serviceKey" :data="formobj.asHoseSuppSitemDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column align="center" width="80"> |
|||
<template slot="header" slot-scope="scope"> |
|||
<i class="add-btn-icon el-icon-plus" style="color: red;font-size:20px" @click="serviceAdd(scope.row)"></i> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<i class="el-icon-delete" @click="serviceDelete(scope.$index)"></i> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="维修项目" align="center" width="300"> |
|||
<template slot-scope="scope"> |
|||
<el-popover placement="right" width="600" trigger="click"> |
|||
<div> |
|||
<el-table :data="serviceData" v-loading="serviceLoading" highlight-current-row @current-change="serviceCurrentChange($event, scope.row)"> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" /> |
|||
</el-table> |
|||
<el-pagination :page.sync="serviceQuery.current" :page-size="serviceQuery.size" layout="total, pager" :total="serviceQuery.total" /> |
|||
</div> |
|||
<el-input slot="reference" v-model="scope.row.sitem" @input="serviceInput(scope.row.sitem)" clearable placeholder="项目名称、维修单号"/> |
|||
</el-popover> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" width="180" /> |
|||
<el-table-column prop="billType" label="维修单类型" align="center" width="140" /> |
|||
<el-table-column prop="subject" label="科目" align="center" width="100" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" width="140" /> |
|||
<el-table-column prop="serviceType" label="工种" align="center" width="100" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" width="150" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" width="150" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" width="150" /> |
|||
<el-table-column label="抵顶金额" align="center" min-width="200"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.suppAmout" @keyup.native="scope.row.suppAmout = getNumber(scope.row.suppAmout, 2)" clearable placeholder="" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">商品总额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ spTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">工时提成抵顶金额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ ddjeTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { selInvenGoodsByUseOrgSid, tranFive } from '@/api/Common/dictcommons' |
|||
import req from '@/api/operation/topFitting' |
|||
|
|||
export default { |
|||
name: 'TopFittingEdit', |
|||
computed: { |
|||
spTotal() { |
|||
let sp = '0' |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length > 0) { |
|||
this.formobj.asHoseSuppGoodsDetailList.forEach((e) => { |
|||
sp = Math.round((parseFloat(sp) + (parseFloat(e.cost !== '' ? e.cost : 0) * parseFloat(e.count !== '' ? e.count : 0))) * 100) / 100 |
|||
}) |
|||
} |
|||
return sp |
|||
}, |
|||
ddjeTotal() { |
|||
let ddje = '0' |
|||
if (this.formobj.asHoseSuppSitemDetailList.length > 0) { |
|||
this.formobj.asHoseSuppSitemDetailList.forEach((e) => { |
|||
ddje = Math.round((parseFloat(ddje) + parseFloat(e.suppAmout !== '' ? e.suppAmout : 0)) * 100) / 100 |
|||
}) |
|||
} |
|||
return ddje |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
submitdisabled: false, |
|||
index: 0, |
|||
secondStat_list: [], |
|||
// commodity商品 |
|||
commodityKey: 1, |
|||
commodityLoading: false, |
|||
commodityQuery: { |
|||
current: 1, |
|||
size: 2, |
|||
total: 0, |
|||
params: { |
|||
goodsName: '', |
|||
useOrgSid: '' |
|||
} |
|||
}, |
|||
commodityData: [], |
|||
// service服务 |
|||
serviceKey: 2, |
|||
serviceLoading: false, |
|||
serviceQuery: { |
|||
current: 1, |
|||
size: 2, |
|||
total: 0, |
|||
params: { |
|||
name: '', |
|||
useOrgSid: '' |
|||
} |
|||
}, |
|||
serviceData: [], |
|||
formobj: { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
methods: { |
|||
getNumber(val, limit) { |
|||
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
|||
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
|||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
|||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
|||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|||
const reg = new RegExp(str) |
|||
if (limit === 0) { |
|||
// 不需要小数点 |
|||
val = val.replace(reg, '$1') |
|||
} else { |
|||
// 通过正则保留小数点后指定的位数 |
|||
val = val.replace(reg, '$1.$2') |
|||
} |
|||
return val |
|||
}, |
|||
showInfo(sid) { |
|||
this.viewTitle = '【编辑】工时提成抵顶配件费用申请' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
this.formobj.instanceId = res.data.procInstId |
|||
tranFive(this.formobj.deptSid).then((res) => { |
|||
if (res.success) { |
|||
this.secondStat_list = res.data |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
changeSecondStat(value) { |
|||
const choose = this.secondStat_list.filter((item) => item.sid === value) |
|||
if (choose !== null && choose.length > 0) { |
|||
this.formobj.secondStatName = choose[0].name |
|||
} else { |
|||
this.formobj.secondStatName = '' |
|||
} |
|||
}, |
|||
commodityAdd() { |
|||
this.formobj.asHoseSuppGoodsDetailList.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
goodsID: '', // 商品ID |
|||
goodsSpuSid: '', |
|||
goodsSpuName: '', // 商品名称 |
|||
goodsSkuSid: '', |
|||
goodsSkuTitle: '', // 商品名称 |
|||
goodsSkuCode: '', // 商品编码(图号) |
|||
goodsSkuOwnSpec: '', // 规格型号 |
|||
unit: '', // 计量单位 |
|||
warehouseName: '', // 仓库名称 |
|||
warehouseSid: '', |
|||
warehouseRackCode: '', // 库位编号 |
|||
warehouseRackSid: '', |
|||
cost: '', // 入库单价 |
|||
count: '' // 库存数量 |
|||
}) |
|||
}, |
|||
commodityInput(value) { |
|||
this.commodityQuery.params.useOrgSid = this.formobj.deptSid |
|||
this.commodityQuery.params.goodsName = value |
|||
this.commodityLoading = true |
|||
selInvenGoodsByUseOrgSid(this.commodityQuery).then((response) => { |
|||
if (response.success) { |
|||
this.commodityLoading = false |
|||
this.commodityData = response.data.records |
|||
this.commodityQuery.total = response.data.total |
|||
} else { |
|||
this.commodityLoading = false |
|||
this.commodityData = [] |
|||
this.commodityQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
commodityCurrentChange(value, row) { |
|||
row.goodsID = value.goodsID |
|||
row.goodsSpuSid = value.goodsSpuSid |
|||
row.goodsSpuName = value.goodsSpuName |
|||
row.goodsSkuSid = value.goodsSkuSid |
|||
row.goodsSkuTitle = value.goodsSpuName |
|||
row.goodsSkuCode = value.goodsSkuCode |
|||
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec |
|||
row.unit = value.unit |
|||
row.warehouseName = value.warehouseName |
|||
row.warehouseSid = value.warehouseSid |
|||
row.warehouseRackCode = value.warehouseRackCode |
|||
row.warehouseRackSid = value.warehouseRackSid |
|||
row.cost = value.cost |
|||
row.count = value.count |
|||
document.body.click() |
|||
}, |
|||
commodityDelete(index) { |
|||
this.formobj.asHoseSuppGoodsDetailList.splice(index, 1) |
|||
}, |
|||
serviceAdd() { |
|||
this.formobj.asHoseSuppSitemDetailList.push({ |
|||
sid: '', |
|||
billSid: '', |
|||
repairId: '', |
|||
billType: '', |
|||
subject: '', |
|||
sitem: '', |
|||
serviceType: '', |
|||
hours: '', |
|||
salePrice: '', |
|||
examineHourPrice: '', |
|||
suppAmout: '' |
|||
}) |
|||
}, |
|||
serviceInput(value) { |
|||
this.serviceQuery.params.useOrgSid = this.formobj.deptSid |
|||
this.serviceQuery.params.name = value |
|||
this.serviceLoading = true |
|||
req.getServiceItemListPageNew(this.serviceQuery).then((response) => { |
|||
if (response.success) { |
|||
this.serviceLoading = false |
|||
this.serviceData = response.data.records |
|||
this.serviceQuery.total = response.data.total |
|||
} else { |
|||
this.serviceLoading = false |
|||
this.serviceData = [] |
|||
this.serviceQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
serviceCurrentChange(value, row) { |
|||
row.repairId = value.repairId |
|||
row.billType = value.billType |
|||
row.subject = value.subject |
|||
row.sitem = value.sitem |
|||
row.serviceType = value.serviceType |
|||
row.hours = value.hours |
|||
row.salePrice = value.salePrice |
|||
row.examineHourPrice = value.examineHourPrice |
|||
document.body.click() |
|||
}, |
|||
serviceDelete(index) { |
|||
this.formobj.asHoseSuppSitemDetailList.splice(index, 1) |
|||
}, |
|||
saveOrUpdate() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
if (valid) { |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length === 0) { |
|||
this.$message({showClose: true, type: 'error', message: '商品列表不能为空'}) |
|||
return |
|||
} |
|||
if (this.formobj.asHoseSuppSitemDetailList.length === 0) { |
|||
this.$message({showClose: true, type: 'error', message: '维修项目列表不能为空'}) |
|||
return |
|||
} else { |
|||
for (var i = 0; i < this.formobj.asHoseSuppSitemDetailList.length; i++) { |
|||
if (this.formobj.asHoseSuppSitemDetailList[i].suppAmout === '') { |
|||
this.$message({showClose: true, type: 'error', message: '维修项目列表中抵顶金额不能为空'}) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
} |
|||
this.formobj.costTotal = this.spTotal |
|||
this.formobj.suppAmoutTotal = this.ddjeTotal |
|||
this.submitdisabled = true |
|||
req.saveOrUpdate(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
submit() { |
|||
this.$refs['form_obj'].validate((valid) => { |
|||
if (valid) { |
|||
if (this.formobj.asHoseSuppGoodsDetailList.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) |
|||
return |
|||
} |
|||
if (this.formobj.asHoseSuppSitemDetailList.length === 0) { |
|||
this.$message({ showClose: true, type: 'error', message: '维修项目列表不能为空' }) |
|||
return |
|||
} else { |
|||
for (var i = 0; i < this.formobj.asHoseSuppSitemDetailList.length; i++) { |
|||
if (this.formobj.asHoseSuppSitemDetailList[i].suppAmout === '') { |
|||
this.$message({ showClose: true, type: 'error', message: '维修项目列表中抵顶金额不能为空' }) |
|||
return |
|||
} |
|||
} |
|||
} |
|||
this.formobj.costTotal = this.spTotal |
|||
this.formobj.suppAmoutTotal = this.ddjeTotal |
|||
if (this.formobj.costTotal !== this.formobj.suppAmoutTotal) { |
|||
this.$message({ showClose: true, type: 'error', message: '因商品总额与工时提成抵顶金额不一致,操作失败' }) |
|||
return |
|||
} |
|||
this.submitdisabled = true |
|||
req.submit(this.formobj).then((res) => { |
|||
if (res.success) { |
|||
this.$message({ showClose: true, type: 'success', message: '操作成功' }) |
|||
// 子页面向父级页面传递值(关闭弹框) |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} else { |
|||
this.submitdisabled = false |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,213 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<div class="tab-header webtop"> |
|||
<div>{{ viewTitle }}</div> |
|||
<div> |
|||
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button> |
|||
</div> |
|||
</div> |
|||
<div class=""> |
|||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|||
<el-row style="border-top: 1px solid #e0e3eb"> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作部门</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作人</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">操作日期</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="span-sty">二级站</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.secondStatName }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="16"> |
|||
<div class="span-sty">备注</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<div class="title">商品列表</div> |
|||
<el-table :key="commodityKey" :data="formobj.asHoseSuppGoodsDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="goodsID" label="商品ID" width="200" align="center" /> |
|||
<el-table-column prop="goodsSpuName" label="商品名称" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuCode" label="图号" width="100" align="center" /> |
|||
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" /> |
|||
<el-table-column prop="unit" label="单位" width="100" align="center" /> |
|||
<el-table-column prop="warehouseName" label="仓库" min-width="100" align="center" /> |
|||
<el-table-column prop="warehouseRackCode" label="库位" width="100" align="center" /> |
|||
<el-table-column prop="cost" label="入库单价" align="center" width="150" /> |
|||
<el-table-column prop="count" label="库存数量" width="100" align="center" /> |
|||
</el-table> |
|||
<div class="title">维修项目</div> |
|||
<el-table :key="serviceKey" :data="formobj.asHoseSuppSitemDetailList" :index="index" border style="width: 100%"> |
|||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|||
<el-table-column prop="repairId" label="维修单号" align="center" width="180" /> |
|||
<el-table-column prop="billType" label="维修单类型" align="center" width="140" /> |
|||
<el-table-column prop="subject" label="科目" align="center" width="100" /> |
|||
<el-table-column prop="sitem" label="维修项目" align="center" width="140" /> |
|||
<el-table-column prop="serviceType" label="工种" align="center" width="100" /> |
|||
<el-table-column prop="hours" label="工时数" align="center" width="150" /> |
|||
<el-table-column prop="salePrice" label="销售价" align="center" width="150" /> |
|||
<el-table-column prop="examineHourPrice" label="工时提成" align="center" width="150" /> |
|||
<el-table-column prop="suppAmout" label="抵顶金额" align="center" min-width="200" /> |
|||
</el-table> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">商品总额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.costTotal }}</span></el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<div class="span-sty" style="border-right: 0px">工时提成抵顶金额:</div> |
|||
<el-form-item><span class="addinputInfo">{{ formobj.suppAmoutTotal }}</span></el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/operation/topFitting' |
|||
|
|||
export default { |
|||
name: 'TopFittingYiBan', |
|||
data() { |
|||
return { |
|||
viewTitle: '', |
|||
viewState: 1, |
|||
index: 0, |
|||
// commodity商品 |
|||
commodityKey: 1, |
|||
// service服务 |
|||
serviceKey: 2, |
|||
formobj: { |
|||
sid: '', |
|||
billNo: '', |
|||
remarks: '', |
|||
createBySid: '', |
|||
createByName: '', |
|||
deptSid: '', |
|||
deptName: '', |
|||
secondStatSid: '', |
|||
secondStatName: '', |
|||
useOrgSid: '', |
|||
useOrgName: '', |
|||
finishTime: '', |
|||
procInstId: '', |
|||
procDefId: '', |
|||
taskId: '', |
|||
nodeId: '', |
|||
nodeState: '', |
|||
costTotal: '', |
|||
suppAmoutTotal: '', |
|||
asHoseSuppGoodsDetailList: [], |
|||
asHoseSuppSitemDetailList: [] |
|||
}, |
|||
rules: {}, |
|||
// 环节所需参数 |
|||
linkByParameter: { |
|||
businessSid: '', |
|||
comment: '', |
|||
instanceId: '', |
|||
taskId: '', |
|||
orgSidPath: '', |
|||
taskDefKey: '', |
|||
userSid: '' |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
console.log('url:' + window.location.href) |
|||
var one = window.location.href.indexOf('&data') + 6 |
|||
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 |
|||
const obj = JSON.parse(decodeURIComponent(data)) |
|||
console.log('iframe页面获取的obj:', obj) |
|||
// 点击(同意、终止、驳回、驳回)操作时所需的参数 |
|||
this.linkByParameter.businessSid = obj.businessSid |
|||
this.linkByParameter.instanceId = obj.instanceId |
|||
this.linkByParameter.taskId = obj.taskId |
|||
this.linkByParameter.taskDefKey = obj.taskDefKey |
|||
this.linkByParameter.userSid = window.sessionStorage.getItem('userSid') |
|||
// 加载表单数据 |
|||
this.showInfo(obj.businessSid) |
|||
}, |
|||
mounted() { |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 告诉父级页面,子页面的弹框高度。 |
|||
code: 2, |
|||
data: 500 + 'px' |
|||
} |
|||
}, '*') |
|||
}, |
|||
methods: { |
|||
showInfo(sid) { |
|||
this.viewTitle = '工时提成抵顶配件费用申请详情' |
|||
this.$nextTick(() => { |
|||
this.$refs['form_obj'].clearValidate() |
|||
}) |
|||
req.fetchDetailsBySid(sid).then((res) => { |
|||
if (res.success) { |
|||
this.formobj = res.data |
|||
} |
|||
}) |
|||
}, |
|||
/** 确认撤回任务 */ |
|||
openRevoke() { |
|||
this.$confirm('是否确认执行撤回操作', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.handleRevoke() |
|||
}).catch(() => { |
|||
this.$message({ |
|||
type: 'info', |
|||
message: '已取消撤回' |
|||
}) |
|||
}) |
|||
}, |
|||
/** 撤回任务 */ |
|||
handleRevoke() { |
|||
req.revokeProcess(this.linkByParameter).then((response) => { |
|||
if (response.success) { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '执行成功', |
|||
type: 'success', |
|||
duration: 2000 |
|||
}) |
|||
this.nodeDialogVisible = false |
|||
// 子页面向父级页面传递值 |
|||
window.parent.postMessage({ |
|||
cmd: 'returnHeight', |
|||
params: { |
|||
// 操作成功,告诉父级页面关闭弹框 |
|||
code: 1 |
|||
} |
|||
}, '*') |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.span-sty { |
|||
width: 140px !important; |
|||
} |
|||
.addinputInfo { |
|||
margin-left: 130px !important; |
|||
} |
|||
</style> |
@ -0,0 +1,78 @@ |
|||
package com.yxt.wms.apiadmin.base; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.wms.biz.base.wmswarehousearea.*; |
|||
import com.yxt.wms.biz.base.wmswarehousezone.*; |
|||
import com.yxt.wms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/28 8:53 |
|||
*/ |
|||
@Api(tags = "区域信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/base/wmswarehousezone") |
|||
public class WmsWarehouseZoneRest { |
|||
|
|||
@Autowired |
|||
private WmsWarehouseZoneService wmsWarehouseZoneService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<WmsWarehouseZoneVo>> listPage(@RequestBody PagerQuery<WmsWarehouseZoneQuery> pq) { |
|||
return wmsWarehouseZoneService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的库区") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<WmsWarehouseZone>> listAll(@RequestBody OrgPathQuery query) { |
|||
return wmsWarehouseZoneService.getAllType(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody WmsWarehouseZoneDto dto) { |
|||
return wmsWarehouseZoneService.saveZone(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<WmsWarehouseZoneInitVo> initialization(@PathVariable("sid") String sid) { |
|||
return wmsWarehouseZoneService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return wmsWarehouseZoneService.delete(sid); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
wmsWarehouseZoneService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return wmsWarehouseZoneService.updateIsEnable(sid,isEnable); |
|||
} |
|||
|
|||
@ApiOperation("根据仓库sid查询所有库位") |
|||
@GetMapping("/selectAll") |
|||
public ResultBean<List<WmsWarehouseZoneAllVo>> selectAll(@RequestParam("ckSid") String ckSid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<WmsWarehouseZoneAllVo> vo = wmsWarehouseZoneService.selectAll(ckSid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/28 8:38 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZone extends BaseEntity { |
|||
private String zoneName;//库位名称
|
|||
private String zoneCode;//库位编码
|
|||
private String warehouseSid;//仓库sid
|
|||
private BigDecimal volume;//库位容量
|
|||
private String unit;//计量单位
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:58 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZoneAllVo implements Vo { |
|||
|
|||
private String sid; |
|||
@ApiModelProperty("区域名称") |
|||
private String zoneName; |
|||
@ApiModelProperty("区域编码") |
|||
private String zoneCode; |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:37 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZoneDto implements Dto { |
|||
|
|||
private String sid; |
|||
private String remarks; |
|||
private String zoneName;//区域名称
|
|||
private String zoneCode;//区域编码
|
|||
private String warehouseSid;//仓库sid
|
|||
private String warehouseName;//仓库
|
|||
private String volume;//区域面积
|
|||
private String unit;//计量单位
|
|||
private String userSid; //用户sid
|
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:39 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZoneInitVo { |
|||
|
|||
private String sid; |
|||
private String remarks; |
|||
private String zoneName;//区域名称
|
|||
private String zoneCode;//区域编码
|
|||
private String warehouseSid;//仓库sid
|
|||
private String warehouseName;//仓库
|
|||
private String volume;//区域面积
|
|||
private String unit;//计量单位
|
|||
private String userSid; //用户sid
|
|||
|
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.wms.biz.base.wmswarehousearea.WmsWarehouseArea; |
|||
import com.yxt.wms.biz.base.wmswarehousearea.WmsWarehouseAreaAllVo; |
|||
import com.yxt.wms.biz.base.wmswarehousearea.WmsWarehouseAreaVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface WmsWarehouseZoneMapper extends BaseMapper<WmsWarehouseZone> { |
|||
|
|||
IPage<WmsWarehouseZoneVo> listPage(IPage<WmsWarehouseZone> page, @Param(Constants.WRAPPER) QueryWrapper<WmsWarehouseZone> qw); |
|||
|
|||
List<WmsWarehouseZone> listAll(@Param("useOrgSid") String useOrgSid); |
|||
|
|||
WmsWarehouseZone checkForInsert(@Param("zoneCode") String zoneCode,@Param("warehouseSid") String warehouseSid); |
|||
|
|||
int selectNum(@Param("warehouseCode") String warehouseCode); |
|||
|
|||
WmsWarehouseZone checkForUpdate(@Param("zoneCode") String zoneCode, @Param("warehouseSid")String warehouseSid,@Param("sid") String sid); |
|||
|
|||
WmsWarehouseZoneInitVo initialization(String sid); |
|||
|
|||
int updateBySidIsDelete(List<String> list); |
|||
|
|||
List<WmsWarehouseZoneAllVo> selectAll(String ckSid); |
|||
} |
@ -0,0 +1,64 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZoneMapper"> |
|||
<update id="updateBySidIsDelete"> |
|||
UPDATE wms_warehouse_zone |
|||
SET isDelete=1 |
|||
where sid in |
|||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> |
|||
#{item} |
|||
</foreach> |
|||
</update> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="listPage" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZoneVo"> |
|||
select |
|||
a.*,b.warehouseName as warehouseName |
|||
from wms_warehouse_zone a |
|||
left join wms_warehouse_info b on b.sid=a.warehouseSid |
|||
LEFT JOIN anrui_portal.sys_organization as s ON b.useOrgSid = s.sid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="listAll" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZone"> |
|||
select a.* |
|||
from wms_warehouse_zone a |
|||
left join wms_warehouse_info b on b.sid = a.warehouseSid |
|||
where b.useOrgSid = #{useOrgSid} |
|||
and a.isDelete = 0 |
|||
</select> |
|||
<select id="checkForInsert" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZone"> |
|||
select * |
|||
from wms_warehouse_zone |
|||
where zoneCode = #{zoneCode} |
|||
and warehouseSid = #{warehouseSid} |
|||
and isDelete = 0 |
|||
</select> |
|||
<select id="selectNum" resultType="java.lang.Integer"> |
|||
select IFNULL(CAST(REPLACE(MAX(zoneCode), #{warehouseCode}, '') AS SIGNED), 0) as code |
|||
from wms_warehouse_zone |
|||
where zoneCode LIKE concat(#{warehouseCode}, '%') |
|||
</select> |
|||
<select id="checkForUpdate" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZone"> |
|||
select * |
|||
from wms_warehouse_zone |
|||
where zoneCode = #{zoneCode} |
|||
and warehouseSid = #{warehouseSid} |
|||
and sid !=#{sid} |
|||
and isDelete=0 |
|||
</select> |
|||
<select id="initialization" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZoneInitVo"> |
|||
select a.*, |
|||
a.createBySid as userSid, |
|||
b.warehouseName as warehouseName |
|||
from wms_warehouse_zone a |
|||
left join wms_warehouse_info b on b.sid = a.warehouseSid |
|||
where a.sid = #{sid} |
|||
</select> |
|||
<select id="selectAll" resultType="com.yxt.wms.biz.base.wmswarehousezone.WmsWarehouseZoneAllVo"> |
|||
select * from wms_warehouse_zone where warehouseSid = #{ckSid} and isDelete = 0 and isEnable = 1 |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,26 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:24 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZoneQuery implements Query { |
|||
|
|||
private String name;//名字
|
|||
private String code;//编码
|
|||
private String warehouseSid;//仓库
|
|||
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
|
|||
} |
@ -0,0 +1,195 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.wms.biz.base.wmswarehousearea.*; |
|||
import com.yxt.wms.biz.base.wmswarehouseinfo.WmsWarehouseInfo; |
|||
import com.yxt.wms.biz.base.wmswarehouseinfo.WmsWarehouseInfoService; |
|||
import com.yxt.wms.feign.portal.privilege.PrivilegeQuery; |
|||
import com.yxt.wms.feign.portal.sysorganization.SysOrganizationFeign; |
|||
import com.yxt.wms.feign.portal.sysorganization.SysOrganizationVo; |
|||
import com.yxt.wms.feign.portal.sysuser.SysUserFeign; |
|||
import com.yxt.wms.utils.OrgPathQuery; |
|||
import com.yxt.wms.utils.Rule; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:19 |
|||
*/ |
|||
@Service |
|||
public class WmsWarehouseZoneService extends MybatisBaseService<WmsWarehouseZoneMapper, WmsWarehouseZone> { |
|||
@Autowired |
|||
private SysUserFeign sysUserFeign; |
|||
@Autowired |
|||
private SysOrganizationFeign sysOrganizationFeign; |
|||
@Autowired |
|||
private WmsWarehouseInfoService warehouseInfoService; |
|||
|
|||
public ResultBean<PagerVo<WmsWarehouseZoneVo>> listPage(PagerQuery<WmsWarehouseZoneQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WmsWarehouseZoneQuery query = pq.getParams(); |
|||
QueryWrapper<WmsWarehouseZone> qw = new QueryWrapper<>(); |
|||
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|||
privilegeQuery.setOrgPath(query.getOrgPath()); |
|||
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|||
privilegeQuery.setUserSid(query.getUserSid()); |
|||
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|||
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|||
String orgSidPath = query.getOrgPath(); |
|||
orgSidPath = orgSidPath + "/"; |
|||
int i1 = orgSidPath.indexOf("/"); |
|||
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|||
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|||
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|||
String orgLevelKey = defaultIdReltBean.getData(); |
|||
if ("1".equals(orgLevelKey)) { |
|||
orgSidPath = orgSidPath.substring(0, i1); |
|||
qw.like("s.orgSidPath", orgSidPath); |
|||
} else if ("2".equals(orgLevelKey)) { |
|||
orgSidPath = orgSidPath.substring(0, i2); |
|||
qw.like("s.orgSidPath", orgSidPath); |
|||
} else if ("3".equals(orgLevelKey)) { |
|||
orgSidPath = orgSidPath.substring(0, i3); |
|||
qw.like("s.orgSidPath", orgSidPath); |
|||
} else if ("4".equals(orgLevelKey)) { |
|||
orgSidPath = orgSidPath.substring(0, i4); |
|||
qw.like("s.orgSidPath", orgSidPath); |
|||
} else if ("5".equals(orgLevelKey)) { |
|||
qw.eq("a.createBySid", query.getUserSid()); |
|||
} else { |
|||
PagerVo<WmsWarehouseZoneVo> p = new PagerVo<>(); |
|||
return rb.success().setData(p); |
|||
} |
|||
} else { |
|||
PagerVo<WmsWarehouseZoneVo> p = new PagerVo<>(); |
|||
return rb.success().setData(p); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getName())) { |
|||
qw.like("a.zoneName", query.getName()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getCode())) { |
|||
qw.like("a.zoneCode", query.getCode()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getWarehouseSid())) { |
|||
qw.eq("b.sid", query.getWarehouseSid()); |
|||
} |
|||
qw.ne("a.isDelete", "1"); |
|||
IPage<WmsWarehouseZone> page = PagerUtil.queryToPage(pq); |
|||
IPage<WmsWarehouseZoneVo> pagging = baseMapper.listPage(page, qw); |
|||
PagerVo<WmsWarehouseZoneVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
|
|||
public ResultBean<List<WmsWarehouseZone>> getAllType(OrgPathQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String useOrgSid = ""; |
|||
String orgPath = query.getOrgPath(); |
|||
if (StringUtils.isNotBlank(orgPath)) { |
|||
List<String> split = Arrays.asList(orgPath.split("/")); |
|||
if (split.size() > 1) { |
|||
//获取本级sid获取本级部门信息
|
|||
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|||
useOrgSid = sysOrganization1.getSid(); |
|||
} else { |
|||
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|||
useOrgSid = sysOrganization.getSid(); |
|||
} |
|||
} |
|||
List<WmsWarehouseZone> list = baseMapper.listAll(useOrgSid); |
|||
return rb.success().setData(list); |
|||
} |
|||
|
|||
public ResultBean<String> saveZone(WmsWarehouseZoneDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isNotBlank(dto.getSid())) { |
|||
String sid = dto.getSid(); |
|||
WmsWarehouseZone wmsWarehouseZone = fetchBySid(dto.getSid()); |
|||
BeanUtil.copyProperties(dto, wmsWarehouseZone, "id", "sid"); |
|||
if (StringUtils.isNotBlank(dto.getZoneCode()) && !dto.getZoneCode().equals("由系统自动生成")) { |
|||
WmsWarehouseZone zone = baseMapper.checkForUpdate(dto.getZoneCode(), dto.getWarehouseSid(), sid); |
|||
if (null != zone) { |
|||
return rb.setMsg("同一个仓库下的区域编码不能重复。"); |
|||
} |
|||
} else { |
|||
WmsWarehouseInfo warehouseInfo = warehouseInfoService.fetchBySid(dto.getWarehouseSid()); |
|||
if (null != warehouseInfo) { |
|||
String warehouseCode = warehouseInfo.getWarehouseCode(); |
|||
int i = baseMapper.selectNum(warehouseCode); |
|||
String code = Rule.getBillNo3(warehouseCode, i); |
|||
wmsWarehouseZone.setZoneCode(code); |
|||
} |
|||
} |
|||
wmsWarehouseZone.setModifyTime(new Date()); |
|||
baseMapper.updateById(wmsWarehouseZone); |
|||
} else { |
|||
WmsWarehouseZone entity = new WmsWarehouseZone(); |
|||
entity.setCreateBySid(dto.getUserSid()); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
if (StringUtils.isNotBlank(dto.getZoneCode()) && !dto.getZoneCode().equals("由系统自动生成")) { |
|||
WmsWarehouseZone zone = baseMapper.checkForInsert(dto.getZoneCode(), dto.getWarehouseSid()); |
|||
if (null != zone) { |
|||
return rb.setMsg("同一个仓库下的区域编码不能重复。"); |
|||
} |
|||
} else { |
|||
WmsWarehouseInfo warehouseInfo = warehouseInfoService.fetchBySid(dto.getWarehouseSid()); |
|||
if (null != warehouseInfo) { |
|||
String warehouseCode = warehouseInfo.getWarehouseCode(); |
|||
int i = baseMapper.selectNum(warehouseCode); |
|||
String code = Rule.getBillNo3(warehouseCode, i); |
|||
entity.setZoneCode(code); |
|||
} |
|||
} |
|||
baseMapper.insert(entity); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean<WmsWarehouseZoneInitVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WmsWarehouseZoneInitVo vo = baseMapper.initialization(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WmsWarehouseZone wmsWarehouseZone = fetchBySid(sid); |
|||
if (null != wmsWarehouseZone) { |
|||
baseMapper.deleteById(wmsWarehouseZone.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public void delAll(String[] sids) { |
|||
int count = baseMapper.updateBySidIsDelete(Arrays.stream(sids).collect(Collectors.toList())); |
|||
} |
|||
|
|||
public ResultBean updateIsEnable(String sid, String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WmsWarehouseZone wmsWarehouseZone = fetchBySid(sid); |
|||
if (null != wmsWarehouseZone) { |
|||
wmsWarehouseZone.setIsEnable(Integer.parseInt(isEnable)); |
|||
baseMapper.updateById(wmsWarehouseZone); |
|||
} |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
|
|||
public List<WmsWarehouseZoneAllVo> selectAll(String ckSid) { |
|||
return baseMapper.selectAll(ckSid); |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.wms.biz.base.wmswarehousezone; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/9/14 14:24 |
|||
*/ |
|||
@Data |
|||
public class WmsWarehouseZoneVo implements Vo { |
|||
|
|||
private String sid; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String isDelete; |
|||
private String zoneName;//区域名称
|
|||
private String zoneCode;//区域编码
|
|||
private String volume;//区域面积
|
|||
private String unit;//计量单位
|
|||
private String warehouseName;//仓库名称
|
|||
} |
Loading…
Reference in new issue