| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <!-- 搜索表单 -->
- <template>
- <seekPage :seekList="seekList" @search="search"></seekPage>
- </template>
- <script>
- import { getUserPage } from '@/api/system/organization';
- import { basicAreaPageAPI } from '@/api/regionalManage';
- import work from '@/api/technology/work';
- import producetask from '@/api/technology/production';
- import { getteampage } from '@/api/workforceManagement/team';
- import {
- getFactoryarea
- } from '@/api/factoryModel';
- export default {
- components: {},
- props: {
- options_groupId: {
- type: Array,
- default() {
- return [];
- }
- },
- options_factory: {
- type: Array,
- default() {
- return [];
- }
- }
- },
- data() {
- return {
- workCenterList: [],
- areaTreeList: [],
- sourceTaskList: [],
- leaderIdList: [],
- teamList: [],
- factoryList: [],
- workshopPlanList: [],
- workshopList: []
- };
- },
- computed: {
- seekList() {
- return [
- {
- label: '工位编码:',
- value: 'code',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '所属区域:',
- value: 'areaId',
- type: 'selectTree',
- planList: this.areaTreeList,
- placeholder: '请选择'
- },
- {
- label: '工位名称:',
- value: 'name',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '所属工作中心:',
- value: 'workCenterId',
- labelWidth: '120px',
- type: 'select',
- planList: this.workCenterList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '工序:',
- value: 'sourceTaskId',
- type: 'select',
- planList: this.sourceTaskList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '负责人:',
- value: 'leaderId',
- type: 'select',
- planList: this.leaderIdList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '所属班组:',
- value: 'teamId',
- type: 'select',
- planList: this.teamList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '所属工厂:',
- value: 'factoryId',
- type: 'select',
- planList: this.factoryList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '设备编码:',
- value: 'assetCode',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '设备名称:',
- value: 'assetName',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '所属厂房:',
- value: 'workshopPlanId',
- type: 'select',
- planList: this.workshopPlanList.map((item) => ({
- label: item.workshopPlanName || item.name,
- value: item.id
- })),
- placeholder: '请选择'
- },
- {
- label: '所属车间:',
- value: 'workshopId',
- type: 'select',
- planList: this.workshopList.map((item) => ({
- label: item.name,
- value: item.id
- })),
- placeholder: '请选择'
- }
- ];
- }
- },
- created() {
- this.getUserPage();
- this.getBasicAreaList();
- this.getListWorkCenter();
- this.getListProduce();
- this.getTeamPage();
- this.getFactoryList();
- this.getWorkshopPlanList();
- this.getWorkshopList();
- },
- methods: {
- /* 获取区域集合 */
- async getBasicAreaList() {
- this.areaList = await basicAreaPageAPI({
- pageNum: 1,
- size: 9999
- });
- this.areaTreeList = this.$util.toTreeData({
- data: this.areaList,
- idField: 'id',
- parentIdField: 'parentId'
- });
- },
- async getListWorkCenter() {
- await work.list({ pageNum: 1, size: -1 }).then((res) => {
- this.workCenterList = res.list;
- });
- },
- getListProduce() {
- producetask.list({ pageNum: 1, size: -1 }).then((res) => {
- this.sourceTaskList = res.list || [];
- });
- },
- /* 搜索 */
- search(where) {
- this.$emit('search', where);
- },
- // 获取人员
- getUserPage() {
- let par = {
- size: 999
- };
- getUserPage(par).then((res) => {
- this.leaderIdList = res.list;
- });
- },
- // 获取班组
- getTeamPage() {
- let param = {
- pageNum: 1,
- size: 9999
- };
- getteampage(param).then((res) => {
- this.teamList = res.list || [];
- });
- },
- // 获取工厂列表
- getFactoryList() {
- getFactoryarea({
- pageNum: 1,
- size: 999,
- type: 1,
- enable: 1
- }).then((res) => {
- this.factoryList = res.list || [];
- });
- },
- // 获取厂房列表
- getWorkshopPlanList() {
- getFactoryarea({
- pageNum: 1,
- size: 9999,
- type: 2,
- enable: 1
- }).then((res) => {
- this.workshopPlanList = res.list || [];
- });
- },
- // 获取车间列表
- getWorkshopList() {
- getFactoryarea({
- pageNum: 1,
- size: 9999,
- type: 3,
- enable: 1
- }).then((res) => {
- this.workshopList = res.list || [];
- });
- }
- }
- };
- </script>
|