Commit 1d6cc928 authored by 吴志坤's avatar 吴志坤

draw

parent 584b2985
import request from '@/utils/request'
import { id } from 'html-webpack-plugin/lib/chunksorter'
// 查询基础信息列表
export function listWbApply(query) {
return request({
......@@ -33,3 +34,11 @@ export function batchAddition(data) {
}
})
}
// 根据id查询基础信息接口
export function detail(id) {
return request({
url: '/wbapply/detail/' + id,
method: 'get'
})
}
......@@ -32,20 +32,22 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-select
v-model="queryParams.pstatus"
placeholder="请选择状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
<el-form-item label="状态" prop="pstatus">
<el-select
v-model="queryParams.pstatus"
placeholder="请选择状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
......@@ -187,7 +189,8 @@
</el-row>
</el-form>
<el-table v-loading="loadingDetail" border :data="detailApplyList" @selection-change="handleSelectionChange">
<!-- apply详情-->
<el-table v-if="applyStatus === '1'" v-loading="loadingDetail" border :data="applyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="50" />
<el-table-column label="pn" prop="pn">
......@@ -232,43 +235,41 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="totalDetail>0"
:total="totalDetail"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getDeviceList"
/>
<!-- <pagination-->
<!-- v-show="totalDetail>0"-->
<!-- :total="totalDetail"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.rows"-->
<!-- @pagination="getDeviceList"-->
<!-- />-->
</el-dialog>
<!-- TODO: 处理 -->
<el-dialog :title="title" :visible.sync="openHandle" width="1200px" append-to-body>
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form ref="queryFormWarehouse" style="padding: 0 0 0 10px" :model="queryParamsDetail" :inline="true">
<el-form-item label="pn" prop="pn">
<el-input
v-model="queryParams.pn"
v-model="queryParamsDetail.pn"
placeholder="请输入pn"
clearable
:maxlength="30"
size="small"
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="phd" prop="phdStr">
<el-form-item label="lot" prop="lot">
<el-input
v-model="queryParams.phdStr"
placeholder="请输入phd"
v-model="queryParamsDetail.lot"
placeholder="请输入lot"
clearable
size="small"
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="prank" prop="prankStr">
<el-form-item label="plocation" prop="plocation">
<el-input
v-model="queryParams.prankStr"
placeholder="请输入prank"
v-model="queryParamsDetail.plocation"
placeholder="请输入plocation"
clearable
size="small"
style="width: 150px"
......@@ -276,8 +277,8 @@
/>
</el-form-item>
<el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQueryDetail">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQueryDetail">重置</el-button>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQueryWarehouse">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQueryWarehouse">重置</el-button>
</el-form-item>
</el-form>
......@@ -344,13 +345,14 @@
</div>
</template>
<script>
import { listWbApply, deleteLogical, detailList, batchAddition } from '@/api/equipment/draw'
import { listWbApply, deleteLogical, detailList, batchAddition, detail } from '@/api/equipment/draw'
import { parseTime } from '@/utils'
import { title } from '@/settings'
export default {
name: 'Role',
data() {
return {
totalApplyDetail: 0,
applyList: [],
canceList: [],
applyId: '',
multipleSelection: [],
......@@ -432,7 +434,7 @@ export default {
ptype: 1,
delFlag: 0
},
// 查询apply_detail的参数
// 查询warehouse的参数
queryParamsDetail: {
page: 1,
rows: 10,
......@@ -448,7 +450,9 @@ export default {
children: 'children',
label: 'label'
},
deptOptions: []
deptOptions: [],
// 判断状态显示表单
applyStatus: ''
}
},
/** 路由离开前存储筛选条件*/
......@@ -474,6 +478,7 @@ export default {
},
methods: {
handleCance() {
this.loadingDetail = true
console.log('multipleSelection', this.multipleSelection)
if (this.multipleSelection.length === 0) {
this.$message.warning('请至少选择一个要处理的设备')
......@@ -495,14 +500,20 @@ export default {
})
console.log('canceList', this.canceList)
batchAddition(this.canceList).then(res => {
console.log('res',res)
console.log('res', res)
if (res.code === 200) {
this.loadingDetail = false
this.openHandle = false
this.$message.success('操作成功')
this.getList()
}
})
}
},
/** 查询apply_detail列表 */
/** 查询warehouse列表 */
getDeviceList() {
this.loadingDetail = true
detailList(this.queryParams).then(res => {
detailList(this.queryParamsDetail).then(res => {
res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.totalDetail = res.total
this.detailApplyList = res.rows
......@@ -523,11 +534,20 @@ export default {
},
// 获取所选行详情信息
handleDetail(row) {
const id = row.businessId
this.openDetails = true
this.singleDetails = row
this.title = '详情'
this.openDetails = !this.openDetails
detail(id).then(res => {
console.log('res', res)
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
// this.totalApplyDetail = res.total
this.applyList = res.data.wbApplyDetailList
this.applyStatus = res.data.pstatus
this.loadingDetail = false
})
},
/** 查询基础信息列表 */
/** 查询apply列表 */
getList() {
this.loading = true
listWbApply(this.queryParams).then(
......@@ -573,6 +593,11 @@ export default {
}
this.resetForm('form')
},
// warehouse查询
handleQueryWarehouse() {
this.queryParamsDetail.page = 1
this.getDeviceList()
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
......@@ -584,6 +609,11 @@ export default {
this.resetForm('queryForm')
this.handleQuery()
},
// warehouse的重置按钮
resetQueryWarehouse() {
this.resetForm('queryFormWarehouse')
this.handleQueryWarehouse()
},
// 多选框选中数据
handleSelectionChange: function(selection) {
this.multipleSelection = selection
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment