新增
This commit is contained in:
140
mes/qd/src/views/wms/pub/SuppDialog.vue
Normal file
140
mes/qd/src/views/wms/pub/SuppDialog.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="供应商选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="输入供应商编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="supp_code" label="供应商编码" />
|
||||
<el-table-column prop="supp_name" label="供应商名称 " />
|
||||
<el-table-column prop="corp_address" label="公司地址" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'DeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '供应商',
|
||||
optShow: {},
|
||||
url: 'api/supplierbase',
|
||||
idField: 'supp_id',
|
||||
sort: '',
|
||||
query: { device_code: '', workprocedure_id: '', is_produceuse: '' }
|
||||
})
|
||||
},
|
||||
dicts: ['IS_OR_NOT'],
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
workProcedureList: [],
|
||||
produceuseList: [],
|
||||
dialogVisible: false,
|
||||
checkrow: {},
|
||||
disablePro: true,
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 接受父组件传值
|
||||
* @param msg
|
||||
*/
|
||||
getMsg(msg, msg2) {
|
||||
this.disablePro = false
|
||||
this.crud.query.workprocedure_id = msg
|
||||
this.crud.query.is_produceuse = msg2
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选供应商')
|
||||
return
|
||||
}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.checkrow)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user