8/14 工位管理
							parent
							
								
									3499764f8a
								
							
						
					
					
						commit
						07a15df433
					
				| @ -0,0 +1,77 @@ | ||||
| import axios from "@/utils/request"; | ||||
| 
 | ||||
| 
 | ||||
| export function getCollectPoints(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/getList", | ||||
|     method: "get", | ||||
|     params: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| export function addCollectPoint(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/addCollectPoint", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function updateCollectPoint(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/updateCollectPoint", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| export function delCollectPoint(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/delCollectPoint", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| export function getUsers(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/getUsers", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| //树的数据 后期在加一个js
 | ||||
| export function getTree(query) { | ||||
|   return axios({ | ||||
|     url: "udiwms/basic/collectPoint/category/getTree", | ||||
|     method: "get", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function addTree(query) { | ||||
|   return axios({ | ||||
|     url: "udiwms/basic/collectPoint/category/addTree", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| export function deleteTree(query) { | ||||
|   return axios({ | ||||
|     url: "udiwms/basic/collectPoint/category/deleteTree", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,36 @@ | ||||
| import axios from "@/utils/request"; | ||||
| 
 | ||||
| 
 | ||||
| export function getCollectBusType(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectBusType/getList", | ||||
|     method: "get", | ||||
|     params: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function addCollectBusType(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/addCollectBusType", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export function updateCollectBusType(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/updateCollectBusType", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| export function delCollectBusType(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/basic/collectPoints/delCollectBusType", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| import axios from "@/utils/request"; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| export function getUsers(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/sysWorkplace/getUsers", | ||||
|     method: "post", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| export function getUserBindWork(query) { | ||||
|   return axios({ | ||||
|     url: "/udiwms/sysWorkplace/getUserBindWork", | ||||
|     method: "get", | ||||
|     data: query | ||||
|   }); | ||||
| } | ||||
| @ -0,0 +1,607 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-card> | ||||
|       <el-row type="flex"> | ||||
|       <el-col style="flex: 1" v-show="Dictionary"> | ||||
|         <el-col v-if="showSearch" style="min-width: 300px; max-width: 100%"> | ||||
|           <el-tree | ||||
|             :data="treeList" | ||||
|             class="tree" | ||||
|             :default-expand-all="true" | ||||
|             @node-click="handleNodeClick" | ||||
|             :expand-on-click-node="false" | ||||
|             highlight-current | ||||
|           > | ||||
|               <span class="custom-tree-node" slot-scope="{ node, data }"> | ||||
|                 <span style="font-size: 14px; font-weight: 500">{{ | ||||
|                     node.label | ||||
|                   }}</span> | ||||
|                   <el-button | ||||
|                     type="text" | ||||
|                     size="mini" | ||||
|                     style="margin-left: 10px" | ||||
|                     :disabled="data.parentCode != null" | ||||
|                     @click="() => append(data,'add')"> | ||||
|                   新增 | ||||
|                 </el-button> | ||||
|                 <el-button | ||||
|                   type="text" | ||||
|                   size="mini" | ||||
|                   :disabled="data.parentCode == null" | ||||
|                   @click="() => append(data, 'edit')"> | ||||
|             编辑 | ||||
|           </el-button> | ||||
|           <el-button | ||||
|             type="text" | ||||
|             size="mini" | ||||
|             :disabled="data.parentCode == null" | ||||
|             @click="delTree(data)"> | ||||
|             删除 | ||||
|           </el-button> | ||||
| 
 | ||||
|               </span | ||||
|               > | ||||
|           </el-tree> | ||||
|         </el-col> | ||||
|       </el-col> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           @click="Dictionary = !Dictionary" | ||||
|           icon="el-icon-arrow-left" | ||||
|           v-show="Dictionary" | ||||
|           class="iconButton" | ||||
|         > | ||||
|         </el-button> | ||||
|         <el-button | ||||
|           type="success" | ||||
|           @click="Dictionary = !Dictionary" | ||||
|           icon="el-icon-arrow-right" | ||||
|           v-show="!Dictionary" | ||||
|           class="iconButton" | ||||
|         > | ||||
|         </el-button> | ||||
|       <el-col style="border-left: 3px solid #dddddd; overflow-y: hidden"> | ||||
|       <el-form :model="query" label-width="auto" v-show="showSearch" size="mini" class="order-el-form"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="当前仓库:" class="query-form-item"> | ||||
|               <invSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="编码/名称:" class="query-form-item"> | ||||
|               <el-input v-model="query.key" placeholder="请输入编号/采集点名称" clearable> | ||||
|               </el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div class="top-right-btn"> | ||||
|         <el-button-group> | ||||
|           <el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button> | ||||
|           <el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button> | ||||
|           <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> | ||||
|           <el-button type="primary" icon="el-icon-plus" @click="addCollectionPoints">新增采集点</el-button> | ||||
|         </el-button-group> | ||||
|       </div> | ||||
|       <el-table v-loading="loading" :data="list" style="width: 100%" :row-style="{height: '32px' }"  @current-change="handCurrentChange" highlight-current-row | ||||
|       > | ||||
|         <el-table-column type="index" label="序号"></el-table-column> | ||||
|         <el-table-column label="采集点编号" prop="code"></el-table-column> | ||||
|         <el-table-column label="采集点名称" prop="name"></el-table-column> | ||||
|         <!--<el-table-column label="采集点负责人" prop="employeeName"></el-table-column>--> | ||||
|         <el-table-column label="单据类型" prop="busType"></el-table-column> | ||||
|         <el-table-column label="扫码方式" prop="scanType"> | ||||
|           <template slot-scope="scope"> | ||||
|             {{ scanTypeEnum[scope.row.scanType].desc }} | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="备注" prop="remark"></el-table-column> | ||||
|         <el-table-column label="操作" fixed="right" width="100"> | ||||
|           <template slot-scope="scope"> | ||||
|             <!--<el-button--> | ||||
|             <!--  type="text"--> | ||||
|             <!--  size="small"--> | ||||
|             <!--  @click.native.stop="printLabel(scope.row)"--> | ||||
|             <!-->打印--> | ||||
|             <!--</el-button>--> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="editCollectionPoints(scope.row)" | ||||
|             >编辑 | ||||
|             </el-button> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="deleteCollectionPoints(scope.row)" | ||||
|             >删除 | ||||
|             </el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|       </el-col> | ||||
|       </el-row> | ||||
|     </el-card> | ||||
|     <el-dialog | ||||
|       :title="fromMap[fromName]" | ||||
|       :visible.sync="addCollectionPointsDialogVisible" | ||||
|       width="40%" | ||||
|       v-if="addCollectionPointsDialogVisible" | ||||
|       :close-on-click-modal="false" | ||||
|       :close-on-press-escape="false" | ||||
|     > | ||||
|       <el-form :model="formData" style="width: 80%;" ref="dataForm" :rules="formRules" | ||||
|                label-width="auto" | ||||
|       > | ||||
|         <el-row :gutter="20" class="el-row"> | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="采集点编号:" prop="code" class="query-form-item"> | ||||
|               <el-input | ||||
|                 v-model="formData.code" style="width: 80%" | ||||
|                 auto-complete="off" | ||||
|               ></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="采集点名称:" prop="name" class="query-form-item"> | ||||
|               <el-input | ||||
|                 v-model="formData.name" style="width: 80%" | ||||
|                 auto-complete="off" | ||||
|               ></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="所属仓库:" prop="busType" class="query-form-item"> | ||||
|               <el-select v-model="formData.invCode" placeholder="请选择所属仓库" | ||||
|                          style="width: 80%" | ||||
|                          clearable | ||||
|                          @change="handleInvChange" | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="item in invList" | ||||
|                   :key="item.name" | ||||
|                   :label="item.name" | ||||
|                   :value="item.code"> | ||||
|                   <span style="float: left">{{ item.name }}</span> | ||||
|                 </el-option> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <!--<el-col :span="24" class="el-col">--> | ||||
|           <!--  <el-form-item label="采集点负责人:" prop="chargeUser" class="query-form-item">--> | ||||
|           <!--    <el-select v-model="formData.chargeUser" placeholder="请选择所属仓库"--> | ||||
|           <!--               style="width: 80%"--> | ||||
|           <!--               clearable--> | ||||
|           <!--    >--> | ||||
|           <!--      <el-option--> | ||||
|           <!--        v-for="item in users"--> | ||||
|           <!--        :key="item.id"--> | ||||
|           <!--        :label="item.employeeName"--> | ||||
|           <!--        :value="item.id">--> | ||||
|           <!--        <span style="float: left">{{ item.employeeName }}</span>--> | ||||
|           <!--      </el-option>--> | ||||
|           <!--    </el-select>--> | ||||
|           <!--    <!–<el-input–>--> | ||||
|           <!--    <!–  v-model="formData.chargeUser" style="width: 80%"–>--> | ||||
|           <!--    <!–  auto-complete="off"–>--> | ||||
|           <!--    <!–></el-input>–>--> | ||||
|           <!--  </el-form-item>--> | ||||
|           <!--</el-col>--> | ||||
| 
 | ||||
|           <!--<el-col :span="24" class="el-col">--> | ||||
|           <!--  <el-form-item label="所属仓库:" prop="invCode" class="query-form-item">--> | ||||
|           <!--    <invSelect :value.sync="formData.invCode" :params.sync="filterBadInv" @change="handleInvChange"--> | ||||
|           <!--               style="width: 80%"--> | ||||
|           <!--    />--> | ||||
|           <!--  </el-form-item>--> | ||||
|           <!--</el-col>--> | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="单据类型:" prop="busType" class="query-form-item"> | ||||
|               <el-select v-model="formData.busType" placeholder="请选择单据类型" | ||||
|                          style="width: 80%" | ||||
|                          clearable | ||||
|               > | ||||
|                 <el-option | ||||
|                   v-for="item in busTypes" | ||||
|                   :key="item.name" | ||||
|                   :label="item.name" | ||||
|                   :value="item.code" | ||||
|                 > | ||||
|                   <span style="float: left">{{ item.name }}</span> | ||||
|                 </el-option> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
| 
 | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="扫码方式:" prop="scanType" class="query-form-item"> | ||||
|               <el-select v-model="formData.scanType" style="width: 80%" placeholder="选择扫码方式" clearable> | ||||
|                 <el-option label="三期校验" :value="1"></el-option> | ||||
|                 <el-option label="无三期校验" :value="2"></el-option> | ||||
|                 <el-option label="扫码结果" :value="3"></el-option> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
| 
 | ||||
|           <el-col :span="24" class="el-col"> | ||||
|             <el-form-item label="备注:" prop="remark" class="query-form-item"> | ||||
|               <el-input | ||||
|                 v-model="formData.remark" style="width: 80%" | ||||
|                 auto-complete="off" | ||||
|               ></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
| 
 | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div slot="footer" class="dialog-footer"> | ||||
|         <el-button @click.native="hideForm">取消</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           @click.native="formSubmit()" | ||||
|         >提交 | ||||
|         </el-button | ||||
|         > | ||||
|       </div> | ||||
|     </el-dialog> | ||||
| 
 | ||||
|     <el-dialog | ||||
|       :title="formMap[formName]" | ||||
|       append-to-body | ||||
|       :close-on-click-modal="false" | ||||
|       :close-on-press-escape="false" | ||||
|       :visible.sync="subFormVisible" | ||||
|       width="60%" | ||||
|       top="5vh" | ||||
|     > | ||||
|       <el-form :model="subData" ref="dataForm"  label-width="80px"> | ||||
|         <el-row :gutter="20" class="el-row" type="flex"> | ||||
|           <el-col :span="12" class="el-col"> | ||||
|             <el-form-item label="上级菜单" prop="parentCode"> | ||||
|                 <el-select v-model="subData.parentCode" placeholder="选择上级菜单" | ||||
|                            style="width: 80%" | ||||
|                            clearable | ||||
|                            disabled | ||||
|                 > | ||||
|                   <el-option | ||||
|                     v-for="item in fromDeptOptions" | ||||
|                     :key="item.parentCode" | ||||
|                     :label="item.parentName" | ||||
|                     :value="item.parentCode"> | ||||
|                     <span style="float: left">{{ item.parentName }}</span> | ||||
|                   </el-option> | ||||
|                 </el-select> | ||||
| 
 | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="12" class="el-col"> | ||||
|             <el-form-item label="名称" prop="name" class="query-form-item"> | ||||
|               <el-input | ||||
|                 v-model="subData.name" style="width: 80%" | ||||
|                 placeholder="请输入名称" | ||||
|                 auto-complete="off" | ||||
|               ></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|         <el-row class="el-row" type="flex"> | ||||
|           <el-col class="el-col"> | ||||
|             <el-form-item label="备注:" prop="remark" class="query-form-item"> | ||||
|               <el-input | ||||
|                 v-model="subData.remark" | ||||
|                 type="textarea" | ||||
|                 style="width: 90%" | ||||
|                 auto-complete="off" | ||||
|               ></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div slot="footer" class="dialog-footer"> | ||||
|         <el-button @click.native="hideForm">取消</el-button> | ||||
|         <el-button | ||||
|           type="primary" | ||||
|           @click.native="forInvSubmit()" | ||||
|           :loading="subLoading" | ||||
|         >提交 | ||||
|         </el-button | ||||
|         > | ||||
|       </div> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { | ||||
|   getCollectPoints, | ||||
|   addCollectPoint, | ||||
|   updateCollectPoint, | ||||
|   delCollectPoint, | ||||
|   getUsers, getTree, addTree, deleteTree | ||||
| } from '@/api/basic/collectPoint/collectPointManage' | ||||
| import { getBusTypeList, getLocalJoinByUser } from '@/api/basic/busType' | ||||
| import {getCollectBusType} from "@/api/basic/collectPoint/gatherOrderType" | ||||
| import { getInvListByUser } from '@/api/system/invWarehouse' | ||||
| 
 | ||||
| 
 | ||||
| export default { | ||||
| 
 | ||||
|   data() { | ||||
|     return { | ||||
|       query: { | ||||
|         invCode: this.$store.getters.locInvCode, | ||||
|         page: 1, | ||||
|         limit: 10 | ||||
|       }, | ||||
|       showSearch: true, | ||||
|       Dictionary: true, | ||||
|       filterBadInv: true, | ||||
|       loading: false, | ||||
|       list: [], | ||||
|       fromName: 'add', | ||||
|       fromMap: { | ||||
|         'add': '新增采集点', | ||||
|         'edit': '编辑采集点' | ||||
|       }, | ||||
|       formName: 'add', | ||||
|       formMap: { | ||||
|         add: "新增", | ||||
|         edit: "编辑" | ||||
|       }, | ||||
|       addCollectionPointsDialogVisible: false, | ||||
|       adduserDialogVisible: false, | ||||
|       subFormVisible: false, | ||||
|       fromDeptOptions: [], | ||||
|       subData: {}, | ||||
|       formData: {}, | ||||
|       total: 0, | ||||
|       busTypes: [], | ||||
|       invList: [], | ||||
|       users: [], | ||||
|       formRules: { | ||||
|         code: [ | ||||
|           { required: true, message: '请输入采集点编号', trigger: 'blur' } | ||||
|         ], | ||||
|         name: [ | ||||
|           { required: true, message: '请输入采集点名称', trigger: 'blur' } | ||||
|         ], | ||||
|         busType: [ | ||||
|           { required: true, message: '请选择单据类型', trigger: 'blur' } | ||||
|         ] | ||||
|       }, | ||||
|       scanTypeEnum: { | ||||
|         1: { key: 1, desc: '三期校验' }, | ||||
|         2: { key: 2, desc: '无三期校验' }, | ||||
|         3: { key: 3, desc: '扫码结果' } | ||||
|       }, | ||||
|       invQuery : { | ||||
|         code : '' | ||||
|       }, | ||||
|       currentRow: { | ||||
|         name: "采集点", | ||||
|         code: null | ||||
|       }, | ||||
|       userQuery: {}, | ||||
|       treeList:[] | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     hideSearch() { | ||||
|       this.showSearch = !this.showSearch | ||||
|     }, | ||||
|     onReset() { | ||||
|       this.$router.push({ | ||||
|         path: '' | ||||
|       }) | ||||
|       this.query = { | ||||
|         page: 1, | ||||
|         limit: 10, | ||||
|         invCode: this.$store.getters.locInvCode | ||||
|       } | ||||
|       this.getList() | ||||
|     }, | ||||
|     onSubmit() { | ||||
|       this.query.page = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|     addCollectionPoints() { | ||||
|       this.formData = {} | ||||
|       this.fromName = 'add' | ||||
|       this.addCollectionPointsDialogVisible = true | ||||
|     }, | ||||
|     getList() { | ||||
|       this.loading = true | ||||
|       getCollectPoints(this.query).then((response) => { | ||||
|         if (response.code == 20000) { | ||||
|           this.list = response.data.list || [] | ||||
|           this.total = response.data.total || 0 | ||||
|         } else { | ||||
|           this.$message.error(response.message) | ||||
|         } | ||||
|         this.loading = false | ||||
|       }) | ||||
|         .catch(() => { | ||||
|           this.loading = false | ||||
|           this.list = [] | ||||
|           this.total = 0 | ||||
|         }) | ||||
|     }, | ||||
|     getBusType() { | ||||
|       let query = { | ||||
|         page: 1, | ||||
|         limit: 10 | ||||
|       } | ||||
|       getCollectBusType(query) | ||||
|         .then((response) => { | ||||
|           this.busTypes = response.data.list || [] | ||||
|           // this.filterQuery.action = this.busTypes[0].action; | ||||
|           // this.getList(); | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     getInvList() { | ||||
|       let query = { | ||||
|         advanceType: 1, | ||||
|       }; | ||||
|       getInvListByUser(query) | ||||
|         .then((response) => { | ||||
|           this.invList = response.data || []; | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }); | ||||
|     }, | ||||
|     hideForm() { | ||||
|       this.addCollectionPointsDialogVisible = false | ||||
|       this.subFormVisible = false | ||||
|     }, | ||||
|     formSubmit() { | ||||
|       if (this.fromName == 'add') { | ||||
|         this.$refs['dataForm'].validate((valid) => { | ||||
|           if (!valid) { | ||||
|             return this.$message.error('请完善采集点信息!') | ||||
|           } | ||||
|           addCollectPoint(this.formData).then(res => { | ||||
|             if (res.code == 20000) { | ||||
|               this.$message.success('新增成功') | ||||
|               this.addCollectionPointsDialogVisible = false | ||||
|               this.getList() | ||||
|             } else { | ||||
|               this.$message.error('新增失败') | ||||
|             } | ||||
|           }).catch(() => { | ||||
|           }) | ||||
|         }) | ||||
|       } else { | ||||
|         updateCollectPoint(this.formData).then(res => { | ||||
|           if (res.code == 20000) { | ||||
|             this.$message.success('更新成功') | ||||
|             this.addCollectionPointsDialogVisible = false | ||||
|             this.getList() | ||||
|           } else { | ||||
|             this.$message.error('更新失败') | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     editCollectionPoints(row) { | ||||
|       this.fromName = 'edit' | ||||
|       this.formData = row | ||||
|       // const user = this.users.find(user => user.id === row.chargeUser); | ||||
|       this.handleInvChange(row.invCode) | ||||
|       this.addCollectionPointsDialogVisible = true | ||||
|     }, | ||||
|     deleteCollectionPoints(row) { | ||||
|       this.$confirm('此操作将永久删除该采集点, 是否继续?', '提示', { | ||||
|         confirmButtonText: '确定', | ||||
|         cancelButtonText: '取消', | ||||
|         type: 'warning' | ||||
|       }).then(() => { | ||||
|         delCollectPoint(row).then(res => { | ||||
|           if (res.code == 20000) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.getList() | ||||
|           } | ||||
|         }).catch(() => { | ||||
| 
 | ||||
|         }) | ||||
|       }) | ||||
|     }, | ||||
|     handleInvChange(invCode){ | ||||
|       this.invQuery.code = invCode | ||||
|       getUsers( this.invQuery).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           this.users = res.data || [] | ||||
|         }else { | ||||
|           this.$message.error("错误") | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     append(data, formName) {//新增 编辑 | ||||
|       this.formName = formName; | ||||
|       if (formName === "edit") { | ||||
|         this.subData = JSON.parse(JSON.stringify(data)); | ||||
|         this.subData.name = JSON.parse(JSON.stringify(data.label)); | ||||
|       } else if (formName === "add") { | ||||
|         this.subData = { | ||||
|           parentCode: JSON.parse(JSON.stringify(data)).code | ||||
|         }; | ||||
|         let parentData = { | ||||
|           parentCode: JSON.parse(JSON.stringify(data)).code, | ||||
|           parentName: JSON.parse(JSON.stringify(data.label)) | ||||
|         } | ||||
|         this.fromDeptOptions.push(parentData) | ||||
|       } | ||||
|       this.subFormVisible = true; | ||||
|     }, | ||||
|     forInvSubmit(){ | ||||
|       addTree(this.subData).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           this.subFormVisible = false | ||||
|           this.getTree() | ||||
|           this.$message.success("成功") | ||||
|         }else { | ||||
|           this.$message.error(res.message) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     delTree(row){ | ||||
|       deleteTree(row).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           this.getTree() | ||||
|           this.$message.success("删除成功") | ||||
|         }else { | ||||
|           this.$message.error("删除失败") | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handCurrentChange(row){ | ||||
|       this.currentRow.name = row.name | ||||
|       this.currentRow.code = row.code | ||||
|     }, | ||||
|     addUser(){ | ||||
|       if (this.currentRow.code == null){ | ||||
|         return this.$message.error("请选择采集点!") | ||||
|       } | ||||
|       getUsers(this.currentRow).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           this.users = res.data || [] | ||||
|         }else { | ||||
|           this.$message.error("错误") | ||||
|         } | ||||
|       }) | ||||
|       this.adduserDialogVisible = true | ||||
|     }, | ||||
|     getTree(){ | ||||
|       getTree(this.query) | ||||
|         .then((response) => { | ||||
|           var invlist = response.data || []; | ||||
|           this.treeList = this.handleTree(invlist, "code", "parentCode"); | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }); | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getList() | ||||
|     this.getBusType() | ||||
|     this.getInvList() | ||||
|     this.getTree() | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| .dialog-footer { | ||||
|   display: flex; /* 使用Flexbox布局 */ | ||||
|   justify-content: center; /* 水平居中 */ | ||||
|   align-items: center; /* 垂直居中 */ | ||||
| } | ||||
| 
 | ||||
| .iconButton { | ||||
|   margin-left: 0px; | ||||
|   height: 30px; | ||||
| } | ||||
| </style> | ||||
| @ -0,0 +1,336 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <el-card> | ||||
|       <el-form :model="query" label-width="auto" v-show="showSearch" size="mini" class="order-el-form"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="当前仓库:" class="query-form-item"> | ||||
|               <invSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="编码/名称:" class="query-form-item"> | ||||
|               <el-input v-model="query.key" placeholder="请输入单据编号/单据名称" clearable> | ||||
|               </el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
| 
 | ||||
| 
 | ||||
|       <div class="top-right-btn"> | ||||
|         <el-button-group> | ||||
|           <el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button> | ||||
|           <el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button> | ||||
|           <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> | ||||
|           <el-button type="primary" icon="el-icon-plus" @click="addCollectionPoints">新增单据类型</el-button> | ||||
|         </el-button-group> | ||||
|       </div> | ||||
| 
 | ||||
| 
 | ||||
|       <el-table v-loading="loading" :data="list" style="width: 100%" :row-style="{height: '32px' }" | ||||
|       > | ||||
|         <el-table-column type="index" label="序号"></el-table-column> | ||||
|         <el-table-column label="单据类型编号" prop="code"></el-table-column> | ||||
|         <el-table-column label="单据类型名称" prop="name"></el-table-column> | ||||
|         <el-table-column label="出入库类型" prop="mainAction"> | ||||
|           <template slot-scope="scope"> | ||||
|             <span>{{ mainActions[scope.row.mainAction] }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="是否内部单据" prop="innerOrder"> | ||||
|           <template slot-scope="scope"> | ||||
|             <span>{{ innerOrderMap[scope.row.innerOrder] }}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="来源系统" prop="fromType"></el-table-column> | ||||
|         <el-table-column label="备注" prop="remark"></el-table-column> | ||||
|         <el-table-column label="操作" fixed="right" width="100"> | ||||
|           <template slot-scope="scope"> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="editCollectionPoints(scope.row)" | ||||
|             >编辑 | ||||
|             </el-button> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="deleteCollectionPoints(scope.row)" | ||||
|             >删除 | ||||
|             </el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
| 
 | ||||
|       <el-dialog | ||||
|         :title="fromMap[fromName]" | ||||
|         :visible.sync="addCollectionPointsDialogVisible" | ||||
|         width="40%" | ||||
|         v-if="addCollectionPointsDialogVisible" | ||||
|         :close-on-click-modal="false" | ||||
|         :close-on-press-escape="false" | ||||
|       > | ||||
|         <el-form :model="formData" style="width: 80%;" ref="dataForm" :rules="formRules" | ||||
|                  label-width="auto" | ||||
|         > | ||||
|           <el-row :gutter="20" class="el-row"> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="单据类型编号:" prop="code" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   placeholder="请输入单据类型编号" | ||||
|                   v-model="formData.code" style="width: 80%" | ||||
|                   auto-complete="off" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="单据类型名称:" prop="name" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   placeholder="请输入单据类型名称" | ||||
|                   v-model="formData.name" style="width: 80%" | ||||
|                   auto-complete="off" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="出入库类型:" prop="mainAction" class="query-form-item"> | ||||
|                 <el-select v-model="formData.mainAction" style="width: 80%" placeholder="请选择出入库类型" clearable> | ||||
|                   <el-option label="出库" :value="mainActionMap.out"></el-option> | ||||
|                   <el-option label="入库" :value="mainActionMap.in"></el-option> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="是否内单据:" prop="innerOrder" class="query-form-item"> | ||||
|                 <el-select v-model="formData.innerOrder" style="width: 80%" placeholder="请选择" clearable> | ||||
|                   <el-option label="否" :value="0"></el-option> | ||||
|                   <el-option label="是" :value="1"></el-option> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="来源系统:" prop="name" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   placeholder="请输入来源系统" | ||||
|                   v-model="formData.fromType" style="width: 80%" | ||||
|                   auto-complete="off" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
| 
 | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="所属仓库:" prop="invCode" class="query-form-item"> | ||||
|                 <invSelect :value.sync="formData.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange" | ||||
|                            style="width: 80%" | ||||
|                 /> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="24" class="el-col"> | ||||
|               <el-form-item label="备注:" prop="remark" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   v-model="formData.remark" style="width: 80%" | ||||
|                   auto-complete="off" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
| 
 | ||||
|           </el-row> | ||||
|         </el-form> | ||||
|         <div slot="footer" class="dialog-footer"> | ||||
|           <el-button @click.native="hideForm">取消</el-button> | ||||
|           <el-button | ||||
|             type="primary" | ||||
|             @click.native="formSubmit()" | ||||
|           >提交 | ||||
|           </el-button | ||||
|           > | ||||
|         </div> | ||||
|       </el-dialog> | ||||
|     </el-card> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { | ||||
|   getCollectBusType, | ||||
|   addCollectBusType, | ||||
|   updateCollectBusType, | ||||
|   delCollectBusType | ||||
| } from '@/api/basic/collectPoint/gatherOrderType' | ||||
| import { getBusTypeList } from '@/api/basic/busType' | ||||
| 
 | ||||
| export default { | ||||
|   data() { | ||||
|     return { | ||||
|       query: { | ||||
|         invCode: this.$store.getters.locInvCode, | ||||
|         page: 1, | ||||
|         limit: 10 | ||||
|       }, | ||||
|       showSearch: true, | ||||
|       filterBadInv: true, | ||||
|       loading: false, | ||||
|       list: [], | ||||
|       fromName: 'add', | ||||
|       fromMap: { | ||||
|         'add': '新增单据类型', | ||||
|         'edit': '编辑单据类型' | ||||
|       }, | ||||
|       addCollectionPointsDialogVisible: false, | ||||
|       formData: {}, | ||||
|       total: 0, | ||||
|       busTypes: [], | ||||
|       formRules: { | ||||
|         code: [ | ||||
|           { required: true, message: '请输入采集点编号', trigger: 'blur' } | ||||
|         ], | ||||
|         name: [ | ||||
|           { required: true, message: '请输入采集点名称', trigger: 'blur' } | ||||
|         ], | ||||
|         fromType: [ | ||||
|           { required: true, message: '请选择来源', trigger: 'blur' } | ||||
|         ], | ||||
|         invCode: [ | ||||
|           { required: true, message: '请选择单据所属仓库', trigger: 'blur' } | ||||
|         ] | ||||
|       }, | ||||
|       mainActions: { | ||||
|         WareHouseIn: '入库', | ||||
|         WareHouseOut: '出库' | ||||
|       }, | ||||
|       innerOrderMap: { | ||||
|         1: '是', | ||||
|         2: '否' | ||||
|       }, | ||||
|       mainActionMap: { | ||||
|         in: 'WareHouseIn', | ||||
|         out: 'WareHouseOut' | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     hideSearch() { | ||||
|       this.showSearch = !this.showSearch | ||||
|     }, | ||||
|     onReset() { | ||||
|       this.$router.push({ | ||||
|         path: '' | ||||
|       }) | ||||
|       this.query = { | ||||
|         page: 1, | ||||
|         limit: 10, | ||||
|         invCode: this.$store.getters.locInvCode | ||||
|       } | ||||
|       this.getList() | ||||
|     }, | ||||
|     onSubmit() { | ||||
|       this.query.page = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|     addCollectionPoints() { | ||||
|       this.formData = {} | ||||
|       this.fromName = 'add' | ||||
|       this.addCollectionPointsDialogVisible = true | ||||
|     }, | ||||
|     getList() { | ||||
|       this.loading = true | ||||
|       getCollectBusType(this.query).then((response) => { | ||||
|         if (response.code == 20000) { | ||||
|           this.list = response.data.list || [] | ||||
|           this.total = response.data.total || 0 | ||||
|         } else { | ||||
|           this.$message.error(response.message) | ||||
|         } | ||||
|         this.loading = false | ||||
|       }) | ||||
|         .catch(() => { | ||||
|           this.loading = false | ||||
|           this.list = [] | ||||
|           this.total = 0 | ||||
|         }) | ||||
|     }, | ||||
|     getBusType() { | ||||
|       let query = { | ||||
|         enabled: true, | ||||
|         page: 1, | ||||
|         limit: 10 | ||||
|       } | ||||
|       getBusTypeList(query) | ||||
|         .then((response) => { | ||||
|           this.busTypes = response.data.list || [] | ||||
|           // this.filterQuery.action = this.busTypes[0].action; | ||||
|           // this.getList(); | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     hideForm() { | ||||
|       this.addCollectionPointsDialogVisible = false | ||||
|     }, | ||||
|     formSubmit() { | ||||
|       if (this.fromName == 'add') { | ||||
|         this.$refs['dataForm'].validate((valid) => { | ||||
|           if (!valid) { | ||||
|             return this.$message.error('请完善单据信息!') | ||||
|           } | ||||
|           addCollectBusType(this.formData).then(res => { | ||||
|             if (res.code == 20000) { | ||||
|               this.$message.success('新增成功') | ||||
|               this.addCollectionPointsDialogVisible = false | ||||
|               this.getList() | ||||
|             } else { | ||||
|               this.$message.error('新增失败') | ||||
|             } | ||||
|           }).catch(() => { | ||||
|           }) | ||||
|         }) | ||||
|       } else { | ||||
|         updateCollectBusType(this.formData).then(res => { | ||||
|           if (res.code == 20000) { | ||||
|             this.$message.success('更新成功') | ||||
|             this.addCollectionPointsDialogVisible = false | ||||
|             this.getList() | ||||
|           } else { | ||||
|             this.$message.error('更新失败') | ||||
|           } | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     editCollectionPoints(row) { | ||||
|       this.fromName = 'edit' | ||||
|       this.formData = row | ||||
|       this.addCollectionPointsDialogVisible = true | ||||
|     }, | ||||
|     deleteCollectionPoints(row) { | ||||
|       this.$confirm('此操作将永久删除该采集点, 是否继续?', '提示', { | ||||
|         confirmButtonText: '确定', | ||||
|         cancelButtonText: '取消', | ||||
|         type: 'warning' | ||||
|       }).then(() => { | ||||
|         delCollectBusType(row).then(res => { | ||||
|           if (res.code == 20000) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.getList() | ||||
|           } | ||||
|         }).catch(() => { | ||||
| 
 | ||||
|         }) | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getList() | ||||
|     this.getBusType() | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| .dialog-footer { | ||||
|   display: flex; /* 使用Flexbox布局 */ | ||||
|   justify-content: center; /* 水平居中 */ | ||||
|   align-items: center; /* 垂直居中 */ | ||||
| } | ||||
| </style> | ||||
| @ -0,0 +1,368 @@ | ||||
| <template> | ||||
|   <div> | ||||
|       <el-form :model="query" label-width="auto" v-show="showSearch" size="mini" class="order-el-form"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="当前仓库:" class="query-form-item"> | ||||
|               <invSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="编码/名称:" class="query-form-item"> | ||||
|               <el-input v-model="query.key" placeholder="请输入编码/工位名称" clearable> | ||||
|               </el-input> | ||||
|               <!--<el-form-item label="所属仓库:">--> | ||||
| 
 | ||||
|               <!--              :isDisable.sync="defaultInv"--> | ||||
|               <!--</el-form-item>--> | ||||
|               <!--<el-select--> | ||||
|               <!--  v-model="query.key"--> | ||||
|               <!--  placeholder="请选择仓库">--> | ||||
|               <!--  <el-option v-for="item in unitStorageList"--> | ||||
|               <!--             :key="item.name"--> | ||||
|               <!--             :label="item.name"--> | ||||
|               <!--             :value="item.code"></el-option>--> | ||||
|               <!--</el-select>--> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|       <div class="top-right-btn"> | ||||
|         <el-button-group> | ||||
|           <el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button> | ||||
|           <el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button> | ||||
|           <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> | ||||
|           <el-button type="primary" icon="el-icon-search" @click="">选入</el-button> | ||||
|         </el-button-group> | ||||
|       </div> | ||||
|       <el-table v-loading="loading" :data="list" style="width: 100%" :row-style="{height: '32px' }" highlight-current-row @current-change="handCurrentChange" | ||||
|       > | ||||
|         <el-table-column label width="45"> | ||||
|           <template slot-scope="scope"> | ||||
|             <el-radio :label="scope.row.workplaceId" v-model="radioCheck"><span></span></el-radio> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column type="index" label="序号"></el-table-column> | ||||
|         <el-table-column label="工位编码" prop="workplaceId" width="90"></el-table-column> | ||||
|         <el-table-column label="工位名称" prop="workplaceName" width="90"></el-table-column> | ||||
|         <el-table-column label="所属组别" prop="categoryName" width="90"></el-table-column> | ||||
|         <el-table-column label="来源单据类型编号" prop="busTypeCode" width="150"></el-table-column> | ||||
|         <el-table-column label="来源单据类型名称" prop="busTypeName" width="150"></el-table-column> | ||||
|         <el-table-column label="所属仓库" prop="invName" width="90"></el-table-column> | ||||
|         <el-table-column label="作业方式" prop="operationType" width="90"> | ||||
|           <template slot-scope="scope"> | ||||
|             <span>{{operationTypes[scope.row.operationType]}}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="结果处理(是否插入)" prop="checkInsert" width="150"> | ||||
|           <template slot-scope="scope"> | ||||
|             <span>{{checkInserts[scope.row.checkInsert]}}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="提醒方式" prop="warnType" width="90"> | ||||
|           <template slot-scope="scope"> | ||||
|             <span>{{warnTypeMap[scope.row.warnType]}}</span> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|         <el-table-column label="负责人" prop="employeeName" width="90"></el-table-column> | ||||
|         <el-table-column label="往来单位标题" prop="unitTittle" width="90"></el-table-column> | ||||
|         <el-table-column label="创建时间" prop="createTime" width="90"></el-table-column> | ||||
|         <el-table-column label="备注" prop="remake" width="90"></el-table-column> | ||||
|         <el-table-column label="操作" fixed="right" width="50"> | ||||
|           <template slot-scope="scope"> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|             >详情 | ||||
|             </el-button> | ||||
|             <!--@click.native.stop="printLabel(scope.row)"--> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { | ||||
|   listPage, | ||||
|   addWorkplace, | ||||
|   updateWorkplace, | ||||
|   deleteWorkplace, | ||||
|   createWorkplaceId, printWorkLabel,getUsers | ||||
| } from '@/api/basic/sysWorkplaceManage' | ||||
| import { getInvListByUser } from '@/api/system/invWarehouse' | ||||
| import { getTree } from '@/api/basic/collectPoint/collectPointManage' | ||||
| import { getCollectBusType } from '@/api/basic/collectPoint/gatherOrderType' | ||||
| import panelGroup from '@/views/dashboard/PanelGroup' | ||||
| 
 | ||||
| export default { | ||||
|   data() { | ||||
|     return { | ||||
|       query: { | ||||
|         invCode: this.$store.getters.locInvCode, | ||||
|         page: 1, | ||||
|         limit: 20, | ||||
|         code: null | ||||
|       }, | ||||
|       showSearch: true, | ||||
|       Dictionary: true, | ||||
|       loading: false, | ||||
|       list: [], | ||||
|       treeList: [], | ||||
|       addWorkplaceDialogVisible: false, | ||||
|       fromName: 'add', | ||||
|       fromMap: { | ||||
|         'add': '新增工位', | ||||
|         'edit': '编辑工位' | ||||
|       }, | ||||
|       formData: {}, | ||||
|       workplaceCode: '6001', | ||||
|       unitStorageList: [], | ||||
|       invList: [], | ||||
|       fromDeptOptions: [], | ||||
|       filterBadInv: true, | ||||
|       formRules: { | ||||
|         workplaceName: [ | ||||
|           { required: true, message: '请输入工位名称', trigger: 'blur' } | ||||
|         ], | ||||
|         invCode: [ | ||||
|           { required: true, message: '请选择仓库', trigger: 'blur' } | ||||
|         ] | ||||
|       }, | ||||
|       invQuery: { | ||||
|         code: '' | ||||
|       }, | ||||
|       users: [], | ||||
|       busTypes: [], | ||||
|       operationTypes: { | ||||
|         1: '扫码生成业务单(必须插入)', | ||||
|         2: '按单校验三期(是否插入可选)', | ||||
|         3: '按单不校验三期(是否插入可选)' | ||||
|       }, | ||||
|       checkInserts: { | ||||
|         1: '不插入', | ||||
|         2: '插入', | ||||
|       }, | ||||
|       warnTypeMap: { | ||||
|         1: '信息提醒', | ||||
|         2: '禁止录入', | ||||
|       }, | ||||
|       radioCheck: '' | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     hideSearch() { | ||||
|       this.showSearch = !this.showSearch | ||||
|     }, | ||||
|     onSubmit() { | ||||
|       this.query.page = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|     onReset() { | ||||
|       this.$router.push({ | ||||
|         path: '' | ||||
|       }) | ||||
|       this.query = { | ||||
|         page: 1, | ||||
|         limit: 20 | ||||
|       } | ||||
|       this.getList() | ||||
|     }, | ||||
|     getList() { | ||||
|       listPage(this.query).then(res => { | ||||
|         if (res.code != 20000) { | ||||
|           return this.$message.error('错误错误') | ||||
|         } | ||||
|         this.list = res.data.list || [] | ||||
|       }) | ||||
|     }, | ||||
|     addWorkplace() { | ||||
|       this.fromName = 'add' | ||||
|       createWorkplaceId().then(res => { | ||||
|         if (res.code == 20000) { | ||||
|           if (res.data == null) { | ||||
|             this.formData.workplaceId = this.workplaceCode + 1001 | ||||
|             this.addWorkplaceDialogVisible = true | ||||
|           } else { | ||||
|             this.formData = {} | ||||
|             this.formData.workplaceId = res.data | ||||
|             this.addWorkplaceDialogVisible = true | ||||
|           } | ||||
|         } else { | ||||
|           this.$message.error('获取错误') | ||||
|         } | ||||
|       }).catch(() => { | ||||
|         this.$message.error('获取错误') | ||||
|       }) | ||||
|     }, | ||||
|     hideForm() { | ||||
|       this.addWorkplaceDialogVisible = false | ||||
|     }, | ||||
|     invChange(invCode) { | ||||
|       this.filterQuery.invCode = invCode | ||||
|       this.getFromStorage() | ||||
|     }, | ||||
|     getFromStorage() { | ||||
|       let query = {} | ||||
|       filterFromAllByUser(query) | ||||
|         .then((response) => { | ||||
|           this.unitStorageList = response.data || [] | ||||
|           console.log(this.filterQuery.invCode) | ||||
|           if (this.filterQuery.invCode) { | ||||
|             this.unitStorageList = this.unitStorageList.filter(item => item.code != this.filterQuery.invCode) || [] | ||||
|           } | ||||
|           console.log(this.unitStorageList) | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     formSubmit() { | ||||
|       if (this.fromName == 'add') { | ||||
|         this.$refs['dataForm'].validate((valid) => { | ||||
|           if (!valid) { | ||||
|             this.$message.error('请完善必填信息') | ||||
|           } else { | ||||
|             addWorkplace(this.formData).then(res => { | ||||
|               if (res.code != 20000) { | ||||
|                 return this.$message.error('新增错误') | ||||
|               } | ||||
|               this.addWorkplaceDialogVisible = false | ||||
|               this.$message.success(res.data) | ||||
|               this.getList() | ||||
|             }).catch(() => { | ||||
|               this.addWorkplaceDialogVisible = false | ||||
|               this.$message.error('新增错误') | ||||
|             }) | ||||
|           } | ||||
|         }) | ||||
|       } else { | ||||
|         updateWorkplace(this.formData).then(res => { | ||||
|           if (res.code != 20000) { | ||||
|             return this.$message.error('更新错误') | ||||
|           } | ||||
|           this.addWorkplaceDialogVisible = false | ||||
|           this.$message.success(res.data) | ||||
|           this.getList() | ||||
|         }).catch(() => { | ||||
|           this.addWorkplaceDialogVisible = false | ||||
|           this.$message.error('更新错误') | ||||
|         }) | ||||
|       } | ||||
| 
 | ||||
|     }, | ||||
|     edit(row) { | ||||
|       this.formData = row | ||||
|       this.fromName = 'edit' | ||||
|       this.addWorkplaceDialogVisible = true | ||||
|     }, | ||||
|     deleteWorkplace(row) { | ||||
|       this.$confirm('此操作将永久删除该工位, 是否继续?', '提示', { | ||||
|         confirmButtonText: '确定', | ||||
|         cancelButtonText: '取消', | ||||
|         type: 'warning' | ||||
|       }).then(() => { | ||||
|         deleteWorkplace(row).then(res => { | ||||
|           if (res.code != 20000) { | ||||
|             this.$message.error('删除错误') | ||||
|           } else { | ||||
|             this.$message.success(res.data) | ||||
|             this.getList() | ||||
|           } | ||||
|         }) | ||||
|       }).catch(() => { | ||||
| 
 | ||||
|       }) | ||||
|     }, | ||||
|     getInvList() { | ||||
|       let query = { | ||||
|         advanceType: 1 | ||||
|       } | ||||
|       getInvListByUser(query) | ||||
|         .then((response) => { | ||||
|           this.invList = response.data || [] | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     handleInvChange(invCode) { | ||||
|       this.invQuery.code = invCode | ||||
|       getUsers(this.invQuery).then(res => { | ||||
|         if (res.code == 20000) { | ||||
|           this.users = res.data || [] | ||||
|         } else { | ||||
|           this.$message.error('错误') | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     printLabel(row) { | ||||
|       row.labelId = 5 | ||||
|       printWorkLabel(row).then((response) => { | ||||
|         const binaryData = [] | ||||
|         binaryData.push(response) | ||||
|         let url = window.URL.createObjectURL( | ||||
|           new Blob(binaryData, { type: 'application/pdf' }) | ||||
|         ) | ||||
|         this.loading = false | ||||
|         window.open(url) | ||||
|       }).catch(() => { | ||||
|         this.loading = false | ||||
|       }) | ||||
|     }, | ||||
|     getLstTree(){ | ||||
|       getTree(this.query) | ||||
|         .then((response) => { | ||||
|           var invlist = response.data || []; | ||||
|           this.treeList = this.handleTree(invlist, "code", "parentCode"); | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }); | ||||
|     }, | ||||
|     getBusType() { | ||||
|       let query = { | ||||
|         page: 1, | ||||
|         limit: 10 | ||||
|       } | ||||
|       getCollectBusType(query) | ||||
|         .then((response) => { | ||||
|           this.busTypes = response.data.list || [] | ||||
|           // this.filterQuery.action = this.busTypes[0].action; | ||||
|           // this.getList(); | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     getTree() { | ||||
|       getTree(this.query) | ||||
|         .then((response) => { | ||||
|           var treeList = response.data || [] | ||||
|           const filteredList = treeList.filter(item => item.parentCode != null) | ||||
|           this.fromDeptOptions = filteredList | ||||
|           console.log('jjsjsjsj', this.fromDeptOptions) | ||||
|         }) | ||||
|         .catch(() => { | ||||
|         }) | ||||
|     }, | ||||
|     handCurrentChange(row){ | ||||
|       this.radioCheck = row.workplaceId | ||||
|     }, | ||||
|     handleNodeClick(row){ | ||||
|       this.query.code = row.code | ||||
|       this.getList() | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getList() | ||||
|     this.getInvList() | ||||
|     this.getBusType() | ||||
|     this.getTree() | ||||
|     this.getLstTree() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| .iconButton { | ||||
|   margin-left: 0px; | ||||
|   height: 30px; | ||||
| } | ||||
| </style> | ||||
| @ -0,0 +1,252 @@ | ||||
| <template> | ||||
| <div> | ||||
|   <el-card> | ||||
|     <div> | ||||
| 
 | ||||
|       <el-form :model="userQuery" label-width="auto" v-show="showSearch" size="mini" class="order-el-form"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="当前仓库:" class="query-form-item"> | ||||
|               <invSelect :value.sync="userQuery.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="账号/名称:" class="query-form-item"> | ||||
|               <el-input v-model="userQuery.key" placeholder="请输入账号/名称" clearable> | ||||
|               </el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
| 
 | ||||
|       <div class="top-right-btn"> | ||||
|         <el-button-group> | ||||
|           <el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button> | ||||
|           <el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button> | ||||
|           <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> | ||||
|         </el-button-group> | ||||
|       </div> | ||||
|       <el-table v-loading="loading" :data="userList" style="width: 100%" :row-style="{height: '32px' }"  @current-change="handCurrentChange" highlight-current-row | ||||
|       > | ||||
|         <el-table-column type="index" label="序号"></el-table-column> | ||||
|         <el-table-column label="用户账号" prop="userName"></el-table-column> | ||||
|         <el-table-column label="用名称" prop="employeeName"></el-table-column> | ||||
|         <el-table-column label="备注" prop="remark"></el-table-column> | ||||
|         <el-table-column label="操作" fixed="right" width="100"> | ||||
|           <template slot-scope="scope"> | ||||
|             <!--<el-button--> | ||||
|             <!--  type="text"--> | ||||
|             <!--  size="small"--> | ||||
|             <!--  @click.native.stop="printLabel(scope.row)"--> | ||||
|             <!-->打印--> | ||||
|             <!--</el-button>--> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="editCollectionPoints(scope.row)" | ||||
|             >编辑 | ||||
|             </el-button> | ||||
|             <el-button | ||||
|               type="text" | ||||
|               size="small" | ||||
|               @click.native.stop="deleteCollectionPoints(scope.row)" | ||||
|             >删除 | ||||
|             </el-button> | ||||
|           </template> | ||||
|         </el-table-column> | ||||
|       </el-table> | ||||
| 
 | ||||
|     </div> | ||||
|   </el-card> | ||||
|   <el-tabs type="border-card" style="margin: 15px"> | ||||
|     <el-tab-pane> | ||||
|       <span slot="label">{{ rowData.employeeName }}-工位列表</span> | ||||
|       <el-form :inline="true" :model="workQuery" class="query-form" size="mini"> | ||||
|         <el-form-item class="query-form-item" label="工位编码/工位名称:"> | ||||
|           <el-input | ||||
|             v-model="workQuery.key" | ||||
|             placeholder="请输入工位编码/名称" | ||||
|             clearable | ||||
|           ></el-input> | ||||
|         </el-form-item> | ||||
|         <el-form-item> | ||||
|           <el-button-group> | ||||
|             <el-button | ||||
|               type="primary" | ||||
|               icon="el-icon-refresh" | ||||
|               @click="onUserReset" | ||||
|             >重置 | ||||
|             </el-button> | ||||
|             <el-button type="primary" @click="loadWorkList" | ||||
|                        icon="el-icon-search" | ||||
|             >查询 | ||||
|             </el-button | ||||
|             > | ||||
|             <el-button type="primary" @click="addWork()" | ||||
|                        icon="el-icon-document-add" | ||||
|             >选入工位 | ||||
|             </el-button | ||||
|             > | ||||
|           </el-button-group> | ||||
|         </el-form-item> | ||||
|       </el-form> | ||||
|     </el-tab-pane> | ||||
|   </el-tabs> | ||||
| 
 | ||||
|   <el-dialog | ||||
|     title="选入工位" | ||||
|     :visible.sync="selectUserWorkDialogVisible" | ||||
|     width="70%" | ||||
|     v-if="selectUserWorkDialogVisible" | ||||
|     :close-on-click-modal="false" | ||||
|     :close-on-press-escape="false" | ||||
|   > | ||||
|     <selectWorkplace> | ||||
| 
 | ||||
|     </selectWorkplace> | ||||
|   </el-dialog> | ||||
|   <!--<el-card>--> | ||||
|   <!--  <el-form :model="query" label-width="auto" v-show="showSearch1" size="mini" class="order-el-form">--> | ||||
|   <!--    <el-row :gutter="20">--> | ||||
|   <!--      <el-col :span="8">--> | ||||
|   <!--        <el-form-item label="当前仓库:" class="query-form-item">--> | ||||
|   <!--          <invSelect :value.sync="query.invCode" :params.sync="filterBadInv" :changeValue.sync="invChange"/>--> | ||||
|   <!--        </el-form-item>--> | ||||
|   <!--      </el-col>--> | ||||
|   <!--      <el-col :span="8">--> | ||||
|   <!--        <el-form-item label="编码/名称:" class="query-form-item">--> | ||||
|   <!--          <el-input v-model="query.key" placeholder="请输入编号/采集点名称" clearable>--> | ||||
|   <!--          </el-input>--> | ||||
|   <!--        </el-form-item>--> | ||||
|   <!--      </el-col>--> | ||||
|   <!--    </el-row>--> | ||||
|   <!--  </el-form>--> | ||||
|   <!--  <el-table v-loading="loading" :data="collectPointList" style="width: 100%" :row-style="{height: '32px' }"--> | ||||
|   <!--  >--> | ||||
|   <!--    <el-table-column type="index" label="序号"></el-table-column>--> | ||||
|   <!--    <el-table-column label="采集点编号" prop="code"></el-table-column>--> | ||||
|   <!--    <el-table-column label="采集点名称" prop="name"></el-table-column>--> | ||||
|   <!--    <!–<el-table-column label="采集点负责人" prop="employeeName"></el-table-column>–>--> | ||||
|   <!--    <el-table-column label="单据类型" prop="busType"></el-table-column>--> | ||||
|   <!--    <el-table-column label="扫码方式" prop="scanType">--> | ||||
|   <!--      <template slot-scope="scope">--> | ||||
|   <!--        {{ scanTypeEnum[scope.row.scanType].desc }}--> | ||||
|   <!--      </template>--> | ||||
|   <!--    </el-table-column>--> | ||||
|   <!--    <el-table-column label="备注" prop="remark"></el-table-column>--> | ||||
|   <!--    <el-table-column label="操作" fixed="right" width="100">--> | ||||
|   <!--      <template slot-scope="scope">--> | ||||
|   <!--        <!–<el-button–>--> | ||||
|   <!--        <!–  type="text"–>--> | ||||
|   <!--        <!–  size="small"–>--> | ||||
|   <!--        <!–  @click.native.stop="printLabel(scope.row)"–>--> | ||||
|   <!--        <!–>打印–>--> | ||||
|   <!--        <!–</el-button>–>--> | ||||
|   <!--        <el-button--> | ||||
|   <!--          type="text"--> | ||||
|   <!--          size="small"--> | ||||
|   <!--          @click.native.stop="editCollectionPoints(scope.row)"--> | ||||
|   <!--        >编辑--> | ||||
|   <!--        </el-button>--> | ||||
|   <!--        <el-button--> | ||||
|   <!--          type="text"--> | ||||
|   <!--          size="small"--> | ||||
|   <!--          @click.native.stop="deleteCollectionPoints(scope.row)"--> | ||||
|   <!--        >删除--> | ||||
|   <!--        </el-button>--> | ||||
|   <!--      </template>--> | ||||
|   <!--    </el-table-column>--> | ||||
|   <!--  </el-table>--> | ||||
|   <!--</el-card>--> | ||||
| </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| import { getUserBindWork, getUsers } from '@/api/basic/collectPoint/userWorkplace' | ||||
| import  selectWorkplace from "./selectWorkplace" | ||||
| 
 | ||||
| 
 | ||||
| export default { | ||||
|   components: {selectWorkplace}, | ||||
|   data() { | ||||
|     return{ | ||||
|       loading:false, | ||||
|       showSearch:true, | ||||
|       filterBadInv: true, | ||||
|       list:[], | ||||
|       collectPointList:[], | ||||
|       query: {}, | ||||
|       userList: [], | ||||
|       rowData: { | ||||
|         employeeName: '用户' | ||||
|       }, | ||||
|       userQuery: { | ||||
|         invCode: this.$store.getters.locInvCode, | ||||
|       }, | ||||
|       workQuery: {}, | ||||
|       selectUserWorkDialogVisible: false | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     hideSearch() { | ||||
|       this.showSearch = !this.showSearch | ||||
|     }, | ||||
|     onReset() { | ||||
|       this.$router.push({ | ||||
|         path: '' | ||||
|       }) | ||||
|       this.userQuery = { | ||||
|         invCode: this.$store.getters.locInvCode | ||||
|       } | ||||
|       this.getUsers() | ||||
|     }, | ||||
|     onSubmit() { | ||||
|       this.query.page = 1 | ||||
|       this.getUsers() | ||||
|     }, | ||||
|     onUserReset(){ | ||||
|       this.workQuery = {} | ||||
|     }, | ||||
|     loadWorkList(){ | ||||
|       // if (this.rowData.id == null){ | ||||
|       //   return this.$message.error("请先选择用户") | ||||
|       // } | ||||
|     }, | ||||
|     getUsers(){ | ||||
|       getUsers(this.userQuery).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           this.userList = res.data || [] | ||||
|         }else  { | ||||
|           this.$message.error("获取错误") | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     handCurrentChange(row){ | ||||
|       this.rowData = row | ||||
|       let query = { | ||||
|         userId : row.id | ||||
|       } | ||||
|       getUserBindWork(query).then(res => { | ||||
|         if (res.code == 20000){ | ||||
|           console.log("djjddjdjdjd",res.data) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     addWork(){ | ||||
|       if (this.rowData.id == null){ | ||||
|         return this.$message.error("请先选择用户") | ||||
|       } | ||||
|       this.selectUserWorkDialogVisible = true | ||||
| 
 | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getUsers() | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| 
 | ||||
| </style> | ||||
					Loading…
					
					
				
		Reference in New Issue