|
@@ -3,14 +3,16 @@
|
|
|
<module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList"
|
|
|
@resert="queryList" @search="queryList" />
|
|
|
<addUserModal ref="addUserModalView" @handle="handle" />
|
|
|
+ <UpdateStateModal ref="updateStateModalView" @stateHandle="stateHandle" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
-import addUserModal from ".addUserModal.vue"
|
|
|
+import addUserModal from "./addUserModal.vue"
|
|
|
import Cookies from 'js-cookie'
|
|
|
-@Component({components:{addUserModal}})
|
|
|
+import UpdateStateModal from "./updateStateModal.vue";
|
|
|
+@Component({components:{addUserModal, UpdateStateModal}})
|
|
|
export default class BatchList extends Vue {
|
|
|
load=false;
|
|
|
time:any;
|
|
@@ -28,20 +30,41 @@ export default class BatchList extends Vue {
|
|
|
columns:[
|
|
|
[{
|
|
|
label:'拣货员',
|
|
|
- prop:'shopName',
|
|
|
+ prop:'user01',
|
|
|
component:'by-input',
|
|
|
compConfig:{}
|
|
|
},{
|
|
|
label:'播种员',
|
|
|
- prop:'shortName',
|
|
|
+ prop:'user02',
|
|
|
component:'by-input',
|
|
|
compConfig:{}
|
|
|
},
|
|
|
{
|
|
|
label:'状态',
|
|
|
- prop:'shopStatus',
|
|
|
- component:'by-input',
|
|
|
- compConfig:{}
|
|
|
+ prop:'state',
|
|
|
+ component: 'by-select',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ placeholder: '请选择状态',
|
|
|
+ clearable: true,
|
|
|
+ data: [{
|
|
|
+ value: '等待拣货',
|
|
|
+ label: '等待拣货'
|
|
|
+ }, {
|
|
|
+ value: '正在拣货',
|
|
|
+ label: '正在拣货'
|
|
|
+ }, {
|
|
|
+ value: '正在播种',
|
|
|
+ label: '正在播种'
|
|
|
+ }, {
|
|
|
+ value: '等待出库验货',
|
|
|
+ label: '等待出库验货'
|
|
|
+ }, {
|
|
|
+ value: '终止拣货',
|
|
|
+ label: '终止拣货'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
}]
|
|
|
]
|
|
|
},
|
|
@@ -63,9 +86,9 @@ export default class BatchList extends Vue {
|
|
|
this.packHandle('2');
|
|
|
}
|
|
|
}},
|
|
|
- { name: '结束任务', event:{
|
|
|
+ { name: '修改状态', event:{
|
|
|
click:() =>{
|
|
|
-
|
|
|
+ this.stateUpdate()
|
|
|
}
|
|
|
}},
|
|
|
{ name: '打印订单', event:{
|
|
@@ -158,6 +181,7 @@ export default class BatchList extends Vue {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ Cookies.set('batchData', JSON.stringify(this.data));
|
|
|
}
|
|
|
//安排拣货员/播种员
|
|
|
packHandle(n:string) {
|
|
@@ -169,6 +193,27 @@ export default class BatchList extends Vue {
|
|
|
(this.$refs.addUserModalView as any).setShow(true);
|
|
|
(this.$refs.addUserModalView as any).setType(n);
|
|
|
}
|
|
|
+ stateHandle(v:string) {
|
|
|
+ let data = (this.$refs.view as any).getSelectData();
|
|
|
+ for (const item of data) {
|
|
|
+ for (const it of this.data) {
|
|
|
+ if(item.number == it.number) {
|
|
|
+ it.state = v
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Cookies.set('batchData', JSON.stringify(this.data));
|
|
|
+ }
|
|
|
+ //修改状态
|
|
|
+ stateUpdate() {
|
|
|
+ let data = (this.$refs.view as any).getSelectData();
|
|
|
+ if(data.length == 0) {
|
|
|
+ this.$message('请选择数据!');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ (this.$refs.updateStateModalView as any).setShow(true);
|
|
|
+ }
|
|
|
|
|
|
//分页
|
|
|
pagination(){
|
|
@@ -208,8 +253,26 @@ export default class BatchList extends Vue {
|
|
|
//列表请求(包含分页和搜素条件)
|
|
|
queryList(){
|
|
|
this.isSearch = true;
|
|
|
+ // let data = (this.$refs.view as any).getQuery();
|
|
|
+ // this.requestList(data);
|
|
|
+ let newData:Array<any> = []
|
|
|
let data = (this.$refs.view as any).getQuery();
|
|
|
- this.requestList(data);
|
|
|
+ for(const item of this.data) {
|
|
|
+ let isa = true
|
|
|
+ if(data.user01 && item.user01.indexOf(data.user01) === -1) {
|
|
|
+ isa = false
|
|
|
+ }
|
|
|
+ if(data.user02 && item.user02.indexOf(data.user02) === -1) {
|
|
|
+ isa = false
|
|
|
+ }
|
|
|
+ if(data.state && item.state.indexOf(data.state) === -1) {
|
|
|
+ isa = false
|
|
|
+ }
|
|
|
+ if(isa) {
|
|
|
+ newData.push(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ (this.$refs.view as any).setTableValue(newData);
|
|
|
}
|
|
|
requestList(data:any){
|
|
|
this.load = true;
|