md
This commit is contained in:
parent
59cd81779b
commit
8212551754
234
src/views/oms/EmisBaseTools/CustomerPrivEmpSimplePicker.vue
Normal file
234
src/views/oms/EmisBaseTools/CustomerPrivEmpSimplePicker.vue
Normal file
@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div :id="createdId">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
trigger="click"
|
||||
ref="popoverRef"
|
||||
:popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }"
|
||||
>
|
||||
<div >
|
||||
<el-table
|
||||
ref="comboGridTable"
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
:data="optionItems"
|
||||
@row-click="onRowClick"
|
||||
:row-key="row => row.empCode"
|
||||
stripe
|
||||
:row-style="isRed"
|
||||
element-loading-text="Loading"
|
||||
>
|
||||
<el-table-column label="员工编号" align="left" prop="empCode" width="100" />
|
||||
<el-table-column label="员工名称" align="center" prop="empName" width="100" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<el-pagination v-show="pagination" small
|
||||
:total="total"
|
||||
:page-size="5"
|
||||
layout="prev, pager, next, total"
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-input
|
||||
slot="reference"
|
||||
ref="inputValue"
|
||||
:value="slable"
|
||||
:placeholder="placeholder"
|
||||
@input="onInput"
|
||||
@click.native="onClick"
|
||||
@blur="onBlur"
|
||||
@clear="onClear"
|
||||
clearable
|
||||
>
|
||||
<template slot="suffix">
|
||||
<!-- <i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i> -->
|
||||
<i slot="suffix" class="el-icon-search"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
</el-popover>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import { listBindSalesmen } from "@/api/oms/emisWaybill";
|
||||
|
||||
export default {
|
||||
name: "EmisUserSimplePicker",
|
||||
mixins: [emitter],
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
sideCode: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
postCode:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
placeholder:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
disabled:{
|
||||
type: [Boolean,String],
|
||||
required: false
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean, default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
createdId: '0',
|
||||
loading:false,
|
||||
|
||||
total:0,
|
||||
optionItems: [],
|
||||
|
||||
// 缺省值
|
||||
defaultTotal:0,
|
||||
defaultItems:null,
|
||||
|
||||
svalue: this.value,
|
||||
slable: null,
|
||||
|
||||
isInputing: false,
|
||||
|
||||
isInit:true,
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:5,
|
||||
empCode:null,
|
||||
searchValue:null,
|
||||
ownerSiteCode:this.sideCode,
|
||||
postCode:this.postCode
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal,oldVal) {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
siteCode(newVal){
|
||||
this.queryParams.ownerSiteCode=newVal;
|
||||
this.defaultItems=null;
|
||||
},
|
||||
postCode(newVal){
|
||||
this.queryParams.postCode=newVal;
|
||||
this.defaultItems=null;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 给个随机id 判断是否clickoutside
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
this.isInit=false;
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryParams.pageNum=1;
|
||||
this.queryData(null,null);
|
||||
}else{
|
||||
this.total = this.defaultTotal;
|
||||
this.optionItems = [...this.defaultItems];
|
||||
}
|
||||
// this.$refs.popoverRef.doShow();
|
||||
},
|
||||
onInput(val) {
|
||||
if(val == null ) return;
|
||||
|
||||
this.isInputing = true;
|
||||
this.slable = val;
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryData(val,null)
|
||||
|
||||
},
|
||||
onRowClick(row, column, event) {
|
||||
this.svalue=row.empCode;
|
||||
this.slable=row.empName;
|
||||
|
||||
this.isInputing = false;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange",row);
|
||||
this.$refs.popoverRef.doClose();
|
||||
},
|
||||
isRed({ row }) {
|
||||
if (row.empCode == this.svalue) {
|
||||
return {
|
||||
"color": "red",
|
||||
"font-weight": "bold",
|
||||
};
|
||||
}
|
||||
},
|
||||
onClear(el){
|
||||
this.slable = null;
|
||||
this.svalue = null;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
onBlur(el) {
|
||||
// 如果编辑没有选择则清关历史记录
|
||||
if( this.isInputing ){
|
||||
this.svalue = null;
|
||||
this.slable = null;
|
||||
}
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
},
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
|
||||
this.queryParams.searchValue = val;
|
||||
this.queryParams.empCode = key;
|
||||
|
||||
listBindSalesmen(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.total = response.total;
|
||||
this.optionItems = response.rows;
|
||||
|
||||
// 初始值存储
|
||||
if(key==null && val==null){
|
||||
this.defaultTotal = this.total+0;
|
||||
this.defaultItems=[...this.optionItems]
|
||||
}
|
||||
|
||||
if(!this.isInputing ){
|
||||
let selectItem = response.rows.find(item => item.empCode == this.svalue);
|
||||
if(selectItem){
|
||||
this.slable = selectItem.empName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
213
src/views/oms/EmisBaseTools/GoodsInput.vue
Normal file
213
src/views/oms/EmisBaseTools/GoodsInput.vue
Normal file
@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<div :id="createdId">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
trigger="click"
|
||||
ref="popoverRef"
|
||||
:popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }"
|
||||
>
|
||||
<div >
|
||||
<el-table
|
||||
ref="comboGridTable"
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
:data="optionItems"
|
||||
@row-click="onRowClick"
|
||||
:row-key="row => row.goodsCode"
|
||||
stripe
|
||||
:row-style="isRed"
|
||||
element-loading-text="Loading"
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span v-text="getIndex(scope.$index)"> </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货物名称" align="left" prop="goodsName" width="100" />
|
||||
<el-table-column label="英文名称" align="center" prop="goodsNameEn" width="100" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<el-pagination v-show="pagination" small
|
||||
:total="total"
|
||||
:page-size="5"
|
||||
layout="prev, pager, next, total"
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-input
|
||||
slot="reference"
|
||||
ref="inputValue"
|
||||
:value="slable"
|
||||
:placeholder="placeholder"
|
||||
@input="onInput"
|
||||
@click.native="onClick"
|
||||
@blur="onBlur"
|
||||
@clear="onClear"
|
||||
clearable
|
||||
>
|
||||
<template slot="suffix">
|
||||
<i slot="suffix" class="el-icon-edit"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
</el-popover>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import { listSimpleEmisGoods} from "@/api/oms/emisGoods";
|
||||
|
||||
export default {
|
||||
name: "GoodsInput",
|
||||
mixins: [emitter],
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
sideCode: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
postCode:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
placeholder:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
disabled:{
|
||||
type: [Boolean,String],
|
||||
required: false
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean, default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
createdId: '0',
|
||||
loading:false,
|
||||
|
||||
total:0,
|
||||
optionItems: [],
|
||||
|
||||
// 缺省值
|
||||
defaultTotal:0,
|
||||
defaultItems:null,
|
||||
|
||||
svalue: this.value,
|
||||
slable: null,
|
||||
|
||||
isInputing: false,
|
||||
|
||||
isInit:true,
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:5,
|
||||
goodsName:null,
|
||||
searchValue:null,
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal,oldVal) {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// 给个随机id 判断是否clickoutside
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
this.isInit=false;
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryParams.pageNum=1;
|
||||
this.queryData(null,null);
|
||||
}else{
|
||||
this.total = this.defaultTotal;
|
||||
this.optionItems = [...this.defaultItems];
|
||||
}
|
||||
// this.$refs.popoverRef.doShow();
|
||||
},
|
||||
onInput(val) {
|
||||
if(val == null ) return;
|
||||
|
||||
this.isInputing = true;
|
||||
this.slable = val;
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryData(val,null)
|
||||
|
||||
},
|
||||
onRowClick(row, column, event) {
|
||||
this.svalue=row.goodsName;
|
||||
this.slable=row.goodsName;
|
||||
|
||||
this.isInputing = false;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange",row);
|
||||
this.$refs.popoverRef.doClose();
|
||||
},
|
||||
isRed({ row }) {
|
||||
if (row.goodsName == this.svalue) {
|
||||
return {
|
||||
"color": "red",
|
||||
"font-weight": "bold",
|
||||
};
|
||||
}
|
||||
},
|
||||
onClear(el){
|
||||
this.slable = null;
|
||||
this.svalue = null;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
onBlur(el) {
|
||||
// 如果编辑没有选择则清关历史记录
|
||||
if( this.isInputing ){
|
||||
this.svalue = null;
|
||||
this.slable = null;
|
||||
}
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
},
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
this.queryParams.goodsName = val;
|
||||
|
||||
listSimpleEmisGoods(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.total = response.total;
|
||||
this.optionItems = response.rows;
|
||||
|
||||
});
|
||||
},
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
160
src/views/oms/EmisBaseTools/GoodsTablePicker.vue
Normal file
160
src/views/oms/EmisBaseTools/GoodsTablePicker.vue
Normal file
@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<div :id="createdId">
|
||||
<el-popover
|
||||
trigger="click"
|
||||
ref="popoverRef"
|
||||
>
|
||||
<!-- :popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }" -->
|
||||
<!-- placement="bottom" -->
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
type="text"
|
||||
> {{ $t('从商品库选择') }}</el-button>
|
||||
<div >
|
||||
<search-form :model="queryParams" ref="queryForm" size="mini" :maxShow="3" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||||
<el-form-item label="" prop="goodsName" >
|
||||
<el-input
|
||||
v-model="queryParams.goodsName"
|
||||
:placeholder="$t('商品名称')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
@input="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</search-form>
|
||||
|
||||
<xd-table v-loading="loading"
|
||||
size="mini"
|
||||
:data="tableDataList"
|
||||
:showSearch.sync="showSearch"
|
||||
:queryParams="queryParams"
|
||||
:total="total"
|
||||
:showPagination="false"
|
||||
:showOperateButton="false"
|
||||
@queryTable="getList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange"
|
||||
|
||||
@row-click="onRowClick"
|
||||
>
|
||||
<!-- style="overflow:auto;height:400px;" -->
|
||||
<el-table-column label="序号" align="center" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span v-text="getIndex(scope.$index)"> </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('货物名称')" align="left" prop="goodsName" min-width="150" />
|
||||
<el-table-column :label="$t('英文名称')" align="left" prop="goodsNameEn" min-width="150" />
|
||||
|
||||
</xd-table>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSimpleEmisGoods} from "@/api/oms/emisGoods";
|
||||
|
||||
export default {
|
||||
name: "GoodsSimplePicker",
|
||||
props:{
|
||||
},
|
||||
components: { },
|
||||
dicts: [
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
createdId: '0',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 创建时间搜索
|
||||
dateTimeRange:[],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户收寄件地址表格数据
|
||||
tableDataList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
goodsName:null,
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// 给个随机id 判断是否clickoutside
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询客户收寄件地址列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSimpleEmisGoods(this.queryParams).then(response => {
|
||||
this.tableDataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||||
handleSortChange(column) {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
onRowClick(row, column, event) {
|
||||
this.isInputing = false;
|
||||
this.$emit('input', row.goodsName)
|
||||
this.$emit('onChange', [row],row.goodsName)
|
||||
this.$refs.popoverRef.doClose();
|
||||
},
|
||||
/** 列索引函数 */
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider{
|
||||
margin-top: 0px;
|
||||
background: 0 0;
|
||||
border-top: 1px solid #E6EBF5;
|
||||
}
|
||||
.el-divider__text {
|
||||
color: #0955ee;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
220
src/views/oms/EmisBaseTools/WarehouseSimplePicker.vue
Normal file
220
src/views/oms/EmisBaseTools/WarehouseSimplePicker.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div :id="createdId">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
trigger="click"
|
||||
ref="popoverRef"
|
||||
:popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }"
|
||||
>
|
||||
<div >
|
||||
<el-table
|
||||
ref="comboGridTable"
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
:data="optionItems"
|
||||
@row-click="onRowClick"
|
||||
:row-key="row => row.code"
|
||||
stripe
|
||||
:row-style="isRed"
|
||||
element-loading-text="Loading"
|
||||
>
|
||||
<!-- <el-table-column label="仓库编号" align="left" prop="code" width="100" /> -->
|
||||
<el-table-column label="仓库" align="left" prop="name" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="联系人" align="center" prop="contact" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="联系电话" align="center" prop="tel" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="仓库地址" align="left" prop="address" width="200" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<el-pagination v-show="pagination" small
|
||||
:total="total"
|
||||
:page-size="5"
|
||||
layout="prev, pager, next, total"
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-input
|
||||
slot="reference"
|
||||
ref="inputValue"
|
||||
:value="slable"
|
||||
:placeholder="placeholder"
|
||||
@input="onInput"
|
||||
@click.native="onClick"
|
||||
@blur="onBlur"
|
||||
@clear="onClear"
|
||||
clearable
|
||||
>
|
||||
<template slot="suffix">
|
||||
<!-- <i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i> -->
|
||||
<i slot="suffix" class="el-icon-search"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
</el-popover>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import { listWmsWarehouse } from "@/api/oms/emisWaybill";
|
||||
|
||||
export default {
|
||||
name: "WarehouseSimplePicker",
|
||||
mixins: [emitter],
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
placeholder:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
disabled:{
|
||||
type: [Boolean,String],
|
||||
required: false
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean, default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
createdId: '0',
|
||||
loading:false,
|
||||
|
||||
total:0,
|
||||
optionItems: [],
|
||||
|
||||
// 缺省值
|
||||
defaultTotal:0,
|
||||
defaultItems:null,
|
||||
|
||||
svalue: this.value,
|
||||
slable: null,
|
||||
|
||||
isInputing: false,
|
||||
|
||||
isInit:true,
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:5,
|
||||
code:null,
|
||||
searchValue:null,
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal,oldVal) {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// 给个随机id 判断是否clickoutside
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
if(this.value!=null && this.isInit){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
this.isInit=false;
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryParams.pageNum=1;
|
||||
this.queryData(null,null);
|
||||
}else{
|
||||
this.total = this.defaultTotal;
|
||||
this.optionItems = [...this.defaultItems];
|
||||
}
|
||||
// this.$refs.popoverRef.doShow();
|
||||
},
|
||||
onInput(val) {
|
||||
if(val == null ) return;
|
||||
|
||||
this.isInputing = true;
|
||||
this.slable = val;
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryData(val,null)
|
||||
|
||||
},
|
||||
onRowClick(row, column, event) {
|
||||
this.svalue=row.code;
|
||||
this.slable=row.name;
|
||||
|
||||
this.isInputing = false;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onChange",row);
|
||||
this.$refs.popoverRef.doClose();
|
||||
},
|
||||
isRed({ row }) {
|
||||
if (row.empCode == this.svalue) {
|
||||
return {
|
||||
"color": "red",
|
||||
"font-weight": "bold",
|
||||
};
|
||||
}
|
||||
},
|
||||
onClear(el){
|
||||
this.slable = null;
|
||||
this.svalue = null;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
onBlur(el) {
|
||||
// 如果编辑没有选择则清关历史记录
|
||||
if( this.isInputing ){
|
||||
this.svalue = null;
|
||||
this.slable = null;
|
||||
}
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
},
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
|
||||
this.queryParams.searchValue = val;
|
||||
this.queryParams.code = key;
|
||||
|
||||
listWmsWarehouse(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.total = response.total;
|
||||
this.optionItems = response.rows;
|
||||
|
||||
// 初始值存储
|
||||
if(key==null && val==null){
|
||||
this.defaultTotal = this.total+0;
|
||||
this.defaultItems=[...this.optionItems]
|
||||
}
|
||||
|
||||
if(!this.isInputing ){
|
||||
let selectItem = response.rows.find(item => item.name == this.svalue);
|
||||
if(selectItem){
|
||||
this.slable = selectItem.name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -210,7 +210,88 @@
|
||||
>
|
||||
|
||||
<div slot="toolbar">
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>取消订单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>确认</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>取消货物</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>异常反馈</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>再来一单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>下载进仓PDF</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>查看订单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@ -220,6 +301,7 @@
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user