| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function ProductionStockedInRightBottom() { |
| | | return request({ |
| | | url: 'KanBanManagerent/ProductionStockedInRightBottom', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function ProcureOutsourcRightTop() { |
| | | return request({ |
| | | url: 'KanBanManagerent/ProcureOutsourcRightTop', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function ProductConsignmentLeftBottom() { |
| | | return request({ |
| | | url: 'KanBanManagerent/ProductConsignmentLeftBottom', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export function ProcureOutsourcLeftTop() { |
| | | return request({ |
| | | url: 'KanBanManagerent/ProcureOutsourcLeftTop', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 车é´çæ¿,ä¸çäº§ä¿¡æ¯ |
| | | export function WorkShopProduceTopData(data) { |
| | | return request({ |
| | |
| | | |
| | | // 综åçæ¿å¾ |
| | | export function bar02(dataArr, titlenameArr) { |
| | | // const data = [700, 600, 50, 40, 30] |
| | | // const titlename = ['500mlææçå塿¯ èè² å·å¡', '500mlææçå塿¯ èè² å·å¡', '尺寸', 'é¢è²', '大å°'] |
| | | // const data = [70, 60, 50, 40, 30] |
| | | // const titlename = ['å¤è§å伤', 'è¡¨é¢æ²¹æ±¡', '尺寸', 'é¢è²', '大å°'] |
| | | // const data = val.map(i => i.cont) |
| | | // const titlename = val.map(i => i.name) |
| | | const data = dataArr.filter((item, index) => index < 5) |
| | | const data = dataArr.filter((item, index) => index < 10) |
| | | |
| | | const titlename = titlenameArr.filter((item, index) => index < 5) |
| | | const titlename = titlenameArr.filter((item, index) => index < 10) |
| | | |
| | | const length = titlename.length |
| | | if (titlename.length < 5) { |
| | |
| | | } |
| | | } |
| | | |
| | | console.log(titlename, 123) |
| | | |
| | | // const valdata = [683, 500, 400, 300, 200] |
| | | const valdata = [683, 500, 400, 300, 200] |
| | | // const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00'] |
| | | // const myColor = ['#0000FF'] |
| | | // const myColor = ['#7af5f5', '#00FFFF', '#00FFFF', '#00FFFF', '#00FFFF'] |
| | | const myColor = ['rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)'] |
| | | const myColor = [ |
| | | 'rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)', |
| | | 'rgba(122,245,245,0.75)', 'rgba(122,245,245,0.7)', 'rgba(122,245,245,0.65)', 'rgba(122,245,245,0.6)', 'rgba(122,245,245,0.55)' |
| | | ] |
| | | const option = { |
| | | animation: false, |
| | | backgroundColor: 'transparent', |
| | |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | show: false, |
| | | // color: '#fff', |
| | | color: function(value, index) { |
| | | return value === '0' ? 'transparent' : '#fff' |
| | | }, |
| | | verticalAlign: 'bottom', |
| | | // align: 'left', |
| | | // margin: 80, |
| | | fontSize: 20, |
| | | |
| | | // formatter: function(value, index) { |
| | | // return [ |
| | | // '{lg|' + (index + 1) + 'ã }' + '{title|' + value + '} ' |
| | |
| | | } |
| | | }, |
| | | { |
| | | show: true, |
| | | show: false, |
| | | inverse: true, |
| | | data: data, |
| | | data: valdata, |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: 20, |
| | | fontSize: 12, |
| | | color: '#fff' |
| | | } |
| | | }, |
| | |
| | | }, |
| | | label: { |
| | | normal: { |
| | | color: '#fff', |
| | | show: true, |
| | | position: [0, '-20px'], |
| | | textStyle: { |
| | | fontSize: 16 |
| | | }, |
| | | formatter: function(a, b) { |
| | | return a.name |
| | | } |
| | | position: 'right', |
| | | formatter: '{c}', |
| | | fontSize: 20, |
| | | color: '#fff' |
| | | // formatter: '{c}%', |
| | | } |
| | | // normal: { |
| | | // show: true, |
| | | // position: 'right', |
| | | // formatter: '{c}', |
| | | // fontSize: 20, |
| | | // color: '#fff' |
| | | // // formatter: '{c}%', |
| | | // } |
| | | } |
| | | } |
| | | ] |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | | <div style="display: flex">
|
| | | <!-- background:rgba(248,248,250,1);-->
|
| | | <div style="width: 300px;margin: 10px 10px 0 0;background: #fff">
|
| | |
|
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;">
|
| | | <div style="display: flex;">
|
| | | <div
|
| | | style="width: 5px;height: 100%;border-radius: 5px;"
|
| | | :style="{background:$store.state.settings.theme}"
|
| | | />
|
| | | <div style="margin-left: 8px;">ç»ç»æ¶æ</div>
|
| | | </div>
|
| | |
|
| | | <!-- <div style="margin-right:10px">-->
|
| | | <!-- <i class="el-icon-plus" style="cursor: pointer;color: #999" />-->
|
| | | <!-- </div>-->
|
| | |
|
| | | </div>
|
| | |
|
| | | <el-tree
|
| | | ref="treeLeftRef"
|
| | | key="treeLeftKey"
|
| | | style="padding: 10px;overflow: auto;"
|
| | | :style="{height:(tableHeight+180)+'px'}"
|
| | | :data="treeLeft"
|
| | | node-key="torg_code"
|
| | | highlight-current
|
| | | :props="defaultPropsLeft"
|
| | | :default-expand-all="true"
|
| | | :expand-on-click-node="false"
|
| | | @node-click="nodeClick"
|
| | | />
|
| | |
|
| | | </div>
|
| | |
|
| | | <div style="width: calc(100% - 300px)">
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button>
|
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=3')">导å
¥</el-button>
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;">
|
| | | <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¨æ·åç§°" style=" display: flex;">
|
| | | <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <!-- <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getUserData">æ¥è¯¢</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | style="height: 5px;"
|
| | | >
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseout'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
|
| | | <!-- @mouseenter="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseenter'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
|
| | | <!-- @click="isExpandForm=!isExpandForm"-->
|
| | | <!-- @mouseout="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | class="tableFixed"
|
| | | :data="tableData"
|
| | | :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | @sort-change="sortChange"
|
| | | >
|
| | | <el-table-column
|
| | | prop="rowNum"
|
| | | width="50"
|
| | | fixed
|
| | | label="åºå·"
|
| | | />
|
| | | <el-table-column
|
| | | prop="usercode"
|
| | | label="ç¨æ·ç¼ç "
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | />
|
| | | <el-table-column
|
| | | prop="username"
|
| | | label="ç¨æ·åç§°"
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | />
|
| | | <el-table-column
|
| | | prop="storg_name"
|
| | | label="æå±ç»ç»"
|
| | | show-overflow-tooltip
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.storg_name">{{ row.storg_name }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="status"
|
| | | label="ç¶æ"
|
| | | show-overflow-tooltip
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">å¨è</el-tag>
|
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">离è</el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="email"
|
| | | label="é®ç®±"
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.email ? row.email : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="mobile"
|
| | | label="å·ç "
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.mobile ? row.mobile : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="postname"
|
| | | label="å²ä½"
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.postname ? row.postname : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="rolename"
|
| | | label="è§è²"
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.rolename ? row.rolename : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="group_name"
|
| | | label="çç»"
|
| | | sortable="custom"
|
| | | show-overflow-tooltip
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.group_name ? row.group_name : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="createusername"
|
| | | label="å建人å"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="lm_date"
|
| | | label="å建æ¶é´"
|
| | | width="160"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top">
|
| | | <i
|
| | | v-if="row.usercode!=='9999'"
|
| | | class="el-icon-edit-outline"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | @click="edit('edit',row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">
|
| | | <i
|
| | | v-if="row.usercode!=='9999'"
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | @click="del(row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--å页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes,jumper"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getUserData"
|
| | | />
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="800px"
|
| | | :close-on-click-modal="false"
|
| | | top="15vh"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
|
| | | <el-form-item label="ç¨æ·ç¼ç " prop="usercode">
|
| | | <el-input v-model="dialogForm.usercode" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¨æ·åç§°" prop="username">
|
| | | <el-input v-model="dialogForm.username" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="ç¨æ·å¯ç " prop="password">
|
| | | <el-input v-model="dialogForm.password" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="æå±ç»ç»" prop="storg_code">
|
| | | <el-cascader
|
| | | ref="cascader"
|
| | | v-model="dialogForm.storg_code"
|
| | | :options="cascaderOptions"
|
| | | filterable
|
| | | :props="defaultProps"
|
| | | :show-all-levels="false"
|
| | | />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="ææºå·" prop="mobile">
|
| | | <el-input v-model="dialogForm.mobile" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="é®ç®±" prop="email">
|
| | | <el-input v-model="dialogForm.email" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item required label="ç¨æ·ç¶æ">
|
| | | <el-radio-group v-model="dialogForm.status" style="width: 200px;">
|
| | | <el-radio label="Y">å¨è</el-radio>
|
| | | <el-radio label="N">离è</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item prop="post_code" label="å²ä½">
|
| | | <el-select
|
| | | v-model="dialogForm.post_code"
|
| | | style="width:490px"
|
| | | placeholder="è¯·éæ©"
|
| | | multiple
|
| | | filterable
|
| | | clearable
|
| | | collapse-tags
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in postArr"
|
| | | :key="item.postcode"
|
| | | :label="item.postname"
|
| | | :value="item.postcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item prop="role_code" label="è§è²">
|
| | | <el-select
|
| | | v-model="dialogForm.role_code"
|
| | | style="width:490px"
|
| | | multiple
|
| | | filterable
|
| | | clearable
|
| | | collapse-tags
|
| | | placeholder="è¯·éæ©"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in roleArr"
|
| | | :key="item.rolecode"
|
| | | :label="item.rolename"
|
| | | :value="item.rolecode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item prop="group_code" label="çç»">
|
| | | <el-select
|
| | | v-model="dialogForm.group_code"
|
| | | style="width: 490px"
|
| | | placeholder="è¯·éæ©"
|
| | | :popper-append-to-body="false"
|
| | | multiple
|
| | | filterable
|
| | | collapse-tags
|
| | | clearable
|
| | | >
|
| | | <el-option
|
| | | v-for="item in groupArr"
|
| | | :key="item.usergroupcode"
|
| | | :label="item.usergroupname"
|
| | | :value="item.usergroupcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | </el-form>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import {
|
| | | AddUpdateUserSave,
|
| | | DeleteUserSave, UserData
|
| | | } from '@/api/basicSettings'
|
| | | import { validateCode } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import arrayToTree from 'array-to-tree'
|
| | | import { GroupsPermissions, PostPermissions, PrentOrganization, RolePermissions } from '@/api/GeneralBasicData'
|
| | |
|
| | | export default {
|
| | | name: 'PersonList',
|
| | | components: {
|
| | | Pagination
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | const validateMobile = (rule, value, callback) => {
|
| | | if (!value) {
|
| | | callback()
|
| | | // return callback(new Error('请è¾å
¥çµè¯å·ç '))
|
| | | } else {
|
| | | const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // é¿å·
|
| | | const mobile2 = /^[0-9]{6}$/ // çå·
|
| | | if (mobile.test(value) || mobile2.test(value)) {
|
| | | callback()
|
| | | // return callback(new Error('çµè¯å·ç ä¸ç¬¦åè§å'))
|
| | | } else {
|
| | | return callback(new Error('çµè¯å·ç ä¸ç¬¦åè§å'))
|
| | | // callback()
|
| | | }
|
| | | }
|
| | | }
|
| | | const validateEmail = (rule, value, callback) => {
|
| | | if (!value) {
|
| | | callback()
|
| | | // return callback(new Error('请è¾å
¥çµåé®ç®±'))
|
| | | } else {
|
| | | const email = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/
|
| | | if (email.test(value)) {
|
| | | callback()
|
| | | } else {
|
| | | return callback(new Error('çµåé®ç®±ä¸ç¬¦åè§å'))
|
| | | }
|
| | | }
|
| | | }
|
| | | return {
|
| | | mouseHoverType: 'mouseout',
|
| | | isExpandForm: false,
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | usercode: '',
|
| | | username: '',
|
| | | storgcode: '', // ç»ç»ç¼ç
|
| | | prop: 'lm_date', // æåºå段
|
| | | order: 'desc', // æåºå段
|
| | | page: 1, // 第å 页
|
| | | rows: 20 // æ¯é¡µå¤å°æ¡
|
| | | },
|
| | | total: 10,
|
| | | tableData: [],
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | usercode: '', // ç¨æ·ç¼ç
|
| | | username: '', // ç¨æ·åç§°
|
| | | post_code: [], // å²ä½
|
| | | role_code: [], // è§è²
|
| | | group_code: [], // çç»
|
| | | password: '123456', // å¯ç
|
| | | storg_code: '', // æå±ç»ç»
|
| | | mobile: '', // å·ç
|
| | | email: '', // é®ç®±
|
| | | status: 'Y'// ç¶æ
|
| | | },
|
| | | operation: '',
|
| | | dialogFormRules: {
|
| | | usercode: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | username: [
|
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | password: [
|
| | | { required: true, message: '请è¾å
¥ç¨æ·å¯ç ', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | mobile: [
|
| | | { required: false, validator: validateMobile, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | email: [
|
| | | { required: false, validator: validateEmail, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | storg_code: [
|
| | | { required: true, message: 'è¯·éæ©æå±ç»ç»', trigger: ['blur', 'change'] }
|
| | | ]
|
| | | },
|
| | | defaultProps: {
|
| | | checkStrictly: true,
|
| | | expandTrigger: 'hover',
|
| | | value: 'torg_code',
|
| | | label: 'torg_name'
|
| | | },
|
| | | Options: [],
|
| | | cascaderOptions: [],
|
| | |
|
| | | postArr: [],
|
| | | roleArr: [],
|
| | | groupArr: [],
|
| | |
|
| | | defaultPropsLeft: {
|
| | | children: 'children',
|
| | | label: 'torg_name'
|
| | | },
|
| | | treeLeft: []
|
| | |
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | | this.getUserData()
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | |
|
| | | this.getPrentOrganization()
|
| | | this.getAllSelectData()
|
| | | },
|
| | | methods: {
|
| | | // ç»ç»æ¶æå¤§å表æ¥è¯¢
|
| | | async getUserData() {
|
| | | const res = await UserData(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | },
|
| | | // ç»ç»æ¶æçº§èéæ©å¨
|
| | | async getPrentOrganization() {
|
| | | const { data: res } = await PrentOrganization()
|
| | | this.Options = res
|
| | | this.cascaderOptions = arrayToTree(res, {
|
| | | parentProperty: 'parent_id',
|
| | | customID: 'torg_code',
|
| | | childrenProperty: 'children'
|
| | | })
|
| | | this.$nextTick(() => {
|
| | | this.treeLeft = this.cascaderOptions
|
| | | this.$forceUpdate()
|
| | | })
|
| | | },
|
| | | // å²ä½ è§è² çç»
|
| | | async getAllSelectData() {
|
| | | const { data: res1 } = await PostPermissions()
|
| | | this.postArr = res1
|
| | |
|
| | | const { data: res2 } = await RolePermissions()
|
| | | this.roleArr = res2
|
| | |
|
| | | const { data: res3 } = await GroupsPermissions()
|
| | | this.groupArr = res3
|
| | | },
|
| | |
|
| | | // æåºæ¹åæ¶
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getUserData()
|
| | | },
|
| | | nodeClick(obj, Node, VueComponent) {
|
| | | this.form.storgcode = obj.torg_code
|
| | | this.getUserData()
|
| | | },
|
| | | // éç½®
|
| | | reset() {
|
| | | this.form.usercode = ''
|
| | | this.form.username = ''
|
| | | this.form.storgcode = ''
|
| | | this.$refs.treeLeftRef.setCurrentKey(null)
|
| | | this.getUserData()
|
| | | },
|
| | | // æ°å¢æé®
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.dialogForm.OperType = 'Add'
|
| | | },
|
| | | // ä¿®æ¹æé®
|
| | | async edit(operation, row) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.dialogForm.OperType = 'Update'
|
| | |
|
| | | // this.cascaderOptions = this.filterChildren(this.cascaderOptions, row.storg_code)
|
| | | this.$nextTick(() => {
|
| | | this.dialogForm.usercode = row.usercode
|
| | | this.dialogForm.username = row.username
|
| | | this.dialogForm.password = row.password
|
| | | this.dialogForm.mobile = row.mobile
|
| | | this.dialogForm.email = row.email
|
| | | this.dialogForm.status = row.status
|
| | | this.dialogForm.storg_code = this.findParent([], row.storg_code, this.cascaderOptions).reverse()
|
| | |
|
| | | this.dialogForm.post_code = row.post_code ? row.post_code.split(',') : []
|
| | | this.dialogForm.role_code = row.role_code ? row.role_code.split(',') : []
|
| | | this.dialogForm.group_code = row.group_code ? row.group_code.split(',') : []
|
| | | })
|
| | | },
|
| | | filterChildren(treeData, code) {
|
| | | treeData.forEach(item => {
|
| | | if (code.split(',').includes(item.torg_code)) {
|
| | | item.disabled = true
|
| | | if (item.children && item.children.length > 0) {
|
| | | this.filterChildren(item.children, item.children.map(it => it.torg_code).join(','))
|
| | | }
|
| | | } else {
|
| | | if (item.children && item.children.length > 0) {
|
| | | this.filterChildren(item.children, code)
|
| | | }
|
| | | }
|
| | | })
|
| | | return treeData
|
| | | },
|
| | | // parents:ç¨äºè¿åçæ°ç»ï¼childNode:è¦æ¥è¯¢çèç¹ï¼treeDataï¼jsonæ å½¢æ°æ®
|
| | | findParent(parents, childNode, treeData) {
|
| | | // console.log(parents, childNode, treeData, 2)
|
| | |
|
| | | for (let i = 0; i < treeData.length; i++) {
|
| | | // ç¶èç¹æ¥è¯¢æ¡ä»¶
|
| | | if (treeData[i].torg_code === childNode) {
|
| | | // 妿æ¾å°ç»æ,ä¿åå½åèç¹
|
| | | parents.push(treeData[i].torg_code)
|
| | | // ç¨å½åèç¹åå»åæ°æ®æ¥æ¾å½åèç¹çç¶èç¹
|
| | | this.findParent(parents, treeData[i].parent_id, this.cascaderOptions)
|
| | | break
|
| | | } else {
|
| | | if (treeData[i].children instanceof Array) {
|
| | | // 没æ¾å°ï¼éå该èç¹çåèç¹
|
| | | this.findParent(parents, childNode, treeData[i].children)
|
| | | }
|
| | | }
|
| | | }
|
| | | return parents
|
| | | },
|
| | | // å 餿é®
|
| | | async del(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | DeleteUserSave({ usercode: row.usercode }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('å 餿å!')
|
| | | if (this.form.page > 1 && this.tableData.length === 1) {
|
| | | this.form.page--
|
| | | }
|
| | | this.getUserData()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已忶å é¤')
|
| | | })
|
| | | },
|
| | | // å¯¹è¯æ¡å
³éäºä»¶
|
| | | handleClose() {
|
| | | this.dialogForm.usercode = ''
|
| | | this.dialogForm.username = ''
|
| | | this.dialogForm.status = 'Y'
|
| | |
|
| | | this.dialogForm.post_code = []
|
| | | this.dialogForm.role_code = []
|
| | | this.dialogForm.group_code = []
|
| | | this.dialogForm.password = '123456'
|
| | | this.dialogForm.mobile = ''
|
| | | this.dialogForm.email = ''
|
| | |
|
| | | // this.dialogForm.storg_code = ''
|
| | |
|
| | | this.$refs.cascader.checkedValue = ''
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // å¯¹è¯æ¡åæ¶
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // å¯¹è¯æ¡ç¡®è®¤
|
| | | dialogVisibleConfirm() {
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | this.dialogForm.group_code = this.dialogForm.group_code.join(',')
|
| | | this.dialogForm.post_code = this.dialogForm.post_code.join(',')
|
| | | this.dialogForm.role_code = this.dialogForm.role_code.join(',')
|
| | | this.dialogForm.storg_code = this.dialogForm.storg_code[this.dialogForm.storg_code.length - 1]
|
| | | AddUpdateUserSave(this.dialogForm).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼')
|
| | | this.dialogVisible = false
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.getUserData()
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | // è·å页é¢é«åº¦
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 280
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div style="display: flex"> |
| | | <!-- background:rgba(248,248,250,1);--> |
| | | <div style="width: 220px;margin: 10px 10px 0 0;background: #fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">ç»ç»æ¶æ</div> |
| | | </div> |
| | | |
| | | <!-- <div style="margin-right:10px">--> |
| | | <!-- <i class="el-icon-plus" style="cursor: pointer;color: #999" />--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | key="treeLeftKey" |
| | | style="padding: 10px;overflow: auto;" |
| | | :style="{height:(tableHeight+180)+'px'}" |
| | | :data="treeLeft" |
| | | node-key="torg_code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | @node-click="nodeClick" |
| | | /> |
| | | |
| | | </div> |
| | | |
| | | <div style="width: calc(100% - 220px)"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button> |
| | | <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=3')">导å
¥</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·åç§°" style=" display: flex;"> |
| | | <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getUserData">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | style="height: 5px;" |
| | | > |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseout'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"--> |
| | | <!-- @mouseenter="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseenter'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"--> |
| | | <!-- @click="isExpandForm=!isExpandForm"--> |
| | | <!-- @mouseout="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+80)+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="usercode" |
| | | label="ç¨æ·ç¼ç " |
| | | sortable="custom" |
| | | min-width="105" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="username" |
| | | label="ç¨æ·åç§°" |
| | | min-width="105" |
| | | sortable="custom" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | prop="storg_name" |
| | | label="æå±ç»ç»" |
| | | min-width="105" |
| | | show-overflow-tooltip |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.storg_name">{{ row.storg_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="status" |
| | | min-width="105" |
| | | label="ç¶æ" |
| | | show-overflow-tooltip |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">å¨è</el-tag> |
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">离è</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="payrate" |
| | | min-width="105" |
| | | label="èªèµç±»å" |
| | | show-overflow-tooltip |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.payrate ? PayRateArr.find(i=>i.code === row.payrate).name : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="email" |
| | | label="é®ç®±" |
| | | min-width="105" |
| | | sortable="custom" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.email ? row.email : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="mobile" |
| | | label="å·ç " |
| | | min-width="105" |
| | | sortable="custom" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.mobile ? row.mobile : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="postname" |
| | | label="å²ä½" |
| | | sortable="custom" |
| | | min-width="105" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.postname ? row.postname : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="rolename" |
| | | label="è§è²" |
| | | sortable="custom" |
| | | min-width="105" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.rolename ? row.rolename : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="group_name" |
| | | label="çç»" |
| | | min-width="105" |
| | | sortable="custom" |
| | | show-overflow-tooltip |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.group_name ? row.group_name : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="createusername" |
| | | label="å建人å" |
| | | sortable="custom" |
| | | min-width="105" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="å建æ¶é´" |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="80" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | v-if="row.usercode!=='9999'" |
| | | class="el-icon-edit-outline" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | v-if="row.usercode!=='9999'" |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="del(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getUserData" |
| | | /> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="ç¨æ·ç¼ç " prop="usercode"> |
| | | <el-input v-model="dialogForm.usercode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¨æ·åç§°" prop="username"> |
| | | <el-input v-model="dialogForm.username" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ç¨æ·å¯ç " prop="password"> |
| | | <el-input v-model="dialogForm.password" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="æå±ç»ç»" prop="storg_code"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | v-model="dialogForm.storg_code" |
| | | :options="cascaderOptions" |
| | | filterable |
| | | :props="defaultProps" |
| | | :show-all-levels="false" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ææºå·" prop="mobile"> |
| | | <el-input v-model="dialogForm.mobile" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="é®ç®±" prop="email"> |
| | | <el-input v-model="dialogForm.email" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item required label="ç¨æ·ç¶æ"> |
| | | <el-radio-group v-model="dialogForm.status" style="width: 200px;"> |
| | | <el-radio label="Y">å¨è</el-radio> |
| | | <el-radio label="N">离è</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | | <el-form-item prop="payrate" label="èªèµç±»å"> |
| | | <el-select |
| | | v-model="dialogForm.payrate" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in PayRateArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item prop="post_code" label="å²ä½"> |
| | | <el-select |
| | | v-model="dialogForm.post_code" |
| | | style="width:490px" |
| | | placeholder="è¯·éæ©" |
| | | multiple |
| | | filterable |
| | | clearable |
| | | collapse-tags |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in postArr" |
| | | :key="item.postcode" |
| | | :label="item.postname" |
| | | :value="item.postcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item prop="role_code" label="è§è²"> |
| | | <el-select |
| | | v-model="dialogForm.role_code" |
| | | style="width:490px" |
| | | multiple |
| | | filterable |
| | | clearable |
| | | collapse-tags |
| | | placeholder="è¯·éæ©" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in roleArr" |
| | | :key="item.rolecode" |
| | | :label="item.rolename" |
| | | :value="item.rolecode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item prop="group_code" label="çç»"> |
| | | <el-select |
| | | v-model="dialogForm.group_code" |
| | | style="width: 490px" |
| | | placeholder="è¯·éæ©" |
| | | :popper-append-to-body="false" |
| | | multiple |
| | | filterable |
| | | collapse-tags |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in groupArr" |
| | | :key="item.usergroupcode" |
| | | :label="item.usergroupname" |
| | | :value="item.usergroupcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateUserSave, |
| | | DeleteUserSave, UserData |
| | | } from '@/api/basicSettings' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import arrayToTree from 'array-to-tree' |
| | | import { GroupsPermissions, PostPermissions, PrentOrganization, RolePermissions } from '@/api/GeneralBasicData' |
| | | |
| | | export default { |
| | | name: 'PersonList', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | const validateMobile = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback() |
| | | // return callback(new Error('请è¾å
¥çµè¯å·ç ')) |
| | | } else { |
| | | const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // é¿å· |
| | | const mobile2 = /^[0-9]{6}$/ // çå· |
| | | if (mobile.test(value) || mobile2.test(value)) { |
| | | callback() |
| | | // return callback(new Error('çµè¯å·ç ä¸ç¬¦åè§å')) |
| | | } else { |
| | | return callback(new Error('çµè¯å·ç ä¸ç¬¦åè§å')) |
| | | // callback() |
| | | } |
| | | } |
| | | } |
| | | const validateEmail = (rule, value, callback) => { |
| | | if (!value) { |
| | | callback() |
| | | // return callback(new Error('请è¾å
¥çµåé®ç®±')) |
| | | } else { |
| | | const email = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/ |
| | | if (email.test(value)) { |
| | | callback() |
| | | } else { |
| | | return callback(new Error('çµåé®ç®±ä¸ç¬¦åè§å')) |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | usercode: '', |
| | | username: '', |
| | | storgcode: '', // ç»ç»ç¼ç |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | total: 10, |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | usercode: '', // ç¨æ·ç¼ç |
| | | username: '', // ç¨æ·åç§° |
| | | post_code: [], // å²ä½ |
| | | role_code: [], // è§è² |
| | | group_code: [], // çç» |
| | | password: '123456', // å¯ç |
| | | storg_code: '', // æå±ç»ç» |
| | | mobile: '', // å·ç |
| | | email: '', // é®ç®± |
| | | status: 'Y', // ç¶æ |
| | | payrate: ''// èªèµç±»å |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | usercode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | username: [ |
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | password: [ |
| | | { required: true, message: '请è¾å
¥ç¨æ·å¯ç ', trigger: ['blur', 'change'] } |
| | | ], |
| | | mobile: [ |
| | | { required: false, validator: validateMobile, trigger: ['blur', 'change'] } |
| | | ], |
| | | email: [ |
| | | { required: false, validator: validateEmail, trigger: ['blur', 'change'] } |
| | | ], |
| | | storg_code: [ |
| | | { required: true, message: 'è¯·éæ©æå±ç»ç»', trigger: ['blur', 'change'] } |
| | | ], |
| | | payrate: [ |
| | | { required: true, message: 'è¯·éæ©èªèµç±»å', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | defaultProps: { |
| | | checkStrictly: true, |
| | | expandTrigger: 'hover', |
| | | value: 'torg_code', |
| | | label: 'torg_name' |
| | | }, |
| | | Options: [], |
| | | cascaderOptions: [], |
| | | |
| | | postArr: [], |
| | | roleArr: [], |
| | | groupArr: [], |
| | | PayRateArr: [ |
| | | { code: 'S', name: '计件' }, |
| | | { code: 'T', name: '计æ¶' }, |
| | | { code: 'M', name: 'ææ' } |
| | | ], |
| | | |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'torg_name' |
| | | }, |
| | | treeLeft: [] |
| | | |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.getUserData() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | |
| | | this.getPrentOrganization() |
| | | this.getAllSelectData() |
| | | }, |
| | | methods: { |
| | | // ç»ç»æ¶æå¤§å表æ¥è¯¢ |
| | | async getUserData() { |
| | | const res = await UserData(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | // ç»ç»æ¶æçº§èéæ©å¨ |
| | | async getPrentOrganization() { |
| | | const { data: res } = await PrentOrganization() |
| | | this.Options = res |
| | | this.cascaderOptions = arrayToTree(res, { |
| | | parentProperty: 'parent_id', |
| | | customID: 'torg_code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | this.$nextTick(() => { |
| | | this.treeLeft = this.cascaderOptions |
| | | this.$forceUpdate() |
| | | }) |
| | | }, |
| | | // å²ä½ è§è² çç» |
| | | async getAllSelectData() { |
| | | const { data: res1 } = await PostPermissions() |
| | | this.postArr = res1 |
| | | |
| | | const { data: res2 } = await RolePermissions() |
| | | this.roleArr = res2 |
| | | |
| | | const { data: res3 } = await GroupsPermissions() |
| | | this.groupArr = res3 |
| | | }, |
| | | |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getUserData() |
| | | }, |
| | | nodeClick(obj, Node, VueComponent) { |
| | | this.form.storgcode = obj.torg_code |
| | | this.getUserData() |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.form.usercode = '' |
| | | this.form.username = '' |
| | | this.form.storgcode = '' |
| | | this.$refs.treeLeftRef.setCurrentKey(null) |
| | | this.getUserData() |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | |
| | | // this.cascaderOptions = this.filterChildren(this.cascaderOptions, row.storg_code) |
| | | this.$nextTick(() => { |
| | | this.dialogForm.usercode = row.usercode |
| | | this.dialogForm.username = row.username |
| | | this.dialogForm.password = row.password |
| | | this.dialogForm.mobile = row.mobile |
| | | this.dialogForm.email = row.email |
| | | this.dialogForm.status = row.status |
| | | this.dialogForm.payrate = row.payrate |
| | | this.dialogForm.storg_code = this.findParent([], row.storg_code, this.cascaderOptions).reverse() |
| | | |
| | | this.dialogForm.post_code = row.post_code ? row.post_code.split(',') : [] |
| | | this.dialogForm.role_code = row.role_code ? row.role_code.split(',') : [] |
| | | this.dialogForm.group_code = row.group_code ? row.group_code.split(',') : [] |
| | | }) |
| | | }, |
| | | filterChildren(treeData, code) { |
| | | treeData.forEach(item => { |
| | | if (code.split(',').includes(item.torg_code)) { |
| | | item.disabled = true |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, item.children.map(it => it.torg_code).join(',')) |
| | | } |
| | | } else { |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, code) |
| | | } |
| | | } |
| | | }) |
| | | return treeData |
| | | }, |
| | | // parents:ç¨äºè¿åçæ°ç»ï¼childNode:è¦æ¥è¯¢çèç¹ï¼treeDataï¼jsonæ å½¢æ°æ® |
| | | findParent(parents, childNode, treeData) { |
| | | // console.log(parents, childNode, treeData, 2) |
| | | |
| | | for (let i = 0; i < treeData.length; i++) { |
| | | // ç¶èç¹æ¥è¯¢æ¡ä»¶ |
| | | if (treeData[i].torg_code === childNode) { |
| | | // 妿æ¾å°ç»æ,ä¿åå½åèç¹ |
| | | parents.push(treeData[i].torg_code) |
| | | // ç¨å½åèç¹åå»åæ°æ®æ¥æ¾å½åèç¹çç¶èç¹ |
| | | this.findParent(parents, treeData[i].parent_id, this.cascaderOptions) |
| | | break |
| | | } else { |
| | | if (treeData[i].children instanceof Array) { |
| | | // 没æ¾å°ï¼éå该èç¹çåèç¹ |
| | | this.findParent(parents, childNode, treeData[i].children) |
| | | } |
| | | } |
| | | } |
| | | return parents |
| | | }, |
| | | // å é¤æé® |
| | | async del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteUserSave({ usercode: row.usercode }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getUserData() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.usercode = '' |
| | | this.dialogForm.username = '' |
| | | this.dialogForm.status = 'Y' |
| | | |
| | | this.dialogForm.post_code = [] |
| | | this.dialogForm.role_code = [] |
| | | this.dialogForm.group_code = [] |
| | | this.dialogForm.password = '123456' |
| | | this.dialogForm.mobile = '' |
| | | this.dialogForm.email = '' |
| | | this.dialogForm.payrate = '' |
| | | |
| | | // this.dialogForm.storg_code = '' |
| | | |
| | | this.$refs.cascader.checkedValue = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | this.dialogForm.group_code = this.dialogForm.group_code.join(',') |
| | | this.dialogForm.post_code = this.dialogForm.post_code.join(',') |
| | | this.dialogForm.role_code = this.dialogForm.role_code.join(',') |
| | | this.dialogForm.storg_code = this.dialogForm.storg_code[this.dialogForm.storg_code.length - 1] |
| | | AddUpdateUserSave(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getUserData() |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 280 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | <div |
| | | class="lineContent horn" |
| | | style="height: 870px;display: flex;flex-direction: column;justify-content: space-between" |
| | | style="height: 450px;display: flex;flex-direction: column;justify-content: space-between" |
| | | > |
| | | <el-table |
| | | ref="tableDataLeftCenterRef" |
| | |
| | | style="width: 100%;" |
| | | :header-cell-style="headerCellStyle" |
| | | :cell-style="cellStyle" |
| | | height="920" |
| | | height="500" |
| | | > |
| | | |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="å·¥åå·" |
| | | width="270" |
| | | width="220" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="saleOrderCode"--> |
| | | <!-- label="ç产åå·"--> |
| | | <!-- width="160"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | label="ç产车é´" |
| | | width="210" |
| | | /> |
| | | <!-- 600--> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | width="210" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="产ååç§°" |
| | | width="210" |
| | | width="160" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="partspec"--> |
| | | <!-- label="产åè§æ ¼"--> |
| | | <!-- width="160"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- {{ row.partspec ? row.partspec : '/' }}--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="产åè§æ ¼" |
| | | width="160" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="170" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | label="åæ ¼æ°é" |
| | | width="170" |
| | | width="120" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="ng_qty"--> |
| | | <!-- label="ä¸è¯æ°é"--> |
| | | <!-- width="120"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="laborbad_qty"--> |
| | | <!-- label="å·¥åºæ°é"--> |
| | | <!-- width="120"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="materielbad_qty"--> |
| | | <!-- label="æåºæ°é"--> |
| | | <!-- width="120"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="seq"--> |
| | | <!-- label="å·¥åºé¡ºåº"--> |
| | | <!-- width="120"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="step_code"--> |
| | | <!-- label="å·¥åºç¼ç "--> |
| | | <!-- width="120"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="å·¥åºæ°é" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="æåºæ°é" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="seq" |
| | | label="å·¥åºé¡ºåº" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="step_code" |
| | | label="å·¥åºç¼ç " |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="step_name" |
| | | label="å·¥åºåç§°" |
| | | width="320" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="schedule" |
| | | label="宿è¿åº¦(%)" |
| | | width="313" |
| | | width="213" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | |
| | | |
| | | </div> |
| | | <!-- ä¸è¾¹--> |
| | | <!-- <div style="display: flex;justify-content: space-between;margin-top: 15px;">--> |
| | | <!-- <div style="width: 1000px;">--> |
| | | <!-- <div class="smallTitle">--> |
| | | <!-- <svg-icon icon-class="blcs" class="svg_class" />--> |
| | | <!-- è´¨éä¸è¯(è¿ä¸å¨)--> |
| | | <!-- </div>--> |
| | | <!-- <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between">--> |
| | | <!-- <div id="cjzl03" class="flex_c_c" style="width: 100%;height:100%" />--> |
| | | <div style="display: flex;justify-content: space-between;margin-top: 15px;"> |
| | | <div style="width: 1000px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="blcs" class="svg_class" /> |
| | | è´¨éä¸è¯(è¿ä¸å¨) |
| | | </div> |
| | | <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between"> |
| | | <div id="cjzl03" class="flex_c_c" style="width: 100%;height:100%" /> |
| | | |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div style="width: 850px;">--> |
| | | <!-- <div class="smallTitle">--> |
| | | <!-- <svg-icon icon-class="ckkc" class="svg_class" />--> |
| | | <!-- ä¸è¯ç»è®¡(è¿ä¸æ)--> |
| | | <!-- </div>--> |
| | | <!-- <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between">--> |
| | | <!-- <div id="cjzl04" class="flex_c_c" style="width: 100%;height:100%" />--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <div style="width: 850px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="ckkc" class="svg_class" /> |
| | | ä¸è¯ç»è®¡(è¿ä¸æ) |
| | | </div> |
| | | <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between"> |
| | | <div id="cjzl04" class="flex_c_c" style="width: 100%;height:100%" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | setInterval(this.getNowTime, 1000) |
| | | |
| | |
| | | }, 1000 * 60 * 120) |
| | | }, |
| | | mounted() { |
| | | // this.getAllApi() |
| | | this.getWorkShopProduceTopData() |
| | | this.getAllApi() |
| | | }, |
| | | methods: { |
| | | async getWorkShopProduceTopData() { |
| | | // WorkShopProduceTopData({ wkshopcode: this.wkshopcode.join(',') }).then(res => { |
| | | WorkShopProduceTopData({ wkshopcode: '101,102' }).then(res => { |
| | | WorkShopProduceTopData({ wkshopcode: this.wkshopcode.join(',') }).then(res => { |
| | | this.tableDataCenterTop = res.data |
| | | |
| | | const divData = this.$refs.tableDataLeftCenterRef.bodyWrapper |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, this.tableDataCenterTop.length <= 22 ? 1000 * 30 : 200) |
| | | }, this.tableDataCenterTop.length <= 11 ? 1000 * 15 : 200) |
| | | }) |
| | | }, |
| | | |
| | |
| | | }) |
| | | }, 1000 * 50) |
| | | |
| | | const res5 = await WorkShopProduceBottomRightData({ wkshopcode: this.wkshopcode[0] }) |
| | | const res5 = await WorkShopProduceBottomRightData({ wkshopcode: this.wkshopcode.join(',') }) |
| | | this.RightBottom = res5.data |
| | | if (this.RightBottom.length > 0) { |
| | | loadEcharts('cjzl04', cjzl04(this.RightBottom.map(i => i.name), this.RightBottom.map(i => i.cont))) |
| | | } |
| | | |
| | | setInterval(() => { |
| | | WorkShopProduceBottomRightData({ wkshopcode: this.wkshopcode[0] }).then(res5 => { |
| | | WorkShopProduceBottomRightData({ wkshopcode: this.wkshopcode.join(',') }).then(res5 => { |
| | | this.RightBottom = res5.data |
| | | if (this.RightBottom.length > 0) { |
| | | loadEcharts('cjzl04', cjzl04(this.RightBottom.map(i => i.name), this.RightBottom.map(i => i.cont))) |
| | |
| | | }) |
| | | }, 1000 * 60) |
| | | |
| | | await this.getWorkShopProduceTopData() |
| | | this.getWorkShopProduceTopData() |
| | | }, |
| | | |
| | | // è·åå½åæ¶é´ |
| | |
| | | ::v-deep .el-table tr, |
| | | ::v-deep .el-table td { |
| | | background-color: transparent; |
| | | } |
| | | |
| | | ::v-deep .gutter { |
| | | display: none; |
| | | } |
| | | |
| | | .all_block01 { |
| | |
| | | <div style="height: 470px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="ph" class="svg_class" /> |
| | | åæåã产ååºåéæè¡Top5 |
| | | è¿ä¸å¨éè´å¾
å
¥åºç©ææè¡Top5 |
| | | </div> |
| | | <div class="lineContent horn" style="height: 410px"> |
| | | <div id="bar03" style="width: 100%;height:100%; " /> |
| | |
| | | <div style="height: 470px;margin-top: 30px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="ph" class="svg_class" /> |
| | | åææåºåéæè¡Top5 |
| | | è¿ä¸å¨éå®å·²å货产åæè¡Top5 |
| | | </div> |
| | | <div class="lineContent horn" style="height: 410px"> |
| | | <div id="bar04" style="width: 100%;height:100%;" /> |
| | |
| | | import './kbCommon.css' |
| | | import { bar02, kbTop, loadEcharts } from '@/utils/myEcharts' |
| | | import { |
| | | WareHouseTopLeftData, |
| | | WareHouseTopBottomData, |
| | | WareHouseRightTopData, |
| | | WareHouseRightBottomData |
| | | ProcureOutsourcLeftTop, |
| | | ProductConsignmentLeftBottom, |
| | | ProcureOutsourcRightTop, |
| | | ProductionStockedInRightBottom |
| | | } from '@/api/kanbanManager' |
| | | |
| | | export default { |
| | |
| | | window.addEventListener('offline', this.updateOnlineStatus) |
| | | this.updateOnlineStatus({ type: this.onLine ? 'online' : 'offline', isFirst: true }) |
| | | |
| | | this.getWareHouseTopLeftData() |
| | | this.getWareHouseTopBottomData() |
| | | this.getProcureOutsourcLeftTop() |
| | | this.getProductConsignmentLeftBottom() |
| | | this.getEcharts() |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | } |
| | | }, |
| | | // è·åå·¦ä¸tableæ°æ® |
| | | getWareHouseTopLeftData() { |
| | | WareHouseTopLeftData().then(res => { |
| | | getProcureOutsourcLeftTop() { |
| | | ProcureOutsourcLeftTop().then(res => { |
| | | this.tableDataTop = res.data |
| | | // this.number1 = this.tableDataTop.length |
| | | const divData = this.$refs.tableDataTopRef.bodyWrapper |
| | |
| | | if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) { |
| | | // éç½®tableè·ç¦»é¡¶é¨è·ç¦» |
| | | divData.scrollTop = 0 |
| | | WareHouseTopLeftData().then(res => { |
| | | ProcureOutsourcLeftTop().then(res => { |
| | | this.tableDataTop = res.data |
| | | // this.number1 = this.tableDataTop.length |
| | | if (this.tableDataTop.length > 10) { |
| | | clearInterval(this.tableTopTask) |
| | | this.getWareHouseTopLeftData() |
| | | this.getProcureOutsourcLeftTop() |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | }, |
| | | // è·åå·¦ä¸tableæ°æ® |
| | | getWareHouseTopBottomData() { |
| | | WareHouseTopBottomData().then(res => { |
| | | getProductConsignmentLeftBottom() { |
| | | ProductConsignmentLeftBottom().then(res => { |
| | | this.tableDataBottom = res.data |
| | | this.number2 = this.tableDataBottom.length |
| | | const divData = this.$refs.tableDataBottomRef.bodyWrapper |
| | |
| | | if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) { |
| | | // éç½®tableè·ç¦»é¡¶é¨è·ç¦» |
| | | divData.scrollTop = 0 |
| | | WareHouseTopBottomData().then(res => { |
| | | ProductConsignmentLeftBottom().then(res => { |
| | | this.tableDataBottom = res.data |
| | | this.number2 = this.tableDataBottom.length |
| | | if (this.tableDataBottom.length > 10) { |
| | | clearInterval(this.tableBottomTask) |
| | | this.getWareHouseTopBottomData() |
| | | this.getProductConsignmentLeftBottom() |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | // è·åecharts |
| | | getEcharts() { |
| | | WareHouseRightTopData().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProcureOutsourcRightTop().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | |
| | | WareHouseRightBottomData().then(res => { |
| | | loadEcharts('bar04', bar02(res.dat.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProductionStockedInRightBottom().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | |
| | | this.echartsRightTop = setInterval(() => { |
| | | WareHouseRightTopData().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProcureOutsourcRightTop().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | }, 1000 * 15) |
| | | |
| | | this.echartsRightBottom = setInterval(() => { |
| | | WareHouseRightBottomData().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProductionStockedInRightBottom().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | }, 1000 * 15) |
| | | }, |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | |
|
| | | <div style="display: flex">
|
| | | <div style="width: 300px;margin: 10px 10px 0 0;background:#fff">
|
| | |
|
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;">
|
| | | <div style="display: flex;">
|
| | | <div
|
| | | style="width: 5px;height: 100%;border-radius: 5px;"
|
| | | :style="{background:$store.state.settings.theme}"
|
| | | />
|
| | | <div style="margin-left: 8px;">åè´§æ¡£æ¡</div>
|
| | | </div>
|
| | |
|
| | | <div style="margin-right:10px">
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="æ°å¢" placement="top">
|
| | | <i class="el-icon-plus" style="cursor: pointer;color: #999" @click="treeAddClick('add')" />
|
| | | </el-tooltip>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | <el-tree
|
| | | ref="treeLeftRef"
|
| | | style="padding: 10px;overflow: auto"
|
| | | :style="{height:(tableHeight+222)+'px'}"
|
| | | :data="treeLeft"
|
| | | node-key="code"
|
| | | highlight-current
|
| | | :props="defaultPropsLeft"
|
| | | :default-expand-all="true"
|
| | | :expand-on-click-node="false"
|
| | | @node-click="getTMaterielData"
|
| | | >
|
| | | <span slot-scope="{ node, data }" class="custom-tree-node">
|
| | | <span v-if="!data.isEdit" class="ellipsis" style="width:150px;">{{ data.name }}</span>
|
| | | <span v-if="!data.isEdit">
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="ç¼è¾" placement="top">
|
| | | <i
|
| | | v-if="data.code!=='-1'"
|
| | | class="el-icon-edit"
|
| | | style="margin-right:10px;color: #999"
|
| | | @click.stop="treeEditClick(node,data,'edit')"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">
|
| | | <i
|
| | | v-if="data.code!=='-1'"
|
| | | class="el-icon-delete"
|
| | | style="margin-right: 4px;color: #999"
|
| | | @click.stop="treeDeleteClick(node,data)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </span>
|
| | | </span>
|
| | | </el-tree>
|
| | | </div>
|
| | |
|
| | | <div
|
| | | style=" width:calc(100% - 300px);"
|
| | | >
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button>
|
| | | <div style="display: flex">
|
| | | <el-button
|
| | | v-waves
|
| | | type="success"
|
| | | icon="el-icon-download"
|
| | | @click="$router.push('./../systemSetting/dataImport?fileCode=8')"
|
| | | >导å
¥
|
| | | </el-button>
|
| | | <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">忥åè´§æ¡£æ¡</el-button>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="åè´§ç¼ç " style=" display: flex;">
|
| | | <el-input v-model="form.partcode" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åè´§åç§°" style=" display: flex;">
|
| | | <el-input v-model="form.partname" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åè´§è§æ ¼" style=" display: flex;">
|
| | | <el-input v-model="form.partspec" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <!-- <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-search"
|
| | | @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())"
|
| | | >æ¥è¯¢
|
| | | </el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | style="height: 5px;"
|
| | | >
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseout'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
|
| | | <!-- @mouseenter="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseenter'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
|
| | | <!-- @click="isExpandForm=!isExpandForm"-->
|
| | | <!-- @mouseout="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | class="tableFixed"
|
| | | :data="tableData"
|
| | | :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | @sort-change="sortChange"
|
| | | >
|
| | | <!-- prop="RowNum"-->
|
| | | <el-table-column
|
| | | prop="rowNum"
|
| | | width="50"
|
| | | fixed
|
| | | label="åºå·"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partcode"
|
| | | label="åè´§ç¼ç "
|
| | | sortable="custom"
|
| | | width="110"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partname"
|
| | | label="åè´§åç§°"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | min-width="200"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partspec"
|
| | | label="è§æ ¼åå·"
|
| | | width="110"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.partspec ? row.partspec : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="idinventoryclassname"
|
| | | label="æå±ç±»å«"
|
| | | sortable="custom"
|
| | | width="110"
|
| | | />
|
| | | <el-table-column
|
| | | label="计éåä½"
|
| | | width="110"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.isSingleUnit === '0' ? row.idunitgroupname : row.idunitname }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="status"
|
| | | label="åè´§ç¶æ"
|
| | | width="110"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-tag v-if="row.status==='0'" size="small" type="success">æ£å¸¸</el-tag>
|
| | | <el-tag v-if="row.status==='1'" size="small" type="danger">åç¨</el-tag>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="åè´§å±æ§"
|
| | | sortable="custom"
|
| | | min-width="220"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.isPurchase === '1' ? 'å¤è´' : '' }}
|
| | | {{ row.isSale === '1' ? 'éå®' : '' }}
|
| | | {{ row.isMadeSelf === '1' ? 'èªå¶' : '' }}
|
| | | {{ row.isMaterial === '1' ? 'ç产æ¶è' : '' }}
|
| | | {{ row.isMadeRequest === '1' ? 'å§å¤' : '' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | label="å·¥èº"
|
| | | prop=""
|
| | |
|
| | | width="110"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | |
|
| | | <!-- <i-->
|
| | | <!-- v-if="row.is_retdproc==='Y'"-->
|
| | | <!-- :style="{color:$store.state.settings.theme}"-->
|
| | | <!-- class="el-icon-share"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- @click="routeClick(row)"-->
|
| | | <!-- />-->
|
| | |
|
| | | <i
|
| | | :style="{color:row.is_retdproc==='Y'?$store.state.settings.theme:`rgb(180 ,181, 185)`,cursor: 'pointer'}"
|
| | | class="el-icon-share"
|
| | | @click="mesSetting.route?routeClick(row):routeClick2(row)"
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <!-- <el-table-column-->
|
| | | <!-- label="æ°æ®æ¥æº"-->
|
| | | <!-- prop="data_sources"-->
|
| | | <!-- sortable="custom"-->
|
| | | <!-- width="110"-->
|
| | | <!-- />-->
|
| | | <el-table-column
|
| | | label="å建人å"
|
| | | prop="lm_user"
|
| | | sortable="custom"
|
| | | width="110"
|
| | | />
|
| | | <el-table-column
|
| | | label="å建æ¶é´"
|
| | | prop="lm_date"
|
| | | sortable="custom"
|
| | | width="160"
|
| | | />
|
| | |
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top">
|
| | | <i
|
| | | class="el-icon-edit-outline"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | @click="edit('edit',row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">
|
| | | <i
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | @click="del(row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | |
|
| | | <!--å页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes,jumper"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getTMaterielData($refs.treeLeftRef.getCurrentNode())"
|
| | | />
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <!-- åè´§ç±»å«æ°å¢ä¿®æ¹-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'"
|
| | | :visible.sync="dialogClassVisible"
|
| | | width="800px"
|
| | | :close-on-click-modal="false"
|
| | | top="15vh"
|
| | | @closed="handleClassClose"
|
| | | @close="handleClassClose"
|
| | | >
|
| | | <el-form ref="dialogClassForm" inline :rules="dialogClassFormRules" :model="dialogClassForm" label-width="80px">
|
| | | <el-form-item label="åç±»ç¼ç " prop="inventoryclasscode">
|
| | | <el-input v-model="dialogClassForm.inventoryclasscode" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åç±»åç§°" prop="inventoryclassname">
|
| | | <el-input v-model="dialogClassForm.inventoryclassname" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ä¸çº§åç±»">
|
| | | <el-select
|
| | | v-model="dialogClassForm.parentcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | :popper-append-to-body="false"
|
| | | clearable
|
| | | >
|
| | | <el-option
|
| | | v-for="item in treeLeftArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleClassCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleClassConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- åè´§æ¡£æ¡æ°å¢ä¿®æ¹-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="1200px"
|
| | | :close-on-click-modal="false"
|
| | | top="15vh"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | |
|
| | | <el-form ref="dialogForm" class="" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
|
| | | <el-divider content-position="left">åºæ¬ä¿¡æ¯</el-divider>
|
| | | <el-form-item label="åè´§ç¼ç " prop="partcode">
|
| | | <el-input v-model="dialogForm.partcode" :disabled="operation!=='add'" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åè´§åç§°" prop="partname">
|
| | | <el-input v-model="dialogForm.partname" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="è§æ ¼åå·">
|
| | | <el-input v-model="dialogForm.partspec" style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æå±ç±»å«" prop="inventoryclasscode">
|
| | | <el-select
|
| | | v-model="dialogForm.inventoryclasscode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in treeLeftArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="æå±ä»åº" prop="idwarehouse">
|
| | | <el-select
|
| | | v-model="dialogForm.idwarehouse"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idwarehouseArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item required label="åè´§ç¶æ">
|
| | | <el-radio-group v-model="dialogForm.status">
|
| | | <el-radio label="0">æ£å¸¸</el-radio>
|
| | | <el-radio label="1">åç¨</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | |
|
| | | <el-divider content-position="left">计éåä½</el-divider>
|
| | | <el-form-item label="è®¡éæ¹å¼" required prop="unittypcode">
|
| | | <el-select
|
| | | v-model="dialogForm.unittypcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | @change="unittypcodeChange"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in unittypcodeArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item :label="dialogForm.unittypcode==='1'? '计éåä½':'计éåä½ç»'" prop="unitcode">
|
| | | <el-select
|
| | | v-if="dialogForm.unittypcode==='1'"
|
| | | v-model="dialogForm.unitcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | @change="val=>unitcodeChange(val,'1')"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in unitcodeSingleArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | <el-select
|
| | | v-if="dialogForm.unittypcode!=='1'"
|
| | | v-model="dialogForm.unitcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | @change="val=>unitcodeChange(val,'0')"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in unitcodeGroupArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="æ¥è¡¨è¾
åä½">
|
| | | <el-select
|
| | | v-model="dialogForm.idSubUnitByReport"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.unittypcode==='1'"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idSubUnitByReportArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="åºå常ç¨åä½">
|
| | | <el-select
|
| | | v-model="dialogForm.idUnitByStock"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.unittypcode==='1'"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idUnitBvStockArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="éè´å¸¸ç¨åä½">
|
| | | <el-select
|
| | | v-model="dialogForm.idUnitByPurchase"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.unittypcode==='1'"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idUnitBvStockArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="éå®å¸¸ç¨åä½">
|
| | | <el-select
|
| | | v-model="dialogForm.idUnitBySale"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.unittypcode==='1'"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idUnitBvStockArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="ç产常ç¨åä½">
|
| | | <el-select
|
| | | v-model="dialogForm.idunitbymanufacture"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.unittypcode==='1'"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in idUnitBvStockArr"
|
| | | :key="item.unitcode"
|
| | | :label="item.unitname"
|
| | | :value="item.unitcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-divider content-position="left">åè´§å±æ§</el-divider>
|
| | | <el-checkbox v-model="dialogForm.isPurchase" style="margin-left: 70px;">å¤è´</el-checkbox>
|
| | | <el-checkbox v-model="dialogForm.isSale">éå®</el-checkbox>
|
| | | <el-checkbox v-model="dialogForm.isMadeSelf">èªå¶</el-checkbox>
|
| | | <el-checkbox v-model="dialogForm.isMaterial">ç产æ¶è</el-checkbox>
|
| | | <el-checkbox v-model="dialogForm.isMadeRequest">å§å¤</el-checkbox>
|
| | | <!-- <el-divider content-position="left">åè´§æè¿°</el-divider>-->
|
| | | <!-- <el-form-item label="åè´§æè¿°">-->
|
| | | <!-- <el-input-->
|
| | | <!-- v-model="dialogForm.username"-->
|
| | | <!-- type="textarea"-->
|
| | | <!-- :autosize="{ minRows: 2, maxRows: 4}"-->
|
| | | <!-- style="width: 490px;"-->
|
| | | <!-- />-->
|
| | | <!-- </el-form-item>-->
|
| | |
|
| | | </el-form>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- å·¥èºè·¯çº¿å¯¹è¯æ¡-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :close-on-click-modal="false"
|
| | | title="å
³èå·¥èºè·¯çº¿"
|
| | | :visible.sync="dialogVisibleRoute"
|
| | | width="800px"
|
| | | top="5vh"
|
| | | class="dialogVisibleRoute"
|
| | | @closed="handleCloseRoute"
|
| | | @close="handleCloseRoute"
|
| | | >
|
| | | <div>
|
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 产ååç§°ï¼{{
|
| | | dialogFormRoute.projectName
|
| | | }}
|
| | | </div>
|
| | | <el-divider />
|
| | | <div style="margin-bottom: 10px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> å·¥èºè·¯çº¿éå
|
| | | </div>
|
| | |
|
| | | <div class="myCheckboxGroup">
|
| | | <div
|
| | | v-for="item in dialogFormRoute.routeOperationArr"
|
| | | :key="item.code"
|
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
|
| | | class="myCheckbox"
|
| | | @click="myCheckboxClick(item)"
|
| | | >
|
| | | <!-- <input-->
|
| | | <!-- class="myCheckboxInput"-->
|
| | | <!-- type="checkbox"-->
|
| | | <!-- :value="item.code"-->
|
| | | <!-- :name="item.name"-->
|
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
|
| | | <!-- @click="myCheckboxInputClick(item)"-->
|
| | | <!-- >{{ item.name }}-->
|
| | | <!-- ç¶åç¹å»äºä»¶ä¸å½±å-->
|
| | | <!-- onClick="event.cancelBubble = true"-->
|
| | | <el-checkbox
|
| | | :key="item.code"
|
| | | v-model="item.isSelected2"
|
| | | class="myCheckboxInput"
|
| | | :value="item.code"
|
| | | :name="item.name"
|
| | | :label="item.name"
|
| | | :checked="item.isSelected2"
|
| | | @change="myCheckboxInputClick(item)"
|
| | | />
|
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <el-divider />
|
| | | <div>
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> é»è®¤å·¥èºè·¯çº¿
|
| | | </div>
|
| | | <div style="margin-top: 20px">
|
| | | <el-select
|
| | | v-model="defaultroute_code"
|
| | | filterable
|
| | | style="width: 200px;"
|
| | | placeholder="è¯·éæ©"
|
| | | class="defaultroute_code"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in defaultroute_codeArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </div>
|
| | | <el-divider />
|
| | | <div style="margin-bottom: 10px">
|
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> å·¥åºå表
|
| | | </div>
|
| | | <div style="overflow-y: scroll">
|
| | | <el-table
|
| | | ref="projectTableData"
|
| | | :data="projectTableData"
|
| | | border
|
| | | height="280"
|
| | | :row-class-name="tableRowClassName"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | prop="seq"
|
| | | width="100"
|
| | | label="å·¥åºåºå·"
|
| | | fixed
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepcode"
|
| | | show-tooltip-when-overflow
|
| | | label="å·¥åºç¼ç "
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="å·¥åºåç§°"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | prop="enable"
|
| | | label="å¯ç¨ç¶æ"
|
| | | show-tooltip-when-overflow
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.enable==='Y'">
|
| | | <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
|
| | | æ¯
|
| | | </div>
|
| | | <div v-if="row.enable==='N'">
|
| | | <i class="el-icon-info" style="margin-right: 2px" />
|
| | | å¦
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="routeDialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="routeDialogVisibleConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- æå·¥èºèµ° å·¥åºå¯¹è¯æ¡-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :close-on-click-modal="false"
|
| | | title="å
³èå·¥åº"
|
| | | :visible.sync="dialogVisibleStep"
|
| | | width="800px"
|
| | | top="15vh"
|
| | | class="dialogVisibleStep"
|
| | | @closed="handleCloseStep"
|
| | | @close="handleCloseStep"
|
| | | >
|
| | |
|
| | | <div style="display: flex;align-items: center">
|
| | | <div style="font-weight: bolder">å·¥åºéæ©ï¼</div>
|
| | | <el-drag-select
|
| | | v-model="stepSelectedValue"
|
| | | style="width:570px;"
|
| | | multiple
|
| | | placeholder="è¯·éæ©ç¸å¯¹åºå·¥åº"
|
| | | >
|
| | | <!-- :disabled="!(dialogForm.mesorderstus==='NEW'||dialogForm.mesorderstus==='ALLO')"-->
|
| | | <el-option
|
| | | v-for="item in stepSelectArr"
|
| | | :key="item.stepcode"
|
| | | :label="item.stepname"
|
| | | :value="item.stepcode"
|
| | | />
|
| | | </el-drag-select>
|
| | | </div>
|
| | |
|
| | | <el-table
|
| | | ref="stepTableDataRef"
|
| | | :data="stepTableData"
|
| | | border
|
| | | :row-class-name="tableRowClassName"
|
| | | height="300"
|
| | | style="width: 100%;margin-top: 15px;"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | row-key="stepcode"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | label="åºå·"
|
| | | width="50"
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepcode"
|
| | | show-tooltip-when-overflow
|
| | | label="å·¥åºç¼ç "
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="å·¥åºåç§°"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="stepprice"-->
|
| | | <!-- label="ç产åä»·"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <el-input-->
|
| | | <!-- v-model="row.stepprice"-->
|
| | | <!-- placeholder="请è¾å
¥å·¥åºåä»·"-->
|
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"-->
|
| | | <!-- style="width: 100%"-->
|
| | | <!-- @click.stop=""-->
|
| | | <!-- />-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | width="120"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <!-- <el-tooltip class="item" effect="dark" content="ç§»å¨" placement="top">-->
|
| | | <i
|
| | | class="el-icon-rank"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="cursor: move"
|
| | | />
|
| | | <!-- </el-tooltip>-->
|
| | | <!-- @click="edit('edit',row)"-->
|
| | |
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">
|
| | | <i
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="margin-left: 15px;"
|
| | | @click="stepDel(row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="stepDialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="stepDialogVisibleConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import waves from '@/directive/waves'
|
| | | import Pagination from '@/components/Pagination'
|
| | | import { validateCode } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import {
|
| | | SaveTMaterielFile,
|
| | | TMaterielAddUpdate,
|
| | | TMaterielClassTree,
|
| | | TMaterielClassTreeAddUpdate,
|
| | | TMaterielClassTreeDelete,
|
| | | TMaterielData, TMaterielDelete, TMaterielFileAssociationRoute
|
| | | } from '@/api/ProductModel'
|
| | | import arrayToTree from 'array-to-tree'
|
| | | import { StepData, UnitSerch, WareHouse } from '@/api/GeneralBasicData'
|
| | | import { SaveSearchMateriel_Info } from '@/api/ErpSyncMes'
|
| | | import $ from 'jquery'
|
| | | import Sortable from 'sortablejs'
|
| | | import ElDragSelect from '@/components/DragSelect'
|
| | |
|
| | | export default {
|
| | | name: 'InventoryList',
|
| | | directives: { waves, elDragDialog },
|
| | | components: {
|
| | | Pagination, ElDragSelect
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | mouseHoverType: 'mouseout',
|
| | | isExpandForm: false,
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | operation: '',
|
| | |
|
| | | treeLeft: [
|
| | | {
|
| | | code: '-1',
|
| | | name: 'å
¨é¨'
|
| | | }
|
| | | ], // 左侧æ
|
| | | treeLeftArr: [],
|
| | | defaultPropsLeft: {
|
| | | children: 'children',
|
| | | label: 'name'
|
| | | },
|
| | |
|
| | | tableData: [],
|
| | | form: {
|
| | | inventoryclasscode: '',
|
| | | partcode: '',
|
| | | partname: '',
|
| | | partspec: '',
|
| | | page: 1,
|
| | | rows: 20,
|
| | | prop: 'lm_date', // æåºå段
|
| | | order: 'desc' // æåºå段
|
| | | },
|
| | | total: 0,
|
| | | dialogClassVisible: false,
|
| | | dialogClassForm: {
|
| | | data_sources: '', // æ°æ®æ¥æº:ERP/MES
|
| | | inventoryclasscode: '', // åè´§åç±»ç¼ç
|
| | | inventoryclassname: '', // åè´§åç±»åç§°
|
| | | parentcode: '', // ä¸çº§åç±»ç¼ç
|
| | | OperType: ''// OperType
|
| | | },
|
| | | classArr: [],
|
| | | dialogClassFormRules: {
|
| | | inventoryclasscode: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | inventoryclassname: [
|
| | | { required: true, message: '请è¾åè´§ç±»ååç§°', trigger: ['blur', 'change'] }
|
| | | ]
|
| | | },
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | data_sources: 'MES', // æ°æ®æ¥æºï¼ERP/MES
|
| | | partcode: '', // åè´§ç¼ç
|
| | | partname: '', // åè´§åç§°
|
| | | partspec: '', // è§æ ¼åå·
|
| | | inventoryclasscode: '', // åè´§ç±»åç¼ç
|
| | | unittypcode: '1', // è®¡éæ¹å¼(0:å¤è®¡é,1:å计é)
|
| | | unitcode: '', // 计éåä½ç¼ç /计éåä½ç»ç¼ç
|
| | | unitsubcode: '', // 计éåä½ç»å项ç¼ç ï¼å¯¹åºçæ¯ ä¸»è®¡éåä½ç¼ç ï¼
|
| | | idSubUnitByReport: '', // æ¥è¡¨è¾
åä½ç¼ç
|
| | | idUnitByStock: '', // åºå常ç¨åä½ç¼ç
|
| | | idUnitByPurchase: '', // éè´å¸¸ç¨åä½ç¼ç
|
| | | idUnitBySale: '', // éå®å¸¸ç¨åä½ç¼ç
|
| | | idunitbymanufacture: '', // ç产常ç¨åä½
|
| | | isPurchase: false, // æ¯å¦å¤è´: 0(å¦)1(æ¯)
|
| | | isSale: false, // æ¯å¦éå®:0(å¦)1(æ¯)
|
| | | isMadeSelf: false, // æ¯å¦èªå¶: 0(å¦)1(æ¯)
|
| | | isMaterial: false, // æ¯å¦ç产èç¨: 0(å¦)1(æ¯)
|
| | | isMadeRequest: false, // æ¯å¦å§å¤ï¼0(å¦)1(æ¯)
|
| | | idwarehouse: '', // ä»åºç¼ç
|
| | | status: '0', // 使ç¨ç¶æ: æ£å¸¸(0)åç¨(1)
|
| | | OperType: '' // æä½ç±»å
|
| | | },
|
| | | dialogFormRules: {
|
| | | partcode: [
|
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] }
|
| | | ],
|
| | | partname: [
|
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | unitcode: [
|
| | | { required: true, message: 'è¯·éæ©è®¡éåä½(ç»)', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | inventoryclasscode: [
|
| | | { required: true, message: 'è¯·éæ©æå±åä½', trigger: ['blur', 'change'] }
|
| | | ]
|
| | | },
|
| | | unittypcodeArr: [
|
| | | { code: '1', name: 'å计é' },
|
| | | { code: '0', name: 'å¤è®¡é' }
|
| | | ],
|
| | | unitcodeSingleArr: [],
|
| | | unitcodeGroupArr: [],
|
| | | idSubUnitByReportArr: [],
|
| | | idUnitBvStockArr: [],
|
| | | idwarehouseArr: [],
|
| | |
|
| | | // å·¥èº
|
| | | dialogVisibleRoute: false,
|
| | | dialogFormRoute: {
|
| | | projectName: '', // 产ååç§°
|
| | | projectCode: '', // 产å代ç
|
| | | routeOperationArr: [] // å·¥èºè·¯çº¿éå
|
| | | // routeOperationSelectedArr: [] // å·¥èºè·¯çº¿éä¸éåæ°ç»
|
| | | },
|
| | | defaultroute_code: '', // é»è®¤å·¥èºè·¯çº¿éä¸å¼
|
| | | defaultroute_codeArr: '', // é»è®¤å·¥èºè·¯çº¿æ°ç»
|
| | | projectTableData: [], // å·¥åºå表
|
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
|
| | |
|
| | | // æå·¥åºèµ°
|
| | | dialogVisibleStep: false,
|
| | | stepTableData: [],
|
| | | sortable: null,
|
| | | stepSelectArr: [], // å·¥åºä¸ææ°æ®
|
| | | stepSelectedValue: [] // å·¥åºä¸æéä¸å¼
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | 'stepSelectedValue': {
|
| | | // deep: true,
|
| | | handler: function(val) {
|
| | | // do something with the new and old value of stepSelectedValue
|
| | | console.log(val, 1)
|
| | | const arr = JSON.parse(JSON.stringify(this.stepTableData))
|
| | | const arrStepcode = arr.map(i => i.stepcode)
|
| | | this.stepTableData = []
|
| | | val.forEach(i => {
|
| | | this.stepTableData.push(
|
| | | {
|
| | | stepcode: i,
|
| | | stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname
|
| | | // stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0
|
| | | }
|
| | | )
|
| | | })
|
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | |
|
| | | this.getTMaterielClassTree()
|
| | | this.getSelectApi()
|
| | | },
|
| | | methods: {
|
| | | // å·¥èºç¹å» ,æå·¥åºèµ°
|
| | | async routeClick2(row) {
|
| | | this.dialogVisibleStep = true
|
| | | this.dialogFormRoute.projectCode = row.partcode
|
| | |
|
| | | const res = await TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode })
|
| | | if (res.code === '200' && res.data.length > 0) {
|
| | | this.stepSelectedValue = res.data.map(i => i.step_code)
|
| | | }
|
| | |
|
| | | // æå¨è¡¨æ ¼
|
| | | this.$nextTick(() => {
|
| | | this.setSort()
|
| | | })
|
| | | },
|
| | |
|
| | | stepDialogVisibleCancel() {
|
| | | this.dialogVisibleStep = false
|
| | | },
|
| | |
|
| | | async stepDialogVisibleConfirm() {
|
| | | if (this.stepSelectedValue.length === 0) {
|
| | | return this.$message.info('å·¥åºè³å°è¦æä¸éï¼')
|
| | | }
|
| | | const children = []
|
| | | this.stepSelectedValue.forEach((item, index) => {
|
| | | const t = this.stepSelectArr.find(i => i.stepcode === item)
|
| | | children.push({
|
| | | 'code': t.stepcode,
|
| | | 'name': t.stepname,
|
| | | 'seq': index + 1,
|
| | | 'isbott': index === 0 ? 'Y' : 'N',
|
| | | 'isend': index === this.stepSelectedValue.length - 1 ? 'Y' : 'N'
|
| | | })
|
| | | })
|
| | | const data = [
|
| | | {
|
| | | 'partcode': this.dialogFormRoute.projectCode,
|
| | | 'defaultroute_code': '',
|
| | | 'children': children
|
| | | }
|
| | | ]
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SaveTMaterielFile(data)
|
| | | if (res.code === '200') {
|
| | | this.dialogVisibleStep = false
|
| | | this.$message.success('ä¿åæåï¼')
|
| | | await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | }
|
| | | },
|
| | | // å·¥åºå é¤
|
| | | stepDel(row) {
|
| | | const index = this.stepSelectedValue.findIndex(i => i === row.stepcode)
|
| | | this.stepSelectedValue.splice(index, 1)
|
| | | },
|
| | | handleCloseStep() {
|
| | | this.stepTableData = []
|
| | | this.sortable = null
|
| | | this.stepSelectedValue = []
|
| | | },
|
| | |
|
| | | setSort() {
|
| | | const el = this.$refs.stepTableDataRef.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
|
| | | this.sortable = Sortable.create(el, {
|
| | | ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
| | | setData: function(dataTransfer) {
|
| | | // to avoid Firefox bug
|
| | | // Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
| | | dataTransfer.setData('Text', '')
|
| | | },
|
| | | onEnd: evt => {
|
| | | const targetRow = this.stepTableData.splice(evt.oldIndex, 1)[0]
|
| | | this.stepTableData.splice(evt.newIndex, 0, targetRow)
|
| | |
|
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
|
| | | // for show the changes, you can delete in you code
|
| | | // const tempIndex = this.newList.splice(evt.oldIndex, 1)[0]
|
| | | // this.newList.splice(evt.newIndex, 0, tempIndex)
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | tableRowClassName({ row, rowIndex }) {
|
| | | return 'custom-row'
|
| | | },
|
| | |
|
| | | /* ç¹å»å
³èå·¥èºè·¯çº¿æ¨¡å*/
|
| | | // å·¥èºè·¯çº¿ç¹å»
|
| | | routeClick(row) {
|
| | | const loading = this.$loading({
|
| | | lock: true,
|
| | | text: 'æ£å¨å è½½æ°æ®ï¼è¯·ç¨ç...',
|
| | | spinner: 'el-icon-loading',
|
| | | customClass: 'osloading',
|
| | | background: 'rgba(0, 0, 0, 0.7)'
|
| | | })
|
| | |
|
| | | this.defaultroute_code = row.default_route
|
| | | this.dialogFormRoute.projectCode = row.partcode
|
| | | this.dialogFormRoute.projectName = row.partname
|
| | |
|
| | | TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }).then(res => {
|
| | | if (res.code === '200') {
|
| | | setTimeout(() => {
|
| | | loading.close()
|
| | | this.dialogVisibleRoute = true
|
| | | this.dialogFormRoute.routeOperationArr = res.data
|
| | | // let waitFlag = false// åæ¾çå¾
æ¯å¦æ¾è¡
|
| | |
|
| | | this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
|
| | | item.isSelected1 = false
|
| | | item.isSelected2 = false
|
| | | if (index === 0) {
|
| | | item.isSelected1 = true
|
| | | this.projectTableData = item.Data
|
| | | }
|
| | | if (item.flag === 'Y') {
|
| | | item.isSelected2 = true
|
| | | this.$nextTick(() => {
|
| | | $('input:checkbox').eq(index).prop('checked', true)
|
| | | })
|
| | |
|
| | | // const interval = setInterval(() => {
|
| | | // if ($('input:checkbox').length > 0) {
|
| | | // waitFlag = true
|
| | | // }
|
| | | // if (waitFlag) {
|
| | | // clearInterval(interval)
|
| | | // this.$nextTick(() => {
|
| | | // $('input:checkbox').eq(index).prop('checked', true)
|
| | | // })
|
| | | // }
|
| | | // }, 100)
|
| | | }
|
| | | })
|
| | |
|
| | | this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y')
|
| | | }, 1000)
|
| | | } else {
|
| | | loading.close()
|
| | | }
|
| | | })
|
| | | },
|
| | | // å¯¹è¯æ¡å
³é
|
| | | handleCloseRoute() {
|
| | | this.dialogFormRoute.routeOperationArr = []
|
| | | this.defaultroute_codeArr = []
|
| | | },
|
| | | // åæ¶
|
| | | routeDialogVisibleCancel() {
|
| | | this.dialogVisibleRoute = false
|
| | | },
|
| | | // ç¡®å®
|
| | | async routeDialogVisibleConfirm() {
|
| | | if (!this.defaultroute_code || this.defaultroute_code === 'null') {
|
| | | return this.$message.info('é»è®¤å·¥èºè·¯çº¿ä¸è½ä¸ºç©ºï¼')
|
| | | }
|
| | |
|
| | | // æäº¤æ ¼å¼
|
| | | const data = []
|
| | | this.dialogFormRoute.routeOperationArr.forEach(item => {
|
| | | if (item.isSelected2) {
|
| | | data.push({ code: item.code, name: item.name })
|
| | | }
|
| | | })
|
| | |
|
| | | const D = [{
|
| | | 'partcode': this.dialogFormRoute.projectCode,
|
| | | 'defaultroute_code': this.defaultroute_code,
|
| | | 'children': data
|
| | | }]
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SaveTMaterielFile(D)
|
| | | if (res.code === '200') {
|
| | | this.dialogVisibleRoute = false
|
| | | this.$message.success('ä¿åæåï¼')
|
| | | await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | }
|
| | | },
|
| | | // 大çåç¹å»äºä»¶
|
| | | myCheckboxClick(val) {
|
| | | console.log(val, 1)
|
| | | this.dialogFormRoute.routeOperationArr.forEach(item => {
|
| | | item.isSelected1 = val.code === item.code
|
| | | })
|
| | |
|
| | | this.projectTableData = val.Data
|
| | | },
|
| | | // å°çåç¹å»äºä»¶
|
| | | myCheckboxInputClick(val) {
|
| | | // console.log(val, 2)
|
| | | val.isSelected2 = !!val.isSelected2
|
| | |
|
| | | this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
|
| | | if (val.code === item.code) {
|
| | | item.flag = !item.flag
|
| | | }
|
| | | })
|
| | | if (val.code === this.defaultroute_code) {
|
| | | this.defaultroute_code = ''
|
| | | }
|
| | | this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
|
| | | },
|
| | |
|
| | | async getSelectApi() {
|
| | | const { data: res } = await UnitSerch({ tunittype: 'M' })
|
| | | this.unitcodeGroupArr = res
|
| | |
|
| | | const { data: res2 } = await UnitSerch({ tunittype: 'S' })
|
| | | this.unitcodeSingleArr = res2
|
| | |
|
| | | const { data: res3 } = await WareHouse()
|
| | | this.idwarehouseArr = res3
|
| | |
|
| | | // è·åå·¥åº
|
| | | const { data: res4 } = await StepData()
|
| | | this.stepSelectArr = res4
|
| | | },
|
| | |
|
| | | async getTMaterielClassTree() {
|
| | | const res = await TMaterielClassTree()
|
| | | res.data.forEach(i => {
|
| | | i.idparent = i.idparent ? i.idparent : '-1'
|
| | | })
|
| | | this.treeLeftArr = res.data
|
| | | this.treeLeftArr.forEach(e => {
|
| | | e.name = e.code + ' ' + e.name
|
| | | })
|
| | | this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), {
|
| | | parentProperty: 'idparent',
|
| | | customID: 'code',
|
| | | childrenProperty: 'children'
|
| | | })
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.$refs.treeLeftRef.setCurrentKey('-1')
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | })
|
| | | },
|
| | | async getTMaterielData(node) {
|
| | | const result = this.getChildrenCodeMethod(node, [])
|
| | | if (result.includes('-1')) {
|
| | | result.shift()
|
| | | }
|
| | | this.form.inventoryclasscode = result.join(',')
|
| | | const res = await TMaterielData(this.form)
|
| | |
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | },
|
| | |
|
| | | // è·å页é¢é«åº¦
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 280
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | },
|
| | | // æ°å¢æé®
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.dialogForm.OperType = 'Add'
|
| | | },
|
| | | // ä¿®æ¹æé®
|
| | | async edit(operation, row) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | this.dialogForm.OperType = 'Update'
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.dialogForm.data_sources = row.data_sources
|
| | | this.dialogForm.partcode = row.partcode
|
| | | this.dialogForm.partname = row.partname
|
| | | this.dialogForm.partspec = row.partspec
|
| | | this.dialogForm.inventoryclasscode = row.idinventoryclasscode
|
| | | this.dialogForm.unittypcode = row.isSingleUnit
|
| | | // è®¡éæ¹å¼(0:å¤è®¡é,1:å计é)
|
| | | if (this.dialogForm.unittypcode === '1') {
|
| | | this.dialogForm.unitcode = row.idunitcode
|
| | | this.dialogForm.unitsubcode = ''
|
| | | this.dialogForm.idSubUnitByReport = ''
|
| | | const unitname = this.unitcodeSingleArr.find(i => i.unitcode === this.dialogForm.unitcode).unitname
|
| | |
|
| | | this.dialogForm.idUnitByStock = unitname
|
| | | this.dialogForm.idUnitByPurchase = unitname
|
| | | this.dialogForm.idUnitBySale = unitname
|
| | | this.dialogForm.idunitbymanufacture = unitname
|
| | | }
|
| | |
|
| | | if (this.dialogForm.unittypcode === '0') {
|
| | | this.dialogForm.unitcode = row.idunitgroupcode
|
| | |
|
| | | const t = this.unitcodeGroupArr.find(i => i.unitcode === this.dialogForm.unitcode).children
|
| | |
|
| | | this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1')
|
| | | this.idUnitBvStockArr = t
|
| | |
|
| | | const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode
|
| | | this.dialogForm.unitsubcode = mainUnitCode
|
| | | this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode
|
| | |
|
| | | this.dialogForm.idUnitByStock = mainUnitCode
|
| | | this.dialogForm.idUnitByPurchase = mainUnitCode
|
| | | this.dialogForm.idUnitBySale = mainUnitCode
|
| | | this.dialogForm.idunitbymanufacture = mainUnitCode
|
| | | }
|
| | |
|
| | | this.dialogForm.isPurchase = row.isPurchase === '1'
|
| | | this.dialogForm.isSale = row.isSale === '1'
|
| | | this.dialogForm.isMadeSelf = row.isMadeSelf === '1'
|
| | | this.dialogForm.isMaterial = row.isMaterial === '1'
|
| | | this.dialogForm.isMadeRequest = row.isMadeRequest === '1'
|
| | |
|
| | | this.dialogForm.idwarehouse = row.idwarehousecode
|
| | | this.dialogForm.status = row.status
|
| | | })
|
| | | },
|
| | | del(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | TMaterielDelete({ partcode: row.partcode, data_sources: row.data_sources }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('å 餿å!')
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已忶å é¤')
|
| | | })
|
| | | },
|
| | | reset() {
|
| | | this.form.inventoryclasscode = ''
|
| | | this.form.partcode = ''
|
| | | this.form.partname = ''
|
| | | this.form.partspec = ''
|
| | | this.$refs.treeLeftRef.setCurrentKey('-1')
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | },
|
| | | // å¯¹è¯æ¡å
³éäºä»¶
|
| | | handleClose() {
|
| | | this.dialogForm.data_sources = 'MES'
|
| | | this.dialogForm.partcode = ''
|
| | | this.dialogForm.partname = ''
|
| | | this.dialogForm.partspec = ''
|
| | | this.dialogForm.inventoryclasscode = ''
|
| | | this.dialogForm.unittypcode = '1'
|
| | | this.dialogForm.unitcode = ''
|
| | | this.dialogForm.unitsubcode = ''
|
| | | this.dialogForm.idSubUnitByReport = ''
|
| | | this.dialogForm.idUnitByStock = ''
|
| | | this.dialogForm.idUnitByPurchase = ''
|
| | | this.dialogForm.idUnitBySale = ''
|
| | | this.dialogForm.idunitbymanufacture = ''
|
| | | this.dialogForm.isPurchase = false
|
| | | this.dialogForm.isSale = false
|
| | | this.dialogForm.isMadeSelf = false
|
| | | this.dialogForm.isMaterial = false
|
| | | this.dialogForm.isMadeRequest = false
|
| | | this.dialogForm.idwarehouse = ''
|
| | | this.dialogForm.status = '0'
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // å¯¹è¯æ¡åæ¶
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // å¯¹è¯æ¡ç¡®è®¤
|
| | | dialogVisibleConfirm() {
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | if (!(this.dialogForm.isPurchase || this.dialogForm.isSale || this.dialogForm.isMadeSelf || this.dialogForm.isMaterial || this.dialogForm.isMadeRequest)) {
|
| | | return this.$message.info('åè´§å±æ§ä¸è½ä¸ºç©ºï¼')
|
| | | }
|
| | | this.dialogForm.isPurchase = this.dialogForm.isPurchase ? '1' : '0'
|
| | | this.dialogForm.isSale = this.dialogForm.isSale ? '1' : '0'
|
| | | this.dialogForm.isMadeSelf = this.dialogForm.isMadeSelf ? '1' : '0'
|
| | | this.dialogForm.isMaterial = this.dialogForm.isMaterial ? '1' : '0'
|
| | | this.dialogForm.isMadeRequest = this.dialogForm.isMadeRequest ? '1' : '0'
|
| | | // console.log(JSON.parse(JSON.stringify(this.dialogForm)), 1)
|
| | |
|
| | | if (this.dialogForm.unittypcode === '1') {
|
| | | this.dialogForm.idUnitByStock = this.dialogForm.unitcode
|
| | | this.dialogForm.idUnitByPurchase = this.dialogForm.unitcode
|
| | | this.dialogForm.idUnitBySale = this.dialogForm.unitcode
|
| | | this.dialogForm.idunitbymanufacture = this.dialogForm.unitcode
|
| | | }
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | TMaterielAddUpdate(this.dialogForm).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼')
|
| | | this.dialogVisible = false
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | // éå½ååéçææcode
|
| | | getChildrenCodeMethod(node, result) {
|
| | | result.push(node.code)
|
| | | if (node.children && node.children.length > 0) {
|
| | | node.children.forEach(i => {
|
| | | this.getChildrenCodeMethod(i, result)
|
| | | })
|
| | | }
|
| | | return result
|
| | | },
|
| | |
|
| | | treeEditClick(node, data, operation) {
|
| | | this.dialogClassForm.data_sources = data.data_sources
|
| | | this.dialogClassForm.inventoryclasscode = data.code
|
| | | this.dialogClassForm.inventoryclassname = data.name.split(' ')[1]
|
| | | this.dialogClassForm.parentcode = data.idparent === '-1' ? '' : data.idparent
|
| | | this.dialogClassForm.OperType = 'Update'
|
| | | this.operation = operation
|
| | | this.dialogClassVisible = true
|
| | | },
|
| | | treeDeleteClick(node, data) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | const result = this.getChildrenCodeMethod(data, [])
|
| | | TMaterielClassTreeDelete({ inventoryclasscode: result.join(',') }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('å 餿å!')
|
| | | this.getTMaterielClassTree()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$notify.info('已忶å é¤')
|
| | | })
|
| | | },
|
| | | treeAddClick(operation) {
|
| | | this.operation = operation
|
| | | this.dialogClassVisible = true
|
| | | this.dialogClassForm.OperType = 'Add'
|
| | | this.dialogClassForm.data_sources = 'MES'
|
| | | },
|
| | |
|
| | | handleClassClose() {
|
| | | this.dialogClassForm.data_sources = ''
|
| | | this.dialogClassForm.inventoryclasscode = ''
|
| | | this.dialogClassForm.inventoryclassname = ''
|
| | | this.dialogClassForm.parentcode = ''
|
| | | this.dialogClassForm.OperType = ''
|
| | | this.$refs.dialogClassForm.clearValidate()
|
| | | },
|
| | | dialogVisibleClassCancel() {
|
| | | this.dialogClassVisible = false
|
| | | },
|
| | | dialogVisibleClassConfirm() {
|
| | | this.$refs.dialogClassForm.validate(valid => {
|
| | | if (valid) {
|
| | | TMaterielClassTreeAddUpdate(this.dialogClassForm).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼')
|
| | | this.dialogClassVisible = false
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.getTMaterielClassTree()
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | unittypcodeChange(val) {
|
| | | console.log(val)
|
| | |
|
| | | this.dialogForm.unitcode = ''
|
| | | this.dialogForm.unitsubcode = ''
|
| | | this.dialogForm.idSubUnitByReport = ''
|
| | | this.dialogForm.idUnitByStock = ''
|
| | | this.dialogForm.idUnitByPurchase = ''
|
| | | this.dialogForm.idUnitBySale = ''
|
| | | this.dialogForm.idunitbymanufacture = ''
|
| | | // this.$refs.dialogForm.clearValidate()
|
| | | // this.$forceUpdate()
|
| | | },
|
| | | unitcodeChange(val, type) {
|
| | | console.log(val)
|
| | |
|
| | | if (type === '1') {
|
| | | // this.dialogForm.unitcode = val
|
| | | this.dialogForm.unitsubcode = ''
|
| | | this.dialogForm.idSubUnitByReport = ''
|
| | |
|
| | | const unitname = this.unitcodeSingleArr.find(i => i.unitcode === val).unitname
|
| | |
|
| | | this.dialogForm.idUnitByStock = unitname
|
| | | this.dialogForm.idUnitByPurchase = unitname
|
| | | this.dialogForm.idUnitBySale = unitname
|
| | | this.dialogForm.idunitbymanufacture = unitname
|
| | | }
|
| | |
|
| | | if (type === '0') {
|
| | | const t = this.unitcodeGroupArr.find(i => i.unitcode === val).children
|
| | |
|
| | | this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1')
|
| | | this.idUnitBvStockArr = t
|
| | |
|
| | | const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode
|
| | | this.dialogForm.unitsubcode = mainUnitCode
|
| | | this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode
|
| | |
|
| | | this.dialogForm.idUnitByStock = mainUnitCode
|
| | | this.dialogForm.idUnitByPurchase = mainUnitCode
|
| | | this.dialogForm.idUnitBySale = mainUnitCode
|
| | | this.dialogForm.idunitbymanufacture = mainUnitCode
|
| | | }
|
| | | },
|
| | | // 忥ERP
|
| | | syncERP() {
|
| | | const loading = this.$loading({
|
| | | lock: true,
|
| | | text: 'æ£å¨åæ¥ERPï¼è¯·ç¨ç...',
|
| | | spinner: 'el-icon-loading',
|
| | | customClass: 'osloading',
|
| | | background: 'rgba(0, 0, 0, 0.7)'
|
| | | })
|
| | |
|
| | | SaveSearchMateriel_Info().then(res => {
|
| | | if (res.code === '200') {
|
| | | setTimeout(() => {
|
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
|
| | | this.getTMaterielClassTree()
|
| | | loading.close()
|
| | | this.$notify.success('忥æåï¼')
|
| | | }, 2000)
|
| | | }
|
| | | // else if (res.code === '300') {
|
| | | // setTimeout(() => {
|
| | | // loading.close()
|
| | | // this.$message.error('åæ¥å¤±è´¥ï¼')
|
| | | // }, 10000)
|
| | | // }
|
| | | }).catch(e => {
|
| | | loading.close()
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped lang="scss">
|
| | | $main_color: #42b983;
|
| | | .custom-tree-node {
|
| | | flex: 1;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | font-size: 14px;
|
| | | padding-right: 8px;
|
| | | }
|
| | |
|
| | | //::v-deep .el-checkbox__label {
|
| | | // width: 55px;
|
| | | //}
|
| | | //
|
| | | .el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover {
|
| | | color: #000 !important;
|
| | | }
|
| | |
|
| | | .dialogVisibleRoute {
|
| | | .myCheckboxGroup {
|
| | | display: flex;
|
| | | flex-wrap: wrap;
|
| | |
|
| | | .myCheckbox {
|
| | | //border: 1px solid $main_color;
|
| | | border: 1px solid #eee;
|
| | | display: flex;
|
| | | min-width: 100px;
|
| | | padding: 10px;
|
| | | margin: 10px 30px 0 0;
|
| | | border-radius: 5px;
|
| | | cursor: default;
|
| | | position: relative;
|
| | |
|
| | | .myCheckboxInput {
|
| | | margin: 1px 5px 0 0;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .myCheckboxInputLabel {
|
| | | position: absolute;
|
| | | left: 29px;
|
| | | padding: 5px;
|
| | | top: 6px;
|
| | | color: transparent;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | //.myCheckbox{
|
| | | // border: 1px solid $main_color;
|
| | | //}
|
| | |
|
| | | input[type=checkbox] {
|
| | | cursor: pointer;
|
| | | position: relative;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | font-size: 14px;
|
| | | }
|
| | |
|
| | | input[type=checkbox]::after {
|
| | | position: absolute;
|
| | | top: 0;
|
| | | //color: rgb(130, 35, 35);
|
| | | color: $main_color;
|
| | | width: 14px;
|
| | | height: 14px;
|
| | | display: inline-block;
|
| | | visibility: visible;
|
| | | padding-left: 0px;
|
| | | text-align: center;
|
| | | content: ' ';
|
| | | border-radius: 3px
|
| | | }
|
| | |
|
| | | input[type=checkbox]:checked::after {
|
| | | //content: "â";
|
| | | content: "â";
|
| | | color: #fff;
|
| | | font-size: 12px;
|
| | | font-weight: bold;
|
| | | background-color: $main_color;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .defaultroute_code ::v-deep .el-input__suffix-inner {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | margin-top: -3px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex !important;
|
| | | justify-content: center !important;
|
| | | align-items: center !important;
|
| | | }
|
| | |
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | |
| | | <div style="display: flex"> |
| | | <div style="width: 300px;margin: 10px 10px 0 0;background:#fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">åè´§æ¡£æ¡</div> |
| | | </div> |
| | | |
| | | <div style="margin-right:10px"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="æ°å¢" placement="top"> |
| | | <i class="el-icon-plus" style="cursor: pointer;color: #999" @click="treeAddClick('add')" /> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | style="padding: 10px;overflow: auto" |
| | | :style="{height:(tableHeight+222)+'px'}" |
| | | :data="treeLeft" |
| | | node-key="code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | @node-click="getTMaterielData" |
| | | > |
| | | <span slot-scope="{ node, data }" class="custom-tree-node"> |
| | | <span v-if="!data.isEdit" class="ellipsis" style="width:150px;">{{ data.name }}</span> |
| | | <span v-if="!data.isEdit"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | v-if="data.code!=='-1'" |
| | | class="el-icon-edit" |
| | | style="margin-right:10px;color: #999" |
| | | @click.stop="treeEditClick(node,data,'edit')" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | v-if="data.code!=='-1'" |
| | | class="el-icon-delete" |
| | | style="margin-right: 4px;color: #999" |
| | | @click.stop="treeDeleteClick(node,data)" |
| | | /> |
| | | </el-tooltip> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | </div> |
| | | |
| | | <div |
| | | style=" width:calc(100% - 300px);" |
| | | > |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button> |
| | | <div style="display: flex"> |
| | | <el-button |
| | | v-waves |
| | | type="success" |
| | | icon="el-icon-download" |
| | | @click="$router.push('./../systemSetting/dataImport?fileCode=8')" |
| | | >导å
¥ |
| | | </el-button> |
| | | <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">忥åè´§æ¡£æ¡</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="åè´§ç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.partcode" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="åè´§åç§°" style=" display: flex;"> |
| | | <el-input v-model="form.partname" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="åè´§è§æ ¼" style=" display: flex;"> |
| | | <el-input v-model="form.partspec" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·ç¼ç " style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.usercode" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-show="isExpandForm" label="ç¨æ·åç§°" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.username" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | >æ¥è¯¢ |
| | | </el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | style="height: 5px;" |
| | | > |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseout'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"--> |
| | | <!-- @mouseenter="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseenter'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"--> |
| | | <!-- @click="isExpandForm=!isExpandForm"--> |
| | | <!-- @mouseout="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+80)+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- prop="RowNum"--> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="åè´§ç¼ç " |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="åè´§åç§°" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="è§æ ¼åå·" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="priuserdefnvc1" |
| | | label="客æ·åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc1 ? row.priuserdefnvc1 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc6" |
| | | label="客æ·ç¼ç " |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc6 ? row.priuserdefnvc6 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc2" |
| | | label="对å
åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc2 ? row.priuserdefnvc2 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc3" |
| | | label="CTPæ¥æ" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc3 ? row.priuserdefnvc3 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc4" |
| | | label="é¢åç¼å·" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc4 ? row.priuserdefnvc4 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc5" |
| | | label="çå" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc5 ? row.priuserdefnvc5 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="idinventoryclassname" |
| | | label="æå±ç±»å«" |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | label="计éåä½" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.isSingleUnit === '0' ? row.idunitgroupname : row.idunitname }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="status" |
| | | label="åè´§ç¶æ" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='0'" size="small" type="success">æ£å¸¸</el-tag> |
| | | <el-tag v-if="row.status==='1'" size="small" type="danger">åç¨</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="åè´§å±æ§" |
| | | sortable="custom" |
| | | min-width="220" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.isPurchase === '1' ? 'å¤è´' : '' }} |
| | | {{ row.isSale === '1' ? 'éå®' : '' }} |
| | | {{ row.isMadeSelf === '1' ? 'èªå¶' : '' }} |
| | | {{ row.isMaterial === '1' ? 'ç产æ¶è' : '' }} |
| | | {{ row.isMadeRequest === '1' ? 'å§å¤' : '' }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="å·¥èº" |
| | | prop="" |
| | | |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | |
| | | <!-- <i--> |
| | | <!-- v-if="row.is_retdproc==='Y'"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- class="el-icon-share"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- @click="routeClick(row)"--> |
| | | <!-- />--> |
| | | |
| | | <i |
| | | :style="{color:row.is_retdproc==='Y'?$store.state.settings.theme:`rgb(180 ,181, 185)`,cursor: 'pointer'}" |
| | | class="el-icon-share" |
| | | @click="mesSetting.route?routeClick(row):routeClick2(row)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- label="æ°æ®æ¥æº"--> |
| | | <!-- prop="data_sources"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- width="110"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | label="å建人å" |
| | | prop="lm_user" |
| | | sortable="custom" |
| | | width="110" |
| | | /> |
| | | <el-table-column |
| | | label="å建æ¶é´" |
| | | prop="lm_date" |
| | | sortable="custom" |
| | | width="160" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | class="el-icon-edit-outline" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="del(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | /> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- åè´§ç±»å«æ°å¢ä¿®æ¹--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogClassVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClassClose" |
| | | @close="handleClassClose" |
| | | > |
| | | <el-form ref="dialogClassForm" inline :rules="dialogClassFormRules" :model="dialogClassForm" label-width="80px"> |
| | | <el-form-item label="åç±»ç¼ç " prop="inventoryclasscode"> |
| | | <el-input v-model="dialogClassForm.inventoryclasscode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç±»åç§°" prop="inventoryclassname"> |
| | | <el-input v-model="dialogClassForm.inventoryclassname" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸çº§åç±»"> |
| | | <el-select |
| | | v-model="dialogClassForm.parentcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | :popper-append-to-body="false" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in treeLeftArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleClassCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleClassConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- åè´§æ¡£æ¡æ°å¢ä¿®æ¹--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="1200px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | |
| | | <el-form ref="dialogForm" class="" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px"> |
| | | <el-divider content-position="left">åºæ¬ä¿¡æ¯</el-divider> |
| | | <el-form-item label="åè´§ç¼ç " prop="partcode"> |
| | | <el-input v-model="dialogForm.partcode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="åè´§åç§°" prop="partname"> |
| | | <el-input v-model="dialogForm.partname" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·"> |
| | | <el-input v-model="dialogForm.partspec" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ç±»å«" prop="inventoryclasscode"> |
| | | <el-select |
| | | v-model="dialogForm.inventoryclasscode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in treeLeftArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ä»åº" prop="idwarehouse"> |
| | | <el-select |
| | | v-model="dialogForm.idwarehouse" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idwarehouseArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item required label="åè´§ç¶æ"> |
| | | <el-radio-group v-model="dialogForm.status"> |
| | | <el-radio label="0">æ£å¸¸</el-radio> |
| | | <el-radio label="1">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | | <el-divider content-position="left">计éåä½</el-divider> |
| | | <el-form-item label="è®¡éæ¹å¼" required prop="unittypcode"> |
| | | <el-select |
| | | v-model="dialogForm.unittypcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="unittypcodeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in unittypcodeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item :label="dialogForm.unittypcode==='1'? '计éåä½':'计éåä½ç»'" prop="unitcode"> |
| | | <el-select |
| | | v-if="dialogForm.unittypcode==='1'" |
| | | v-model="dialogForm.unitcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>unitcodeChange(val,'1')" |
| | | > |
| | | <el-option |
| | | v-for="item in unitcodeSingleArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | <el-select |
| | | v-if="dialogForm.unittypcode!=='1'" |
| | | v-model="dialogForm.unitcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="val=>unitcodeChange(val,'0')" |
| | | > |
| | | <el-option |
| | | v-for="item in unitcodeGroupArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥è¡¨è¾
åä½"> |
| | | <el-select |
| | | v-model="dialogForm.idSubUnitByReport" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.unittypcode==='1'" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idSubUnitByReportArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åºå常ç¨åä½"> |
| | | <el-select |
| | | v-model="dialogForm.idUnitByStock" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.unittypcode==='1'" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idUnitBvStockArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="éè´å¸¸ç¨åä½"> |
| | | <el-select |
| | | v-model="dialogForm.idUnitByPurchase" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.unittypcode==='1'" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idUnitBvStockArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="éå®å¸¸ç¨åä½"> |
| | | <el-select |
| | | v-model="dialogForm.idUnitBySale" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.unittypcode==='1'" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idUnitBvStockArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç产常ç¨åä½"> |
| | | <el-select |
| | | v-model="dialogForm.idunitbymanufacture" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.unittypcode==='1'" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in idUnitBvStockArr" |
| | | :key="item.unitcode" |
| | | :label="item.unitname" |
| | | :value="item.unitcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-divider content-position="left">åè´§å±æ§</el-divider> |
| | | <el-checkbox v-model="dialogForm.isPurchase" style="margin-left: 70px;">å¤è´</el-checkbox> |
| | | <el-checkbox v-model="dialogForm.isSale">éå®</el-checkbox> |
| | | <el-checkbox v-model="dialogForm.isMadeSelf">èªå¶</el-checkbox> |
| | | <el-checkbox v-model="dialogForm.isMaterial">ç产æ¶è</el-checkbox> |
| | | <el-checkbox v-model="dialogForm.isMadeRequest">å§å¤</el-checkbox> |
| | | <!-- <el-divider content-position="left">åè´§æè¿°</el-divider>--> |
| | | <!-- <el-form-item label="åè´§æè¿°">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="dialogForm.username"--> |
| | | <!-- type="textarea"--> |
| | | <!-- :autosize="{ minRows: 2, maxRows: 4}"--> |
| | | <!-- style="width: 490px;"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- å·¥èºè·¯çº¿å¯¹è¯æ¡--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :close-on-click-modal="false" |
| | | title="å
³èå·¥èºè·¯çº¿" |
| | | :visible.sync="dialogVisibleRoute" |
| | | width="800px" |
| | | top="5vh" |
| | | class="dialogVisibleRoute" |
| | | @closed="handleCloseRoute" |
| | | @close="handleCloseRoute" |
| | | > |
| | | <div> |
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 产ååç§°ï¼{{ |
| | | dialogFormRoute.projectName |
| | | }} |
| | | </div> |
| | | <el-divider /> |
| | | <div style="margin-bottom: 10px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> å·¥èºè·¯çº¿éå |
| | | </div> |
| | | |
| | | <div class="myCheckboxGroup"> |
| | | <div |
| | | v-for="item in dialogFormRoute.routeOperationArr" |
| | | :key="item.code" |
| | | :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}" |
| | | class="myCheckbox" |
| | | @click="myCheckboxClick(item)" |
| | | > |
| | | <!-- <input--> |
| | | <!-- class="myCheckboxInput"--> |
| | | <!-- type="checkbox"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- :name="item.name"--> |
| | | <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"--> |
| | | <!-- @click="myCheckboxInputClick(item)"--> |
| | | <!-- >{{ item.name }}--> |
| | | <!-- ç¶åç¹å»äºä»¶ä¸å½±å--> |
| | | <!-- onClick="event.cancelBubble = true"--> |
| | | <el-checkbox |
| | | :key="item.code" |
| | | v-model="item.isSelected2" |
| | | class="myCheckboxInput" |
| | | :value="item.code" |
| | | :name="item.name" |
| | | :label="item.name" |
| | | :checked="item.isSelected2" |
| | | @change="myCheckboxInputClick(item)" |
| | | /> |
| | | <div class="myCheckboxInputLabel">{{ item.name }}</div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-divider /> |
| | | <div> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> é»è®¤å·¥èºè·¯çº¿ |
| | | </div> |
| | | <div style="margin-top: 20px"> |
| | | <el-select |
| | | v-model="defaultroute_code" |
| | | filterable |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | class="defaultroute_code" |
| | | > |
| | | <el-option |
| | | v-for="item in defaultroute_codeArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | <el-divider /> |
| | | <div style="margin-bottom: 10px"> |
| | | <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> å·¥åºå表 |
| | | </div> |
| | | <div style="overflow-y: scroll"> |
| | | <el-table |
| | | ref="projectTableData" |
| | | :data="projectTableData" |
| | | border |
| | | height="280" |
| | | :row-class-name="tableRowClassName" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | prop="seq" |
| | | width="100" |
| | | label="å·¥åºåºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | show-tooltip-when-overflow |
| | | label="å·¥åºç¼ç " |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åºåç§°" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="enable" |
| | | label="å¯ç¨ç¶æ" |
| | | show-tooltip-when-overflow |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.enable==='Y'"> |
| | | <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" /> |
| | | æ¯ |
| | | </div> |
| | | <div v-if="row.enable==='N'"> |
| | | <i class="el-icon-info" style="margin-right: 2px" /> |
| | | å¦ |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="routeDialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="routeDialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- æå·¥èºèµ° å·¥åºå¯¹è¯æ¡--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :close-on-click-modal="false" |
| | | title="å
³èå·¥åº" |
| | | :visible.sync="dialogVisibleStep" |
| | | width="800px" |
| | | top="15vh" |
| | | class="dialogVisibleStep" |
| | | @closed="handleCloseStep" |
| | | @close="handleCloseStep" |
| | | > |
| | | |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="font-weight: bolder">å·¥åºéæ©ï¼</div> |
| | | <el-drag-select |
| | | v-model="stepSelectedValue" |
| | | style="width:570px;" |
| | | multiple |
| | | placeholder="è¯·éæ©ç¸å¯¹åºå·¥åº" |
| | | > |
| | | <!-- :disabled="!(dialogForm.mesorderstus==='NEW'||dialogForm.mesorderstus==='ALLO')"--> |
| | | <el-option |
| | | v-for="item in stepSelectArr" |
| | | :key="item.stepcode" |
| | | :label="item.stepname" |
| | | :value="item.stepcode" |
| | | /> |
| | | </el-drag-select> |
| | | </div> |
| | | |
| | | <el-table |
| | | ref="stepTableDataRef" |
| | | :data="stepTableData" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | height="300" |
| | | style="width: 100%;margin-top: 15px;" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="stepcode" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | show-tooltip-when-overflow |
| | | label="å·¥åºç¼ç " |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åºåç§°" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="stepprice"--> |
| | | <!-- label="ç产åä»·"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.stepprice"--> |
| | | <!-- placeholder="请è¾å
¥å·¥åºåä»·"--> |
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- @click.stop=""--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <!-- <el-tooltip class="item" effect="dark" content="ç§»å¨" placement="top">--> |
| | | <i |
| | | class="el-icon-rank" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: move" |
| | | /> |
| | | <!-- </el-tooltip>--> |
| | | <!-- @click="edit('edit',row)"--> |
| | | |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="margin-left: 15px;" |
| | | @click="stepDel(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="stepDialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="stepDialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import waves from '@/directive/waves' |
| | | import Pagination from '@/components/Pagination' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import { |
| | | SaveTMaterielFile, |
| | | TMaterielAddUpdate, |
| | | TMaterielClassTree, |
| | | TMaterielClassTreeAddUpdate, |
| | | TMaterielClassTreeDelete, |
| | | TMaterielData, TMaterielDelete, TMaterielFileAssociationRoute |
| | | } from '@/api/ProductModel' |
| | | import arrayToTree from 'array-to-tree' |
| | | import { StepData, UnitSerch, WareHouse } from '@/api/GeneralBasicData' |
| | | import { SaveSearchMateriel_Info } from '@/api/ErpSyncMes' |
| | | import $ from 'jquery' |
| | | import Sortable from 'sortablejs' |
| | | import ElDragSelect from '@/components/DragSelect' |
| | | |
| | | export default { |
| | | name: 'InventoryList', |
| | | directives: { waves, elDragDialog }, |
| | | components: { |
| | | Pagination, ElDragSelect |
| | | }, |
| | | data() { |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | operation: '', |
| | | |
| | | treeLeft: [ |
| | | { |
| | | code: '-1', |
| | | name: 'å
¨é¨' |
| | | } |
| | | ], // 左侧æ |
| | | treeLeftArr: [], |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | |
| | | tableData: [], |
| | | form: { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc' // æåºå段 |
| | | }, |
| | | total: 0, |
| | | dialogClassVisible: false, |
| | | dialogClassForm: { |
| | | data_sources: '', // æ°æ®æ¥æº:ERP/MES |
| | | inventoryclasscode: '', // åè´§åç±»ç¼ç |
| | | inventoryclassname: '', // åè´§åç±»åç§° |
| | | parentcode: '', // ä¸çº§åç±»ç¼ç |
| | | OperType: ''// OperType |
| | | }, |
| | | classArr: [], |
| | | dialogClassFormRules: { |
| | | inventoryclasscode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | inventoryclassname: [ |
| | | { required: true, message: '请è¾åè´§ç±»ååç§°', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | data_sources: 'MES', // æ°æ®æ¥æºï¼ERP/MES |
| | | partcode: '', // åè´§ç¼ç |
| | | partname: '', // åè´§åç§° |
| | | partspec: '', // è§æ ¼åå· |
| | | inventoryclasscode: '', // åè´§ç±»åç¼ç |
| | | unittypcode: '1', // è®¡éæ¹å¼(0:å¤è®¡é,1:å计é) |
| | | unitcode: '', // 计éåä½ç¼ç /计éåä½ç»ç¼ç |
| | | unitsubcode: '', // 计éåä½ç»å项ç¼ç ï¼å¯¹åºçæ¯ ä¸»è®¡éåä½ç¼ç ï¼ |
| | | idSubUnitByReport: '', // æ¥è¡¨è¾
åä½ç¼ç |
| | | idUnitByStock: '', // åºå常ç¨åä½ç¼ç |
| | | idUnitByPurchase: '', // éè´å¸¸ç¨åä½ç¼ç |
| | | idUnitBySale: '', // éå®å¸¸ç¨åä½ç¼ç |
| | | idunitbymanufacture: '', // ç产常ç¨åä½ |
| | | isPurchase: false, // æ¯å¦å¤è´: 0(å¦)1(æ¯) |
| | | isSale: false, // æ¯å¦éå®:0(å¦)1(æ¯) |
| | | isMadeSelf: false, // æ¯å¦èªå¶: 0(å¦)1(æ¯) |
| | | isMaterial: false, // æ¯å¦ç产èç¨: 0(å¦)1(æ¯) |
| | | isMadeRequest: false, // æ¯å¦å§å¤ï¼0(å¦)1(æ¯) |
| | | idwarehouse: '', // ä»åºç¼ç |
| | | status: '0', // 使ç¨ç¶æ: æ£å¸¸(0)åç¨(1) |
| | | OperType: '' // æä½ç±»å |
| | | }, |
| | | dialogFormRules: { |
| | | partcode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | partname: [ |
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | unitcode: [ |
| | | { required: true, message: 'è¯·éæ©è®¡éåä½(ç»)', trigger: ['blur', 'change'] } |
| | | ], |
| | | inventoryclasscode: [ |
| | | { required: true, message: 'è¯·éæ©æå±åä½', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | unittypcodeArr: [ |
| | | { code: '1', name: 'å计é' }, |
| | | { code: '0', name: 'å¤è®¡é' } |
| | | ], |
| | | unitcodeSingleArr: [], |
| | | unitcodeGroupArr: [], |
| | | idSubUnitByReportArr: [], |
| | | idUnitBvStockArr: [], |
| | | idwarehouseArr: [], |
| | | |
| | | // å·¥èº |
| | | dialogVisibleRoute: false, |
| | | dialogFormRoute: { |
| | | projectName: '', // 产ååç§° |
| | | projectCode: '', // 产å代ç |
| | | routeOperationArr: [] // å·¥èºè·¯çº¿éå |
| | | // routeOperationSelectedArr: [] // å·¥èºè·¯çº¿éä¸éåæ°ç» |
| | | }, |
| | | defaultroute_code: '', // é»è®¤å·¥èºè·¯çº¿éä¸å¼ |
| | | defaultroute_codeArr: '', // é»è®¤å·¥èºè·¯çº¿æ°ç» |
| | | projectTableData: [], // å·¥åºå表 |
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')), |
| | | |
| | | // æå·¥åºèµ° |
| | | dialogVisibleStep: false, |
| | | stepTableData: [], |
| | | sortable: null, |
| | | stepSelectArr: [], // å·¥åºä¸ææ°æ® |
| | | stepSelectedValue: [] // å·¥åºä¸æéä¸å¼ |
| | | } |
| | | }, |
| | | watch: { |
| | | 'stepSelectedValue': { |
| | | // deep: true, |
| | | handler: function(val) { |
| | | // do something with the new and old value of stepSelectedValue |
| | | console.log(val, 1) |
| | | const arr = JSON.parse(JSON.stringify(this.stepTableData)) |
| | | const arrStepcode = arr.map(i => i.stepcode) |
| | | this.stepTableData = [] |
| | | val.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i, |
| | | stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname |
| | | // stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0 |
| | | } |
| | | ) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | |
| | | this.getTMaterielClassTree() |
| | | this.getSelectApi() |
| | | }, |
| | | methods: { |
| | | // å·¥èºç¹å» ,æå·¥åºèµ° |
| | | async routeClick2(row) { |
| | | this.dialogVisibleStep = true |
| | | this.dialogFormRoute.projectCode = row.partcode |
| | | |
| | | const res = await TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }) |
| | | if (res.code === '200' && res.data.length > 0) { |
| | | this.stepSelectedValue = res.data.map(i => i.step_code) |
| | | } |
| | | |
| | | // æå¨è¡¨æ ¼ |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | | }, |
| | | |
| | | stepDialogVisibleCancel() { |
| | | this.dialogVisibleStep = false |
| | | }, |
| | | |
| | | async stepDialogVisibleConfirm() { |
| | | if (this.stepSelectedValue.length === 0) { |
| | | return this.$message.info('å·¥åºè³å°è¦æä¸éï¼') |
| | | } |
| | | const children = [] |
| | | this.stepSelectedValue.forEach((item, index) => { |
| | | const t = this.stepSelectArr.find(i => i.stepcode === item) |
| | | children.push({ |
| | | 'code': t.stepcode, |
| | | 'name': t.stepname, |
| | | 'seq': index + 1, |
| | | 'isbott': index === 0 ? 'Y' : 'N', |
| | | 'isend': index === this.stepSelectedValue.length - 1 ? 'Y' : 'N' |
| | | }) |
| | | }) |
| | | const data = [ |
| | | { |
| | | 'partcode': this.dialogFormRoute.projectCode, |
| | | 'defaultroute_code': '', |
| | | 'children': children |
| | | } |
| | | ] |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SaveTMaterielFile(data) |
| | | if (res.code === '200') { |
| | | this.dialogVisibleStep = false |
| | | this.$message.success('ä¿åæåï¼') |
| | | await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }, |
| | | // å·¥åºå é¤ |
| | | stepDel(row) { |
| | | const index = this.stepSelectedValue.findIndex(i => i === row.stepcode) |
| | | this.stepSelectedValue.splice(index, 1) |
| | | }, |
| | | handleCloseStep() { |
| | | this.stepTableData = [] |
| | | this.sortable = null |
| | | this.stepSelectedValue = [] |
| | | }, |
| | | |
| | | setSort() { |
| | | const el = this.$refs.stepTableDataRef.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] |
| | | this.sortable = Sortable.create(el, { |
| | | ghostClass: 'sortable-ghost', // Class name for the drop placeholder, |
| | | setData: function(dataTransfer) { |
| | | // to avoid Firefox bug |
| | | // Detail see : https://github.com/RubaXa/Sortable/issues/1012 |
| | | dataTransfer.setData('Text', '') |
| | | }, |
| | | onEnd: evt => { |
| | | const targetRow = this.stepTableData.splice(evt.oldIndex, 1)[0] |
| | | this.stepTableData.splice(evt.newIndex, 0, targetRow) |
| | | |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | // for show the changes, you can delete in you code |
| | | // const tempIndex = this.newList.splice(evt.oldIndex, 1)[0] |
| | | // this.newList.splice(evt.newIndex, 0, tempIndex) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | |
| | | /* ç¹å»å
³èå·¥èºè·¯çº¿æ¨¡å*/ |
| | | // å·¥èºè·¯çº¿ç¹å» |
| | | routeClick(row) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: 'æ£å¨å è½½æ°æ®ï¼è¯·ç¨ç...', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'osloading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | |
| | | this.defaultroute_code = row.default_route |
| | | this.dialogFormRoute.projectCode = row.partcode |
| | | this.dialogFormRoute.projectName = row.partname |
| | | |
| | | TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }).then(res => { |
| | | if (res.code === '200') { |
| | | setTimeout(() => { |
| | | loading.close() |
| | | this.dialogVisibleRoute = true |
| | | this.dialogFormRoute.routeOperationArr = res.data |
| | | // let waitFlag = false// åæ¾çå¾
æ¯å¦æ¾è¡ |
| | | |
| | | this.dialogFormRoute.routeOperationArr.forEach((item, index) => { |
| | | item.isSelected1 = false |
| | | item.isSelected2 = false |
| | | if (index === 0) { |
| | | item.isSelected1 = true |
| | | this.projectTableData = item.Data |
| | | } |
| | | if (item.flag === 'Y') { |
| | | item.isSelected2 = true |
| | | this.$nextTick(() => { |
| | | $('input:checkbox').eq(index).prop('checked', true) |
| | | }) |
| | | |
| | | // const interval = setInterval(() => { |
| | | // if ($('input:checkbox').length > 0) { |
| | | // waitFlag = true |
| | | // } |
| | | // if (waitFlag) { |
| | | // clearInterval(interval) |
| | | // this.$nextTick(() => { |
| | | // $('input:checkbox').eq(index).prop('checked', true) |
| | | // }) |
| | | // } |
| | | // }, 100) |
| | | } |
| | | }) |
| | | |
| | | this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y') |
| | | }, 1000) |
| | | } else { |
| | | loading.close() |
| | | } |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³é |
| | | handleCloseRoute() { |
| | | this.dialogFormRoute.routeOperationArr = [] |
| | | this.defaultroute_codeArr = [] |
| | | }, |
| | | // åæ¶ |
| | | routeDialogVisibleCancel() { |
| | | this.dialogVisibleRoute = false |
| | | }, |
| | | // ç¡®å® |
| | | async routeDialogVisibleConfirm() { |
| | | if (!this.defaultroute_code || this.defaultroute_code === 'null') { |
| | | return this.$message.info('é»è®¤å·¥èºè·¯çº¿ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | |
| | | // æäº¤æ ¼å¼ |
| | | const data = [] |
| | | this.dialogFormRoute.routeOperationArr.forEach(item => { |
| | | if (item.isSelected2) { |
| | | data.push({ code: item.code, name: item.name }) |
| | | } |
| | | }) |
| | | |
| | | const D = [{ |
| | | 'partcode': this.dialogFormRoute.projectCode, |
| | | 'defaultroute_code': this.defaultroute_code, |
| | | 'children': data |
| | | }] |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SaveTMaterielFile(D) |
| | | if (res.code === '200') { |
| | | this.dialogVisibleRoute = false |
| | | this.$message.success('ä¿åæåï¼') |
| | | await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } |
| | | }, |
| | | // 大çåç¹å»äºä»¶ |
| | | myCheckboxClick(val) { |
| | | console.log(val, 1) |
| | | this.dialogFormRoute.routeOperationArr.forEach(item => { |
| | | item.isSelected1 = val.code === item.code |
| | | }) |
| | | |
| | | this.projectTableData = val.Data |
| | | }, |
| | | // å°çåç¹å»äºä»¶ |
| | | myCheckboxInputClick(val) { |
| | | // console.log(val, 2) |
| | | val.isSelected2 = !!val.isSelected2 |
| | | |
| | | this.dialogFormRoute.routeOperationArr.forEach((item, index) => { |
| | | if (val.code === item.code) { |
| | | item.flag = !item.flag |
| | | } |
| | | }) |
| | | if (val.code === this.defaultroute_code) { |
| | | this.defaultroute_code = '' |
| | | } |
| | | this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2) |
| | | }, |
| | | |
| | | async getSelectApi() { |
| | | const { data: res } = await UnitSerch({ tunittype: 'M' }) |
| | | this.unitcodeGroupArr = res |
| | | |
| | | const { data: res2 } = await UnitSerch({ tunittype: 'S' }) |
| | | this.unitcodeSingleArr = res2 |
| | | |
| | | const { data: res3 } = await WareHouse() |
| | | this.idwarehouseArr = res3 |
| | | |
| | | // è·åå·¥åº |
| | | const { data: res4 } = await StepData() |
| | | this.stepSelectArr = res4 |
| | | }, |
| | | |
| | | async getTMaterielClassTree() { |
| | | const res = await TMaterielClassTree() |
| | | res.data.forEach(i => { |
| | | i.idparent = i.idparent ? i.idparent : '-1' |
| | | }) |
| | | this.treeLeftArr = res.data |
| | | this.treeLeftArr.forEach(e => { |
| | | e.name = e.code + ' ' + e.name |
| | | }) |
| | | this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), { |
| | | parentProperty: 'idparent', |
| | | customID: 'code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }) |
| | | }, |
| | | async getTMaterielData(node) { |
| | | const result = this.getChildrenCodeMethod(node, []) |
| | | if (result.includes('-1')) { |
| | | result.shift() |
| | | } |
| | | this.form.inventoryclasscode = result.join(',') |
| | | const res = await TMaterielData(this.form) |
| | | |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 280 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.data_sources = row.data_sources |
| | | this.dialogForm.partcode = row.partcode |
| | | this.dialogForm.partname = row.partname |
| | | this.dialogForm.partspec = row.partspec |
| | | this.dialogForm.inventoryclasscode = row.idinventoryclasscode |
| | | this.dialogForm.unittypcode = row.isSingleUnit |
| | | // è®¡éæ¹å¼(0:å¤è®¡é,1:å计é) |
| | | if (this.dialogForm.unittypcode === '1') { |
| | | this.dialogForm.unitcode = row.idunitcode |
| | | this.dialogForm.unitsubcode = '' |
| | | this.dialogForm.idSubUnitByReport = '' |
| | | const unitname = this.unitcodeSingleArr.find(i => i.unitcode === this.dialogForm.unitcode).unitname |
| | | |
| | | this.dialogForm.idUnitByStock = unitname |
| | | this.dialogForm.idUnitByPurchase = unitname |
| | | this.dialogForm.idUnitBySale = unitname |
| | | this.dialogForm.idunitbymanufacture = unitname |
| | | } |
| | | |
| | | if (this.dialogForm.unittypcode === '0') { |
| | | this.dialogForm.unitcode = row.idunitgroupcode |
| | | |
| | | const t = this.unitcodeGroupArr.find(i => i.unitcode === this.dialogForm.unitcode).children |
| | | |
| | | this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1') |
| | | this.idUnitBvStockArr = t |
| | | |
| | | const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode |
| | | this.dialogForm.unitsubcode = mainUnitCode |
| | | this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode |
| | | |
| | | this.dialogForm.idUnitByStock = mainUnitCode |
| | | this.dialogForm.idUnitByPurchase = mainUnitCode |
| | | this.dialogForm.idUnitBySale = mainUnitCode |
| | | this.dialogForm.idunitbymanufacture = mainUnitCode |
| | | } |
| | | |
| | | this.dialogForm.isPurchase = row.isPurchase === '1' |
| | | this.dialogForm.isSale = row.isSale === '1' |
| | | this.dialogForm.isMadeSelf = row.isMadeSelf === '1' |
| | | this.dialogForm.isMaterial = row.isMaterial === '1' |
| | | this.dialogForm.isMadeRequest = row.isMadeRequest === '1' |
| | | |
| | | this.dialogForm.idwarehouse = row.idwarehousecode |
| | | this.dialogForm.status = row.status |
| | | }) |
| | | }, |
| | | del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | TMaterielDelete({ partcode: row.partcode, data_sources: row.data_sources }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.form.inventoryclasscode = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.data_sources = 'MES' |
| | | this.dialogForm.partcode = '' |
| | | this.dialogForm.partname = '' |
| | | this.dialogForm.partspec = '' |
| | | this.dialogForm.inventoryclasscode = '' |
| | | this.dialogForm.unittypcode = '1' |
| | | this.dialogForm.unitcode = '' |
| | | this.dialogForm.unitsubcode = '' |
| | | this.dialogForm.idSubUnitByReport = '' |
| | | this.dialogForm.idUnitByStock = '' |
| | | this.dialogForm.idUnitByPurchase = '' |
| | | this.dialogForm.idUnitBySale = '' |
| | | this.dialogForm.idunitbymanufacture = '' |
| | | this.dialogForm.isPurchase = false |
| | | this.dialogForm.isSale = false |
| | | this.dialogForm.isMadeSelf = false |
| | | this.dialogForm.isMaterial = false |
| | | this.dialogForm.isMadeRequest = false |
| | | this.dialogForm.idwarehouse = '' |
| | | this.dialogForm.status = '0' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | if (!(this.dialogForm.isPurchase || this.dialogForm.isSale || this.dialogForm.isMadeSelf || this.dialogForm.isMaterial || this.dialogForm.isMadeRequest)) { |
| | | return this.$message.info('åè´§å±æ§ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | this.dialogForm.isPurchase = this.dialogForm.isPurchase ? '1' : '0' |
| | | this.dialogForm.isSale = this.dialogForm.isSale ? '1' : '0' |
| | | this.dialogForm.isMadeSelf = this.dialogForm.isMadeSelf ? '1' : '0' |
| | | this.dialogForm.isMaterial = this.dialogForm.isMaterial ? '1' : '0' |
| | | this.dialogForm.isMadeRequest = this.dialogForm.isMadeRequest ? '1' : '0' |
| | | // console.log(JSON.parse(JSON.stringify(this.dialogForm)), 1) |
| | | |
| | | if (this.dialogForm.unittypcode === '1') { |
| | | this.dialogForm.idUnitByStock = this.dialogForm.unitcode |
| | | this.dialogForm.idUnitByPurchase = this.dialogForm.unitcode |
| | | this.dialogForm.idUnitBySale = this.dialogForm.unitcode |
| | | this.dialogForm.idunitbymanufacture = this.dialogForm.unitcode |
| | | } |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | TMaterielAddUpdate(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // éå½ååéçææcode |
| | | getChildrenCodeMethod(node, result) { |
| | | result.push(node.code) |
| | | if (node.children && node.children.length > 0) { |
| | | node.children.forEach(i => { |
| | | this.getChildrenCodeMethod(i, result) |
| | | }) |
| | | } |
| | | return result |
| | | }, |
| | | |
| | | treeEditClick(node, data, operation) { |
| | | this.dialogClassForm.data_sources = data.data_sources |
| | | this.dialogClassForm.inventoryclasscode = data.code |
| | | this.dialogClassForm.inventoryclassname = data.name.split(' ')[1] |
| | | this.dialogClassForm.parentcode = data.idparent === '-1' ? '' : data.idparent |
| | | this.dialogClassForm.OperType = 'Update' |
| | | this.operation = operation |
| | | this.dialogClassVisible = true |
| | | }, |
| | | treeDeleteClick(node, data) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const result = this.getChildrenCodeMethod(data, []) |
| | | TMaterielClassTreeDelete({ inventoryclasscode: result.join(',') }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | this.getTMaterielClassTree() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | treeAddClick(operation) { |
| | | this.operation = operation |
| | | this.dialogClassVisible = true |
| | | this.dialogClassForm.OperType = 'Add' |
| | | this.dialogClassForm.data_sources = 'MES' |
| | | }, |
| | | |
| | | handleClassClose() { |
| | | this.dialogClassForm.data_sources = '' |
| | | this.dialogClassForm.inventoryclasscode = '' |
| | | this.dialogClassForm.inventoryclassname = '' |
| | | this.dialogClassForm.parentcode = '' |
| | | this.dialogClassForm.OperType = '' |
| | | this.$refs.dialogClassForm.clearValidate() |
| | | }, |
| | | dialogVisibleClassCancel() { |
| | | this.dialogClassVisible = false |
| | | }, |
| | | dialogVisibleClassConfirm() { |
| | | this.$refs.dialogClassForm.validate(valid => { |
| | | if (valid) { |
| | | TMaterielClassTreeAddUpdate(this.dialogClassForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogClassVisible = false |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.getTMaterielClassTree() |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | unittypcodeChange(val) { |
| | | console.log(val) |
| | | |
| | | this.dialogForm.unitcode = '' |
| | | this.dialogForm.unitsubcode = '' |
| | | this.dialogForm.idSubUnitByReport = '' |
| | | this.dialogForm.idUnitByStock = '' |
| | | this.dialogForm.idUnitByPurchase = '' |
| | | this.dialogForm.idUnitBySale = '' |
| | | this.dialogForm.idunitbymanufacture = '' |
| | | // this.$refs.dialogForm.clearValidate() |
| | | // this.$forceUpdate() |
| | | }, |
| | | unitcodeChange(val, type) { |
| | | console.log(val) |
| | | |
| | | if (type === '1') { |
| | | // this.dialogForm.unitcode = val |
| | | this.dialogForm.unitsubcode = '' |
| | | this.dialogForm.idSubUnitByReport = '' |
| | | |
| | | const unitname = this.unitcodeSingleArr.find(i => i.unitcode === val).unitname |
| | | |
| | | this.dialogForm.idUnitByStock = unitname |
| | | this.dialogForm.idUnitByPurchase = unitname |
| | | this.dialogForm.idUnitBySale = unitname |
| | | this.dialogForm.idunitbymanufacture = unitname |
| | | } |
| | | |
| | | if (type === '0') { |
| | | const t = this.unitcodeGroupArr.find(i => i.unitcode === val).children |
| | | |
| | | this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1') |
| | | this.idUnitBvStockArr = t |
| | | |
| | | const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode |
| | | this.dialogForm.unitsubcode = mainUnitCode |
| | | this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode |
| | | |
| | | this.dialogForm.idUnitByStock = mainUnitCode |
| | | this.dialogForm.idUnitByPurchase = mainUnitCode |
| | | this.dialogForm.idUnitBySale = mainUnitCode |
| | | this.dialogForm.idunitbymanufacture = mainUnitCode |
| | | } |
| | | }, |
| | | // 忥ERP |
| | | syncERP() { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: 'æ£å¨åæ¥ERPï¼è¯·ç¨ç...', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'osloading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | |
| | | SaveSearchMateriel_Info().then(res => { |
| | | if (res.code === '200') { |
| | | setTimeout(() => { |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | this.getTMaterielClassTree() |
| | | loading.close() |
| | | this.$notify.success('忥æåï¼') |
| | | }, 2000) |
| | | } |
| | | // else if (res.code === '300') { |
| | | // setTimeout(() => { |
| | | // loading.close() |
| | | // this.$message.error('åæ¥å¤±è´¥ï¼') |
| | | // }, 10000) |
| | | // } |
| | | }).catch(e => { |
| | | loading.close() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | $main_color: #42b983; |
| | | .custom-tree-node { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | font-size: 14px; |
| | | padding-right: 8px; |
| | | } |
| | | |
| | | //::v-deep .el-checkbox__label { |
| | | // width: 55px; |
| | | //} |
| | | // |
| | | .el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover { |
| | | color: #000 !important; |
| | | } |
| | | |
| | | .dialogVisibleRoute { |
| | | .myCheckboxGroup { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | .myCheckbox { |
| | | //border: 1px solid $main_color; |
| | | border: 1px solid #eee; |
| | | display: flex; |
| | | min-width: 100px; |
| | | padding: 10px; |
| | | margin: 10px 30px 0 0; |
| | | border-radius: 5px; |
| | | cursor: default; |
| | | position: relative; |
| | | |
| | | .myCheckboxInput { |
| | | margin: 1px 5px 0 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .myCheckboxInputLabel { |
| | | position: absolute; |
| | | left: 29px; |
| | | padding: 5px; |
| | | top: 6px; |
| | | color: transparent; |
| | | } |
| | | |
| | | } |
| | | |
| | | //.myCheckbox{ |
| | | // border: 1px solid $main_color; |
| | | //} |
| | | |
| | | input[type=checkbox] { |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: 14px; |
| | | height: 14px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | input[type=checkbox]::after { |
| | | position: absolute; |
| | | top: 0; |
| | | //color: rgb(130, 35, 35); |
| | | color: $main_color; |
| | | width: 14px; |
| | | height: 14px; |
| | | display: inline-block; |
| | | visibility: visible; |
| | | padding-left: 0px; |
| | | text-align: center; |
| | | content: ' '; |
| | | border-radius: 3px |
| | | } |
| | | |
| | | input[type=checkbox]:checked::after { |
| | | //content: "â"; |
| | | content: "â"; |
| | | color: #fff; |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | background-color: $main_color; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .defaultroute_code ::v-deep .el-input__suffix-inner { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-top: -3px; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex !important; |
| | | justify-content: center !important; |
| | | align-items: center !important; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}">
|
| | |
|
| | | <div style="position: absolute;right:36px;z-index: 2;top: 13px">
|
| | | <el-button
|
| | | v-if="activeName==='ç产å表'&&tableData.length>0"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="primary"
|
| | | :disabled="radioSelected===''"
|
| | | @click="report()"
|
| | | >æ¥å·¥
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='å¤ååæ'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="sendOut()"
|
| | | >åæ
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='å¤åæ¶æ'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="takeIn()"
|
| | | >æ¶æ
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'&&tableData.length>0"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-thumb"
|
| | | :disabled="radioSelected===''"
|
| | | @click="handleBad()"
|
| | | >å¤ç
|
| | | </el-button>
|
| | | </div>
|
| | |
|
| | | <div v-if="form.wocode" style="position: absolute;left: 460px;z-index: 2;top: 23px;font-weight: bolder">
|
| | | å½åå·¥åå·ä¸ºï¼{{ form.wocode }}
|
| | | </div>
|
| | |
|
| | | <el-tabs
|
| | | ref="elTabs"
|
| | | v-model="activeName"
|
| | | type="border-card"
|
| | | @tab-click="tabClick"
|
| | | >
|
| | |
|
| | | <el-tab-pane
|
| | | v-for="item in elTabsArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :name="item.name"
|
| | | >
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | |
|
| | | <el-form-item label="å·¥åå·" style=" display: flex;">
|
| | | <el-input
|
| | | v-model="workOrderCurrentValue"
|
| | | :name="'produceCode'+item.code"
|
| | | placeholder="è¯·æ«ææè¾å
¥"
|
| | | style="width: 300px"
|
| | |
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="产åç¼ç " style=" display: flex;">
|
| | | <el-input
|
| | | v-model="form.partcode"
|
| | | placeholder="请è¾å
¥"
|
| | | style="width: 200px"
|
| | |
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="产ååç§°" style=" display: flex;">
|
| | | <el-input
|
| | | v-model="form.partname"
|
| | | placeholder="请è¾å
¥"
|
| | |
|
| | | style="width: 200px"
|
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="车é´åç§°" style=" display: flex;">
|
| | | <el-select
|
| | | v-model="form.wkshopcode"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | style="width: 200px"
|
| | |
|
| | | placeholder="è¯·éæ©"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in wkshopcodeArr"
|
| | | :key="item.torg_code"
|
| | | :label="item.torg_name"
|
| | | :value="item.torg_code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | <!-- <el-form-item label="è§æ ¼åå·" style=" display: flex;">-->
|
| | | <!-- <el-input v-model="form.partspec" placeholder="请è¾å
¥" style="width: 200px" />-->
|
| | | <!-- </el-form-item>-->
|
| | |
|
| | | </div>
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">æ¥è¯¢</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button>
|
| | | </div>
|
| | | </el-form>
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | style="height:5px"
|
| | | >
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseout'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
|
| | | <!-- @mouseenter="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | <!-- <svg-icon-->
|
| | | <!-- v-show="mouseHoverType==='mouseenter'"-->
|
| | | <!-- style="cursor: pointer"-->
|
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
|
| | | <!-- @click="isExpandForm=!isExpandForm"-->
|
| | | <!-- @mouseout="mouseHoverType=$event.type"-->
|
| | | <!-- />-->
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | :key="'tableDataRef'+item.code"
|
| | | class="tableFixed"
|
| | | :data="tableData"
|
| | | :height="tableHeight+50"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | :style="{width: 100+'%',height:tableHeight+'px'}"
|
| | | highlight-current-row
|
| | | :header-cell-style="headerCellStyle()"
|
| | | :cell-style="cellStyle()"
|
| | | @sort-change="sortChange"
|
| | | @row-click="rowClick"
|
| | | >
|
| | | <el-table-column
|
| | | width="50"
|
| | | fixed
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-radio
|
| | | v-model="radioSelected"
|
| | | :label="row.id"
|
| | | style="color: transparent;padding-left: 10px;"
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="rowNum"
|
| | | width="50"
|
| | | label="åºå·"
|
| | | fixed
|
| | | />
|
| | | <el-table-column
|
| | | v-if="activeName!=='ä¸è¯å¾
å¤ç'"
|
| | | prop="status"
|
| | | show-tooltip-when-overflow
|
| | | label="ç¶æ"
|
| | | sortable="custom"
|
| | | width="80"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div>
|
| | | <div v-if="row.status==='ALLO'">已派å</div>
|
| | | <div v-if="row.status==='START'">å¼å·¥</div>
|
| | | <div v-if="row.status==='CLOSED'">å®å·¥</div>
|
| | | <div v-if="row.status==='NOSCHED'">å¾
æç¨</div>
|
| | | <div v-if="row.status==='SCHED'">å·²æç¨</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wo_code"
|
| | | label="å·¥åå·"
|
| | | min-width="160"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partcode"
|
| | | label="产åç¼ç "
|
| | | min-width="110"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | prop="partname"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="产ååç§°"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partspec"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="è§æ ¼åå·"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | {{ row.partspec ? row.partspec : '/' }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wkshp_name"
|
| | | min-width="110"
|
| | | show-tooltip-when-overflow
|
| | | label="车é´åç§°"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="å·¥åºåç§°"
|
| | | show-tooltip-when-overflow
|
| | | width="120"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="plan_qty"
|
| | | label="任塿°é"
|
| | | width="110"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | v-if="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'"
|
| | | prop="fqty"
|
| | | show-tooltip-when-overflow
|
| | | label="已忿°é"
|
| | | sortable="custom"
|
| | | width="120"
|
| | | />
|
| | | <el-table-column
|
| | | prop="good_qty"
|
| | | show-tooltip-when-overflow
|
| | | :label="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'?'å·²æ¶ææ°é':'åæ ¼æ°é'"
|
| | | sortable="custom"
|
| | | width="120"
|
| | | />
|
| | | <el-table-column
|
| | | prop="ng_qty"
|
| | | label="ä¸è¯æ°é"
|
| | | show-tooltip-when-overflow
|
| | | width="120"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="laborbad_qty"
|
| | | label="å·¥åºæ°é"
|
| | | width="120"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="materielbad_qty"
|
| | | label="æåºæ°é"
|
| | | width="120"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | |
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | width="120"
|
| | | fixed="right"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-button v-if="activeName==='ç产å表'" v-waves icon="el-icon-thumb" type="text" @click="report(row)">
|
| | | æ¥å·¥
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='å¤ååæ'"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="text"
|
| | | @click="sendOut(row)"
|
| | | >åæ
|
| | | </el-button>
|
| | | <el-button v-if="activeName==='å¤åæ¶æ'" v-waves icon="el-icon-thumb" type="text" @click="takeIn(row)">
|
| | | æ¶æ
|
| | | </el-button>
|
| | | <el-button
|
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'"
|
| | | v-waves
|
| | | icon="el-icon-thumb"
|
| | | type="text"
|
| | | @click="handleBad(row)"
|
| | | >å¤ç
|
| | | </el-button>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--å页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes"
|
| | | popper-class="select_bottom"
|
| | | @pagination="search"
|
| | | />
|
| | | </el-tab-pane>
|
| | |
|
| | | </el-tabs>
|
| | |
|
| | | </div>
|
| | |
|
| | | <!-- 弿¥å·¥ãå¤åãä¸è¯å¤ç-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="dialogTitle"
|
| | | :visible.sync="dialogVisible"
|
| | | width="1160px"
|
| | | :close-on-click-modal="false"
|
| | | :top="activeName==='ç产å表'||activeName==='å¤åæ¶æ'? '6vh':'15vh'"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
|
| | | <!-- <el-divider v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'||activeName==='ä¸è¯å¾
å¤ç'" content-position="left">åºæ¬ä¿¡æ¯</el-divider>-->
|
| | | <el-divider v-if="activeName==='ç产å表'" content-position="left">æ¥å·¥ä¿¡æ¯</el-divider>
|
| | | <el-divider v-if="activeName==='å¤åæ¶æ'" content-position="left">æ¶æä¿¡æ¯</el-divider>
|
| | | <el-divider v-if="activeName==='ä¸è¯å¾
å¤ç'" content-position="left">å¾
å¤çä¿¡æ¯</el-divider>
|
| | | <el-form-item label="å·¥åç¼å·" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="产åç¼ç " class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partnumber }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="产ååç§°" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="è§æ ¼åå·" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="å½åå·¥åº" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="ä¸éå·¥åº" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item label="任塿°é" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='ä¸è¯å¾
å¤ç'" label="åæ ¼æ°é" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty }}</div>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='ä¸è¯å¾
å¤ç'" label="ä¸è¯æ°é" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noputqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item
|
| | | v-if="activeName!=='ä¸è¯å¾
å¤ç'"
|
| | | :label="activeName==='ç产å表'? 'æªæ¥/å·²æ¥':(activeName==='å¤ååæ'?'æªå/å·²å':'æªæ¶/å·²æ¶')"
|
| | | class="dialogFormItem"
|
| | | >
|
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty + '/' + dialogForm.reportqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" label="ä¸è¯æ°é" class="dialogFormItem">
|
| | | <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='ç产å表'" label="æ¥å·¥è®¾å¤" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.eqpcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | clearable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in eqpArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='ç产å表'" label="计件æ¹å¼" class="dialogFormItem">
|
| | | <el-radio-group
|
| | | v-model="dialogForm.reckway"
|
| | | style="width: 200px;"
|
| | | @change="reckwayChange"
|
| | | >
|
| | | <el-radio label="person">个人</el-radio>
|
| | | <el-radio label="group">çç»</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item
|
| | | v-if="activeName==='ç产å表'"
|
| | | :prop="dialogForm.reckway==='group'?'usergroupcode':''"
|
| | | label="æ¥å·¥çç»"
|
| | | class="dialogFormItem"
|
| | | >
|
| | | <el-select
|
| | | v-model="dialogForm.usergroupcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :disabled="dialogForm.reckway!=='group'"
|
| | | :popper-append-to-body="false"
|
| | | @change="usergroupChange"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in usergroupArr"
|
| | | :key="item.usergroupcode"
|
| | | :label="item.usergroupname"
|
| | | :value="item.usergroupcode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='ç产å表'" prop="reportuser" label="æ¥å·¥äººå" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.reportuser"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | multiple
|
| | | collapse-tags
|
| | | :multiple-limit="dialogForm.reckway==='group'?0:1"
|
| | | :disabled="dialogForm.reckway==='group'&&dialogForm.usergroupcode===''"
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='ç产å表'" prop="startqty" label="åæ ¼æ°é" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'" prop="wxcode" label="å¤å便¹" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.wxcode"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in wxArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='å¤ååæ'" prop="outuser" label="åæäººå" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.outuser"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='å¤ååæ'" prop="fqty" label="åææ°é" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-if="activeName==='å¤åæ¶æ'" prop="inuser" label="æ¶æäººå" class="dialogFormItem">
|
| | | <el-select
|
| | | v-model="dialogForm.inuser"
|
| | | style="width:200px"
|
| | | placeholder="è¯·éæ©"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in reportuserArr"
|
| | | :key="item.usercode"
|
| | | :label="item.username"
|
| | | :value="item.usercode"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item v-if="activeName==='å¤åæ¶æ'" prop="sqty" label="æ¶ææ°é" class="dialogFormItem">
|
| | | <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-divider v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" content-position="left">ä¸è¯æç»ä¿¡æ¯</el-divider>
|
| | | <el-button
|
| | | v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'"
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-circle-plus-outline"
|
| | | @click="addDefect"
|
| | | >æ°å¢
|
| | | </el-button>
|
| | | <el-table
|
| | | v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'"
|
| | | ref="defectTableDataRef"
|
| | | key="defectTableDataKey"
|
| | | :data="defectTableData"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | height="200"
|
| | | style="width: 100%;margin-top: 15px;"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | label="åºå·"
|
| | | align="center"
|
| | | width="50"
|
| | | />
|
| | | <el-table-column
|
| | | prop="stepcode"
|
| | | label="缺é·ç¼ç /åç§°"
|
| | | align="center"
|
| | | min-width="450"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-select
|
| | | v-model="row.code"
|
| | | style="width: 100%"
|
| | | placeholder="è¯·éæ©"
|
| | | multiple
|
| | | filterable
|
| | | >
|
| | | <!-- collapse-tags-->
|
| | | <el-option
|
| | | v-for="item in defectArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="badqty"
|
| | | label="ä¸è¯æ°é"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.badqty"
|
| | | placeholder="请è¾å
¥æ°é"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | @change="badqtyChange"
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | width="50"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">
|
| | | <i
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="margin-left: 7px;"
|
| | | @click="defectDel(row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <el-divider v-if="activeName==='å¤åæ¶æ'" content-position="left">坿¶æä¾åºå</el-divider>
|
| | | <div
|
| | | v-for="(item,index) in dialogForm.list"
|
| | | v-if="item.fqty>0"
|
| | | :key="item.name"
|
| | | style="display: flex;line-height: 26px;height: 26px;margin-left:30px;align-items: center"
|
| | | >
|
| | | <div
|
| | | style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%"
|
| | | :style="{backgroundColor:$store.state.settings.theme}"
|
| | | >{{ index + 1 }}
|
| | | </div>
|
| | | <div style="margin-left:30px;width: 160px;" class="ellipsis">
|
| | | {{ item.tp }}
|
| | | </div>
|
| | | <div style="margin-left:30px;">
|
| | | 坿¶æ°éï¼{{ item.acceptQty }}
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <el-divider v-if="activeName==='ä¸è¯å¾
å¤ç'" content-position="left">ä¸è¯ä¿¡æ¯æç»</el-divider>
|
| | | <el-table
|
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'"
|
| | | ref="badTableDataDataRef"
|
| | | key="badTableDataDataKey"
|
| | | :data="badTableData"
|
| | | border
|
| | | row-class-name="custom-row"
|
| | | height="300"
|
| | | style="width: 100%;margin-top: 15px;"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | >
|
| | | <el-table-column
|
| | | type="index"
|
| | | label="åºå·"
|
| | | align="center"
|
| | | width="50"
|
| | | />
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="step_code"-->
|
| | | <!-- label="å·¥åºç¼ç "-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- align="center"-->
|
| | | <!-- />-->
|
| | | <el-table-column
|
| | | prop="stepname"
|
| | | label="å·¥åºåç§°"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="plan_qty"
|
| | | label="任塿°é"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="report_qty"
|
| | | label="åæ ¼æ°é"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="ng_qty"
|
| | | label="ä¸è¯æ°é"
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="defect_name"
|
| | | label="ä¸è¯åå "
|
| | | show-tooltip-when-overflow
|
| | | align="center"
|
| | | />
|
| | | <el-table-column
|
| | | prop="repair_qty"
|
| | | label="ç»´ä¿®åæ ¼æ°é"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.repair_qty"
|
| | | placeholder="请è¾å
¥æ°é"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="laborbad_qty"
|
| | | label="å·¥åºæ°é"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.laborbad_qty"
|
| | | placeholder="请è¾å
¥æ°é"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="materielbad_qty"
|
| | | label="æåºæ°é"
|
| | | align="center"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <el-input
|
| | | v-model="row.materielbad_qty"
|
| | | placeholder="请è¾å
¥æ°é"
|
| | | oninput="value=value.replace(/[^0-9]/g,'')"
|
| | | style="width: 100%"
|
| | | @click.stop=""
|
| | | />
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="badqty"-->
|
| | | <!-- label="ä¸è¯æ°é"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- align="center"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <el-input-->
|
| | | <!-- v-model="row.badqty"-->
|
| | | <!-- placeholder="请è¾å
¥æ°é"-->
|
| | | <!-- oninput="value=value.replace(/[^0-9]/g,'')"-->
|
| | | <!-- style="width: 100%"-->
|
| | | <!-- @click.stop=""-->
|
| | | <!-- @change="badqtyChange"-->
|
| | | <!-- />-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | |
|
| | | <!-- <el-table-column-->
|
| | | <!-- label="æä½"-->
|
| | | <!-- width="50"-->
|
| | | <!-- align="center"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <div class="operationClass">-->
|
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">-->
|
| | | <!-- <i-->
|
| | | <!-- class="el-icon-delete"-->
|
| | | <!-- :style="{color:$store.state.settings.theme}"-->
|
| | | <!-- style="margin-left: 7px;"-->
|
| | | <!-- @click="defectDel(row)"-->
|
| | | <!-- />-->
|
| | | <!-- </el-tooltip>-->
|
| | | <!-- </div>-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | |
|
| | | </el-table>
|
| | | </el-form>
|
| | |
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- æµè½¬å°æ ç¾æå°-->
|
| | | <!--æå°é¢è§é¡µé¢ å°æ ç¾-->
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | title="é¢è§"
|
| | | :visible.sync="dialogVisible2"
|
| | | width="1140"
|
| | | top="10vh"
|
| | | :close-on-click-modal="false"
|
| | | @close="dialogVisible2Close"
|
| | | >
|
| | | <!-- è¦æå°çåºå -->
|
| | | <div id="printMe2" style="padding: 30px;">
|
| | | <div
|
| | | style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
|
| | | >
|
| | |
|
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
|
| | | <div
|
| | | style="display: flex;height: 90px;border-bottom:1px solid #000;
|
| | | justify-content: center;align-items: center;position: relative"
|
| | | >
|
| | | <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
|
| | | >
|
| | | <div style="margin-left: 5px;width: 28px">æ°é:</div>
|
| | | {{ qrForm.startqty }}
|
| | | </div>
|
| | | <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
|
| | | <div style="margin-left: 5px;width: 42px">å¤ç人:</div>
|
| | | {{ qrForm.operator }}
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div style="width:190px;display: flex;flex-direction: column">
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width: 60px;margin-left: 5px;">å·¥åç¼å·:</div>
|
| | | <div>{{ qrForm.wo_code }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
|
| | | >
|
| | | <div style="width: 60px;margin-left: 5px;">产åç¼ç :</div>
|
| | | <div>{{ qrForm.partcode }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width:60px;margin-left: 5px;">产ååç§°:</div>
|
| | | <div>{{ qrForm.partname }}</div>
|
| | | </div>
|
| | | <div
|
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
|
| | | >
|
| | | <div style="width:60px;margin-left: 5px;">{{ qrForm.nextstepname?'ä¸éå·¥åº':'产åè§æ ¼' }}:</div>
|
| | | <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</div>
|
| | | </div>
|
| | | <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
|
| | | <div style="width: 60px;margin-left: 5px;">å¤çæ¶é´:</div>
|
| | | <div>{{ qrForm.operatorTime }}</div>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisible2 = false">å æ¶</el-button>
|
| | | <el-button v-waves v-print="printObj2" type="primary">ç¡® å®</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | |
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import $ from 'jquery'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import {
|
| | | EditOrderNgStepSeave,
|
| | | MesOrderNgStepSearch,
|
| | | MesOrderNgSubStepSearch,
|
| | | MesOrderStepSearch, MesOrderStepStart,
|
| | | MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport
|
| | | } from '@/api/WorkOrder'
|
| | | import {
|
| | | CustomerPermissions,
|
| | | DefectPermissions,
|
| | | EqpPermissions,
|
| | | GroupsPermissions,
|
| | | GroupsPersonPermissions,
|
| | | PersonPermissions, PrentOrganizationNoCompany
|
| | | } from '@/api/GeneralBasicData'
|
| | | import { nanoid } from 'nanoid'
|
| | | import { LabelBarCode } from '@/api/systemSetting'
|
| | | import { getCookie } from '@/utils/auth'
|
| | | import { handleDatetime2 } from '@/utils/global'
|
| | | import QRCode from 'qrcodejs2'
|
| | | export default {
|
| | | name: 'StepReport',
|
| | | components: {
|
| | | Pagination
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | return {
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | wkshopcode: '',
|
| | | wocode: '', // å·¥åå·
|
| | | partcode: '', // 产åç¼ç
|
| | | partname: '', // 产ååç§°
|
| | | partspec: '', // 产åè§æ ¼
|
| | | prop: 'lm_date', // æåºå段
|
| | | order: 'desc', // æåºå段
|
| | | page: 1, // 第å 页
|
| | | rows: 20 // æ¯é¡µå¤å°æ¡
|
| | | },
|
| | | wkshopcodeArr: [],
|
| | | total: 10,
|
| | | tableData: [],
|
| | | activeName: 'ç产å表',
|
| | | elTabsArr: [
|
| | | { code: 'ZZ', name: 'ç产å表' },
|
| | | { code: 'OUT', name: 'å¤ååæ' },
|
| | | { code: 'IN', name: 'å¤åæ¶æ' },
|
| | | { code: 'BAD', name: 'ä¸è¯å¾
å¤ç' }
|
| | | ],
|
| | |
|
| | | radioSelected: '', // å¤éæ¡éä¸å¼
|
| | |
|
| | | dialogVisible: false,
|
| | | dialogTitle: '', // å¯¹è¯æ¡å°æ é¢
|
| | |
|
| | | dialogForm: {
|
| | | 'wo_code': '',
|
| | | 'partnumber': '',
|
| | | 'partname': '',
|
| | | 'partspec': '',
|
| | | 'seq': '',
|
| | | 'stepcode': '',
|
| | | 'stepname': '',
|
| | | 'stepprice': '', // å·¥åºåä»·
|
| | | 'nextstepcode': '',
|
| | | 'nextstepname': '',
|
| | | 'nextstepprice': '',
|
| | | 'stepdesc': '',
|
| | | 'planqty': 0,
|
| | | 'startqty': 0, //
|
| | | 'noreportqty': 0, // æªæ¥æ°é
|
| | | 'reportqty': 0, // å·²æ¥æ°é
|
| | | 'noputqty': 0, // ä¸è¯æ°é
|
| | | 'wkshopcode': '',
|
| | | 'wkshopname': '',
|
| | | 'eqpcode': '',
|
| | | 'eqpname': '',
|
| | |
|
| | | remarks: '', // 夿³¨
|
| | | inbarcode: '', // å
¥åºæ¡ç
|
| | | defectlist: '', // ä¸è¯æ±æ»
|
| | | reckway: 'person', // 计件æ¹å¼(çç»:groupã个人:person)
|
| | | usergroupcode: '', // çç»ç¼ç
|
| | | reportuser: [], // æ¥å·¥äººå
|
| | |
|
| | | wxcode: '',
|
| | | outuser: '',
|
| | | fqty: '',
|
| | | inuser: '',
|
| | | sqty: '',
|
| | | list: ''
|
| | |
|
| | | },
|
| | | dialogFormRules: {
|
| | | eqpcode: [
|
| | | { required: true, message: 'è¯·éæ©æ¥å·¥è®¾å¤', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | usergroupcode: [
|
| | | { required: true, message: 'è¯·éæ©æ¥å·¥çç»', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | reportuser: [
|
| | | { required: true, message: 'è¯·éæ©æ¥å·¥äººå', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | startqty: [
|
| | | { required: true, message: '请è¾å
¥åæ ¼æ°é', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | wxcode: [
|
| | | { required: true, message: 'è¯·éæ©å¤å便¹', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | outuser: [
|
| | | { required: true, message: 'è¯·éæ©åæäººå', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | inuser: [
|
| | | { required: true, message: 'è¯·éæ©æ¶æäººå', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | fqty: [
|
| | | { required: true, message: '请è¾å
¥åææ°é', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | sqty: [
|
| | | { required: true, message: '请è¾å
¥æ¶ææ°é', trigger: ['blur', 'change'] }
|
| | | ]
|
| | |
|
| | | },
|
| | | reckwayArr: [// æ¥å·¥ç±»å
|
| | | { code: 'group', name: 'çç»' },
|
| | | { code: 'person', name: '个人' }
|
| | | ],
|
| | | reportuserArr: [], // æ¥å·¥äººå
|
| | | usergroupArr: [], // æ¥å·¥çç»
|
| | | eqpArr: [], // æ¥å·¥è®¾å¤
|
| | | defectArr: [], // ä¸è¯ç¼ºé·
|
| | | wxArr: [], // 徿¥åä½ä¸æ
|
| | |
|
| | | defectTableData: [],
|
| | | badTableData: [],
|
| | | workOrderCurrentValue: '',
|
| | |
|
| | | dialogVisible2: false, //
|
| | | qrForm: { // æå°å
容
|
| | | qrvalue: '',
|
| | | startqty: '',
|
| | | wo_code: '',
|
| | | partcode: '',
|
| | | partname: '',
|
| | | partspec: '',
|
| | | nextstepname: '',
|
| | | operator: '', // æä½äºº
|
| | | operatorTime: ''// æä½æ¶é´
|
| | | },
|
| | | printObj2: {
|
| | | id: 'printMe2',
|
| | | popTitle: 'æå°æ¨¡æ¿',
|
| | | preview: false,
|
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
|
| | | closeCallback(vue) { // å
³éæå°çåè°äºä»¶ï¼æ æ³ç¡®å®ç¹å»çæ¯ç¡®è®¤è¿æ¯åæ¶ï¼
|
| | | console.log('11212', vue)
|
| | | // vue.dialogVisible = false
|
| | | vue.dialogVisible2 = false
|
| | | vue.dialogVisible = false
|
| | | },
|
| | | beforeOpenCallback(vue) {
|
| | | vue.printLoading = true
|
| | | console.log('æå¼ä¹å')
|
| | | },
|
| | | openCallback(vue) {
|
| | | vue.printLoading = false
|
| | | console.log('æ§è¡äºæå°')
|
| | | }
|
| | | },
|
| | | xx: ''
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | |
|
| | | this.tabClick()
|
| | |
|
| | | this.getAllSelectArr()
|
| | | },
|
| | | methods: {
|
| | |
|
| | | async getAllSelectArr() {
|
| | | const { data: res1 } = await GroupsPermissions()// çç»
|
| | | this.usergroupArr = res1
|
| | |
|
| | | const { data: res2 } = await PersonPermissions() // 人å
|
| | | this.reportuserArr = res2
|
| | |
|
| | | const { data: res3 } = await DefectPermissions() // 缺é·
|
| | | this.defectArr = res3
|
| | |
|
| | | const { data: res4 } = await EqpPermissions() // 设å¤
|
| | | this.eqpArr = res4
|
| | |
|
| | | const { data: res5 } = await CustomerPermissions() // 徿¥åä½
|
| | | this.wxArr = res5
|
| | |
|
| | | const { data: res6 } = await PrentOrganizationNoCompany()// æ å
¬å¸çç»ç»ä¸æ
|
| | | this.wkshopcodeArr = res6
|
| | | },
|
| | | tabClick() {
|
| | | let belong
|
| | | switch (this.activeName) {
|
| | | case 'ç产å表':
|
| | | belong = 'produceCodeZZ'
|
| | | this.dialogTitle = 'æ¥å·¥'
|
| | | break
|
| | | case 'å¤ååæ':
|
| | | belong = 'produceCodeOUT'
|
| | | this.dialogTitle = 'åæ'
|
| | | break
|
| | | case 'å¤åæ¶æ':
|
| | | belong = 'produceCodeIN'
|
| | | this.dialogTitle = 'æ¶æ'
|
| | | break
|
| | | case 'ä¸è¯å¾
å¤ç':
|
| | | belong = 'produceCodeBAD'
|
| | | this.dialogTitle = 'ä¸è¯å¤ç'
|
| | | break
|
| | | }
|
| | | this.enterNative(this.form.wocode, belong)
|
| | |
|
| | | this.radioSelected = ''
|
| | | },
|
| | | enterNative(val, belong) {
|
| | | if (belong === 'produceCodeZZ') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeZZ\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeOUT') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeOUT\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeIN') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeIN\']')[0].focus()
|
| | | })
|
| | | }
|
| | | if (belong === 'produceCodeBAD') {
|
| | | this.$nextTick(() => {
|
| | | $('input[name=\'produceCodeBAD\']')[0].focus()
|
| | | })
|
| | | }
|
| | | this.search()
|
| | | },
|
| | | // æåºæ¹åæ¶
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.search()
|
| | | },
|
| | | // æ¥è¯¢
|
| | | async search() {
|
| | | this.form.wocode = this.workOrderCurrentValue
|
| | | this.workOrderCurrentValue = ''
|
| | | if (this.activeName === 'ç产å表') {
|
| | | const res = await MesOrderStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | | if (this.activeName === 'å¤ååæ' || this.activeName === 'å¤åæ¶æ') {
|
| | | const res = await MesOrderWxStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | |
|
| | | if (this.activeName === 'ä¸è¯å¾
å¤ç') {
|
| | | const res = await MesOrderNgStepSearch(this.form)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | }
|
| | | },
|
| | | // æ¥å·¥
|
| | | report(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // åæ
|
| | | sendOut(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('WX', 'OUT', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('WX', 'OUT', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // æ¶æ
|
| | | takeIn(row) {
|
| | | if (row) {
|
| | | this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode)
|
| | | } else {
|
| | | const temp = this.tableData.find(i => i.id === this.radioSelected)
|
| | | this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode)
|
| | | }
|
| | | },
|
| | | // ä¸è¯å¤ç çäº§å¼æ¥å·¥æ«ç è·åå·¥å对åºå·¥åºä»»å¡(ä¸è¯æç»)
|
| | | async handleBad(row) {
|
| | | const data = {
|
| | | wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code,
|
| | | stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode
|
| | | }
|
| | | let res = await MesOrderNgSubStepSearch(data)
|
| | | if (res.code === '200') {
|
| | | res = res.data
|
| | | this.dialogForm.wo_code = res.data1.wo_code
|
| | | this.dialogForm.partnumber = res.data1.partnumber
|
| | | this.dialogForm.partname = res.data1.partname
|
| | | this.dialogForm.partspec = res.data1.partspec
|
| | | this.dialogForm.seq = res.data1.seq
|
| | | this.dialogForm.stepcode = res.data1.stepcode
|
| | | this.dialogForm.stepname = res.data1.stepname
|
| | | this.dialogForm.stepprice = res.data1.stepprice
|
| | | this.dialogForm.nextstepcode = res.data1.nextstepcode
|
| | | this.dialogForm.nextstepname = res.data1.nextstepname
|
| | | this.dialogForm.nextstepprice = res.data1.nextstepprice
|
| | | this.dialogForm.stepdesc = res.data1.stepdesc
|
| | | this.dialogForm.planqty = res.data1.planqty
|
| | | this.dialogForm.startqty = res.data1.startqty
|
| | | this.dialogForm.noreportqty = res.data1.noreportqty // åæ ¼æ°é
|
| | | this.dialogForm.reportqty = res.data1.reportqty
|
| | | this.dialogForm.noputqty = res.data1.noputqty // ä¸è¯æ°é
|
| | | this.dialogForm.wkshopcode = res.data1.wkshopcode
|
| | | this.dialogForm.wkshopname = res.data1.wkshopname
|
| | | this.dialogForm.eqpcode = res.data1.eqpcode
|
| | | this.dialogForm.eqpname = res.data1.eqpname
|
| | |
|
| | | res.data2.forEach(item => {
|
| | | item.repair_qty = 0
|
| | | item.laborbad_qty = 0
|
| | | item.materielbad_qty = 0
|
| | | })
|
| | |
|
| | | this.badTableData = res.data2
|
| | |
|
| | | this.dialogVisible = true
|
| | | }
|
| | | },
|
| | | // çäº§å¼æ¥å·¥ï¼æ¥å·¥/å¤å(åæ/æ¶æ)æ¶æ¡ä»¶å¤æåæ°æ®è¿åæ¥å£
|
| | | async getMesOrderStepStart(OperType, SelectType, wocode, stepcode) {
|
| | | const data = {
|
| | | OperType, SelectType, wocode, stepcode
|
| | | }
|
| | | let res = await MesOrderStepStart(data)
|
| | | if (res.code === '200') {
|
| | | res = res.data
|
| | | this.dialogForm.wo_code = res.wo_code
|
| | | this.dialogForm.partnumber = res.partnumber
|
| | | this.dialogForm.partname = res.partname
|
| | | this.dialogForm.partspec = res.partspec
|
| | | this.dialogForm.seq = res.seq
|
| | | this.dialogForm.stepcode = res.stepcode
|
| | | this.dialogForm.stepname = res.stepname
|
| | | this.dialogForm.stepprice = res.stepprice
|
| | | this.dialogForm.nextstepcode = res.nextstepcode
|
| | | this.dialogForm.nextstepname = res.nextstepname
|
| | | this.dialogForm.nextstepprice = res.nextstepprice
|
| | | this.dialogForm.stepdesc = res.stepdesc
|
| | | this.dialogForm.planqty = res.planqty
|
| | | this.dialogForm.startqty = res.startqty
|
| | | this.dialogForm.noreportqty = res.noreportqty// æªæ¥æ°é
|
| | | this.dialogForm.reportqty = res.reportqty // å·²æ¥æ°é
|
| | | this.dialogForm.noputqty = res.noputqty
|
| | | this.dialogForm.wkshopcode = res.wkshopcode
|
| | | this.dialogForm.wkshopname = res.wkshopname
|
| | | this.dialogForm.eqpcode = res.eqpcode
|
| | | this.dialogForm.eqpname = res.eqpname
|
| | |
|
| | | if (this.activeName === 'å¤åæ¶æ') {
|
| | | this.dialogForm.list = []
|
| | | res.list.forEach(i => {
|
| | | i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty)
|
| | | if (i.acceptQty > 0) {
|
| | | this.dialogForm.list.push(i)
|
| | | }
|
| | | })
|
| | | }
|
| | |
|
| | | // this.dialogForm.list = res.list
|
| | |
|
| | | this.dialogVisible = true
|
| | | }
|
| | | },
|
| | | // å¯¹è¯æ¡å
³éäºä»¶
|
| | | handleClose() {
|
| | | this.dialogForm = {
|
| | | 'wo_code': '',
|
| | | 'partnumber': '',
|
| | | 'partname': '',
|
| | | 'partspec': '',
|
| | | 'seq': '',
|
| | | 'stepcode': '',
|
| | | 'stepname': '',
|
| | | 'stepprice': '', // å·¥åºåä»·
|
| | | 'nextstepcode': '',
|
| | | 'nextstepname': '',
|
| | | 'nextstepprice': '',
|
| | | 'stepdesc': '',
|
| | | 'planqty': 0,
|
| | | 'startqty': 0, //
|
| | | 'noreportqty': 0, // æªæ¥æ°é
|
| | | 'reportqty': 0, // å·²æ¥æ°é
|
| | | 'noputqty': 0, // ä¸è¯æ°é
|
| | | 'wkshopcode': '',
|
| | | 'wkshopname': '',
|
| | | 'eqpcode': '',
|
| | | 'eqpname': '',
|
| | |
|
| | | wxcode: '',
|
| | | outuser: '',
|
| | | fqty: '',
|
| | | inuser: '',
|
| | | sqty: '',
|
| | | list: '',
|
| | |
|
| | | remarks: '', // 夿³¨
|
| | | inbarcode: '', // å
¥åºæ¡ç
|
| | | defectlist: '', // ä¸è¯æ±æ»
|
| | | reckway: 'person', // 计件æ¹å¼(çç»:groupã个人:person)
|
| | | usergroupcode: '', // çç»ç¼ç
|
| | | reportuser: [] // æ¥å·¥äººå
|
| | |
|
| | | }
|
| | |
|
| | | this.defectTableData = []
|
| | | this.badTableData = []
|
| | |
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // å¯¹è¯æ¡åæ¶
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | this.tabClick()
|
| | | },
|
| | | // å¯¹è¯æ¡ç¡®è®¤
|
| | | dialogVisibleConfirm() {
|
| | | this.$refs.dialogForm.validate(async valid => {
|
| | | if (valid) {
|
| | | if (this.activeName === 'ç产å表') {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼')
|
| | | }
|
| | |
|
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('åæ ¼æ°éå ä¸è¯æ°éä¸è½å¤§äºäºæªæ¥æ°é!')
|
| | | }
|
| | | let inbarcode = ''
|
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
|
| | | const data1 = {
|
| | | rightcode: getCookie('ruleCode'),
|
| | | partcode: this.dialogForm.partnumber,
|
| | | qty: this.dialogForm.startqty,
|
| | | onelabqty: this.dialogForm.startqty
|
| | | }
|
| | |
|
| | | const res1 = await LabelBarCode(data1)
|
| | | inbarcode = res1.data[0].labcode
|
| | | }
|
| | |
|
| | | const defectlist = []
|
| | | this.defectTableData.forEach(i => {
|
| | | defectlist.push({
|
| | | defect_code: i.code.join(','),
|
| | | badqty: i.badqty
|
| | | })
|
| | | })
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | | stepprice: this.dialogForm.stepprice,
|
| | | eqpcode: this.dialogForm.eqpcode,
|
| | | inbarcode,
|
| | | reckway: this.dialogForm.reckway,
|
| | | usergroupcode: this.dialogForm.usergroupcode,
|
| | | reportuser: this.dialogForm.reportuser.join(','),
|
| | | taskqty: this.dialogForm.planqty,
|
| | | // startqty: this.dialogForm.startqty,
|
| | | // reportqty: this.dialogForm.reportqty,
|
| | |
|
| | | startqty: this.dialogForm.startqty,
|
| | | reportqty: this.dialogForm.startqty, // æ¥å·¥æ°é
|
| | |
|
| | | defectlist,
|
| | | remarks: ''
|
| | | }
|
| | | // console.log(JSON.parse(JSON.stringify(this.defectTableData)))
|
| | | // console.log(JSON.parse(JSON.stringify(data)))
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepReport(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('æ¥å·¥æåï¼')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | |
|
| | | // èªå¶æ¥å·¥æå°æ ç¾å£åå·²å¼å¥½
|
| | | // if (JSON.parse(localStorage.getItem('mesSetting')).every) {
|
| | | // this.dialogVisible2 = true
|
| | | // this.ZZprint2(localStorage.getItem('username'))
|
| | | // }
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('æ¥å·¥å¤±è´¥ï¼')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === 'å¤ååæ') {
|
| | | if (parseFloat(this.dialogForm.fqty) < 1) {
|
| | | return this.$message.info('åææ°éä¸è½ä¸ºé¶ï¼')
|
| | | }
|
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) {
|
| | | return this.$message.info('åææ°éä¸è½å¤§äºæªåæ°é!')
|
| | | }
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | |
|
| | | wxcode: this.dialogForm.wxcode,
|
| | | outuser: this.dialogForm.outuser,
|
| | | taskqty: this.dialogForm.planqty,
|
| | | fqty: this.dialogForm.fqty
|
| | | }
|
| | | // console.log(JSON.stringify(data))
|
| | |
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepOut(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('åææåï¼')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('åæå¤±è´¥ï¼')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === 'å¤åæ¶æ') {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼')
|
| | | }
|
| | |
|
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('æ¶ææ°éå ä¸è¯æ°éä¸è½å¤§äºäºå¯æ¶æ°é!')
|
| | | }
|
| | |
|
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) {
|
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
|
| | | return this.$message.info('æ¶ææ°éå ä¸è¯æ°éä¸è½å¤§äºè¯¥ä¾åºå坿¶æ°é!')
|
| | | }
|
| | | } else {
|
| | | return this.$message.info('æ¤ä¾åºåæ 坿¶æ°é!')
|
| | | }
|
| | |
|
| | | let inbarcode = ''
|
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
|
| | | const data1 = {
|
| | | rightcode: getCookie('ruleCode'),
|
| | | partcode: this.dialogForm.partnumber,
|
| | | qty: this.dialogForm.startqty,
|
| | | onelabqty: this.dialogForm.startqty
|
| | | }
|
| | |
|
| | | const res1 = await LabelBarCode(data1)
|
| | | inbarcode = res1.data[0].labcode
|
| | | }
|
| | | const defectlist = []
|
| | | this.defectTableData.forEach(i => {
|
| | | defectlist.push({
|
| | | defect_code: i.code.join(','),
|
| | | badqty: i.badqty
|
| | | })
|
| | | })
|
| | |
|
| | | const data = {
|
| | | mesordercode: this.dialogForm.wo_code,
|
| | | partcode: this.dialogForm.partnumber,
|
| | | stepseq: this.dialogForm.seq,
|
| | | stepcode: this.dialogForm.stepcode,
|
| | |
|
| | | wxcode: this.dialogForm.wxcode,
|
| | | inbarcode,
|
| | | inuser: this.dialogForm.inuser,
|
| | | taskqty: this.dialogForm.planqty,
|
| | | sqty: this.dialogForm.sqty,
|
| | | defectlist,
|
| | | remarks: ''
|
| | | }
|
| | | // console.log(JSON.parse(JSON.stringify(data)), 1)
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await SavaMesOrderStepIn(data)
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('æ¶ææåï¼')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('æ¶æå¤±è´¥ï¼')
|
| | | }
|
| | | }
|
| | |
|
| | | if (this.activeName === 'ä¸è¯å¾
å¤ç') {
|
| | | let flag = false
|
| | | this.badTableData.forEach(i => {
|
| | | if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) {
|
| | | flag = true
|
| | | }
|
| | | })
|
| | | if (flag) {
|
| | | return this.$message.info('ç»´ä¿®åæ ¼æ°é+å·¥åºæ°é+æåºæ°éä¸è½å¤§äºä¸è¯æ°éï¼')
|
| | | }
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const res = await EditOrderNgStepSeave({ Data: this.badTableData })
|
| | | if (res.code === '200') {
|
| | | this.$notify.success('æäº¤æåï¼')
|
| | | // await this.search()
|
| | | await this.tabClick()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.dialogVisible = false
|
| | | } else {
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | this.$notify.error('æäº¤å¤±è´¥ï¼')
|
| | | }
|
| | | }
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | dialogVisible2Close() {
|
| | | this.qrForm.qrvalue = ''
|
| | | this.qrForm.startqty = ''
|
| | | this.qrForm.wo_code = ''
|
| | | this.qrForm.partcode = ''
|
| | | this.qrForm.partname = ''
|
| | | this.qrForm.partspec = ''
|
| | | this.qrForm.nextstepname = ''
|
| | | this.qrForm.operator = ''
|
| | | this.qrForm.operatorTime = ''
|
| | | // this.$refs.qrCodeDiv2 = ''
|
| | | },
|
| | |
|
| | | ZZprint2(username) {
|
| | | if (this.dialogForm.nextstepcode !== '') {
|
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
|
| | | } else {
|
| | | this.qrForm.qrvalue = this.dialogForm.inbarcode
|
| | | }
|
| | |
|
| | | this.qrForm.startqty = this.dialogForm.startqty
|
| | | this.qrForm.wo_code = this.dialogForm.wo_code
|
| | | this.qrForm.partcode = this.dialogForm.partnumber
|
| | | this.qrForm.partname = this.dialogForm.partname
|
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname
|
| | | this.qrForm.operator = username
|
| | | this.qrForm.operatorTime = handleDatetime2(new Date())
|
| | | this.$nextTick(() => {
|
| | | this.bindQRCode(this.qrForm.qrvalue)
|
| | | })
|
| | | },
|
| | | // çæäºç»´ç
|
| | | bindQRCode(text) {
|
| | | new QRCode(this.$refs.qrCodeDiv2, {
|
| | | text: text,
|
| | | // width: 50,
|
| | | width: 60,
|
| | | // height: 50,
|
| | | height: 60,
|
| | | colorDark: '#000', // äºç»´ç é¢è²
|
| | | colorLight: '#ffffff', // äºç»´ç èæ¯è²
|
| | | correctLevel: QRCode.CorrectLevel.L// 容éçï¼L/M/H
|
| | | })
|
| | | },
|
| | | // ç¼ºé·æ°å¢
|
| | | addDefect() {
|
| | | if (this.defectTableData.find(i => i.code.length === 0)) {
|
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼')
|
| | | }
|
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
|
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼')
|
| | | }
|
| | |
|
| | | this.defectTableData.push({
|
| | | uuid: nanoid(), code: [], badqty: ''
|
| | | })
|
| | | },
|
| | | // 缺é·å é¤
|
| | | defectDel(row) {
|
| | | this.defectTableData = this.defectTableData.filter(i => i.uuid !== row.uuid)
|
| | |
|
| | | this.dialogForm.noputqty = 0
|
| | | this.defectTableData.forEach(i => {
|
| | | this.dialogForm.noputqty += parseFloat(i.badqty)
|
| | | })
|
| | | },
|
| | | badqtyChange(val) {
|
| | | this.dialogForm.noputqty = 0
|
| | | this.defectTableData.forEach(i => {
|
| | | this.dialogForm.noputqty += parseFloat(i.badqty)
|
| | | })
|
| | | },
|
| | | reckwayChange(val) {
|
| | | // console.log(val)
|
| | | this.dialogForm.usergroupcode = ''
|
| | | this.dialogForm.reportuser = []
|
| | | },
|
| | | async usergroupChange(val) {
|
| | | const { data: res } = await GroupsPersonPermissions({ groupcode: val })
|
| | | this.dialogForm.reportuser = res[0].usercode_list ? res[0].usercode_list.split(',') : []
|
| | | },
|
| | | rowClick(row, event, column) {
|
| | | this.radioSelected = row.id
|
| | | },
|
| | | // è·å页é¢é«åº¦
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 275
|
| | | // this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | reset() {
|
| | | this.form.wkshopcode = ''
|
| | | this.form.wocode = ''
|
| | | this.form.workOrderCurrentValue = ''
|
| | | this.form.partcode = ''
|
| | | this.form.partname = ''
|
| | | this.form.partspec = ''
|
| | | this.search()
|
| | | },
|
| | |
|
| | | headerCellStyle() {
|
| | | return this.$headerCellStyle
|
| | | },
|
| | | cellStyle() {
|
| | | return this.$cellStyle
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | | <style lang="scss" scoped>
|
| | |
|
| | | ::v-deep .elTableDiv .el-radio__label {
|
| | | display: none !important;
|
| | | }
|
| | |
|
| | | .dialogFormItem {
|
| | | margin: 0 10px 0 0;
|
| | | }
|
| | |
|
| | | .dialogFormItemDiv {
|
| | | width: 200px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-select__caret {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog .el-form-item__label {
|
| | | font-weight: lighter !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog .el-divider__text {
|
| | | font-weight: bolder !important;
|
| | | }
|
| | |
|
| | | </style>
|
| | | <template> |
| | | <div> |
| | | <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}"> |
| | | |
| | | <div style="position: absolute;right:36px;z-index: 2;top: 13px"> |
| | | <el-button |
| | | v-if="activeName==='ç产å表'&&tableData.length>0" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="primary" |
| | | :disabled="radioSelected===''" |
| | | @click="report()" |
| | | >æ¥å·¥ |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='å¤ååæ'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="sendOut()" |
| | | >åæ |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='å¤åæ¶æ'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="takeIn()" |
| | | >æ¶æ |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'&&tableData.length>0" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-thumb" |
| | | :disabled="radioSelected===''" |
| | | @click="handleBad()" |
| | | >å¤ç |
| | | </el-button> |
| | | </div> |
| | | |
| | | <div v-if="form.wocode" style="position: absolute;left: 460px;z-index: 2;top: 23px;font-weight: bolder"> |
| | | å½åå·¥åå·ä¸ºï¼{{ form.wocode }} |
| | | </div> |
| | | |
| | | <el-tabs |
| | | ref="elTabs" |
| | | v-model="activeName" |
| | | type="border-card" |
| | | @tab-click="tabClick" |
| | | > |
| | | |
| | | <el-tab-pane |
| | | v-for="item in elTabsArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :name="item.name" |
| | | > |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | |
| | | <el-form-item label="å·¥åå·" style=" display: flex;"> |
| | | <el-input |
| | | v-model="workOrderCurrentValue" |
| | | :name="'produceCode'+item.code" |
| | | placeholder="è¯·æ«ææè¾å
¥" |
| | | style="width: 300px" |
| | | |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产åç¼ç " style=" display: flex;"> |
| | | <el-input |
| | | v-model="form.partcode" |
| | | placeholder="请è¾å
¥" |
| | | style="width: 200px" |
| | | |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°" style=" display: flex;"> |
| | | <el-input |
| | | v-model="form.partname" |
| | | placeholder="请è¾å
¥" |
| | | |
| | | style="width: 200px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="车é´åç§°" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.wkshopcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopcodeArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- <el-form-item label="è§æ ¼åå·" style=" display: flex;">--> |
| | | <!-- <el-input v-model="form.partspec" placeholder="请è¾å
¥" style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | style="height:5px" |
| | | > |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseout'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"--> |
| | | <!-- @mouseenter="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | <!-- <svg-icon--> |
| | | <!-- v-show="mouseHoverType==='mouseenter'"--> |
| | | <!-- style="cursor: pointer"--> |
| | | <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"--> |
| | | <!-- @click="isExpandForm=!isExpandForm"--> |
| | | <!-- @mouseout="mouseHoverType=$event.type"--> |
| | | <!-- />--> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :key="'tableDataRef'+item.code" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight+50" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:tableHeight+'px'}" |
| | | highlight-current-row |
| | | :header-cell-style="headerCellStyle()" |
| | | :cell-style="cellStyle()" |
| | | @sort-change="sortChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <el-table-column |
| | | width="50" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="radioSelected" |
| | | :label="row.id" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | label="åºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | v-if="activeName!=='ä¸è¯å¾
å¤ç'" |
| | | prop="status" |
| | | show-tooltip-when-overflow |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | width="80" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div> |
| | | <div v-if="row.status==='ALLO'">已派å</div> |
| | | <div v-if="row.status==='START'">å¼å·¥</div> |
| | | <div v-if="row.status==='CLOSED'">å®å·¥</div> |
| | | <div v-if="row.status==='NOSCHED'">å¾
æç¨</div> |
| | | <div v-if="row.status==='SCHED'">å·²æç¨</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="å·¥åå·" |
| | | min-width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | min-width="110" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="产ååç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="è§æ ¼åå·" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | min-width="110" |
| | | show-tooltip-when-overflow |
| | | label="车é´åç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åºåç§°" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="110" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | v-if="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'" |
| | | prop="fqty" |
| | | show-tooltip-when-overflow |
| | | label="已忿°é" |
| | | sortable="custom" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | show-tooltip-when-overflow |
| | | :label="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'?'å·²æ¶ææ°é':'åæ ¼æ°é'" |
| | | sortable="custom" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="å·¥åºæ°é" |
| | | width="120" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="æåºæ°é" |
| | | width="120" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="priuserdefnvc1" |
| | | label="客æ·åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc1 ? row.priuserdefnvc1 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc6" |
| | | label="客æ·ç¼ç " |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc6 ? row.priuserdefnvc6 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc2" |
| | | label="对å
åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc2 ? row.priuserdefnvc2 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc3" |
| | | label="CTPæ¥æ" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc3 ? row.priuserdefnvc3 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc4" |
| | | label="é¢åç¼å·" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc4 ? row.priuserdefnvc4 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc5" |
| | | label="çå" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc5 ? row.priuserdefnvc5 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="activeName==='ç产å表'" v-waves icon="el-icon-thumb" type="text" @click="report(row)"> |
| | | æ¥å·¥ |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='å¤ååæ'" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="text" |
| | | @click="sendOut(row)" |
| | | >åæ |
| | | </el-button> |
| | | <el-button v-if="activeName==='å¤åæ¶æ'" v-waves icon="el-icon-thumb" type="text" @click="takeIn(row)"> |
| | | æ¶æ |
| | | </el-button> |
| | | <el-button |
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'" |
| | | v-waves |
| | | icon="el-icon-thumb" |
| | | type="text" |
| | | @click="handleBad(row)" |
| | | >å¤ç |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="search" |
| | | /> |
| | | </el-tab-pane> |
| | | |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | |
| | | <!-- 弿¥å·¥ãå¤åãä¸è¯å¤ç--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="dialogVisible" |
| | | width="1160px" |
| | | :close-on-click-modal="false" |
| | | :top="activeName==='ç产å表'||activeName==='å¤åæ¶æ'? '6vh':'15vh'" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px"> |
| | | <!-- <el-divider v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'||activeName==='ä¸è¯å¾
å¤ç'" content-position="left">åºæ¬ä¿¡æ¯</el-divider>--> |
| | | <el-divider v-if="activeName==='ç产å表'" content-position="left">æ¥å·¥ä¿¡æ¯</el-divider> |
| | | <el-divider v-if="activeName==='å¤åæ¶æ'" content-position="left">æ¶æä¿¡æ¯</el-divider> |
| | | <el-divider v-if="activeName==='ä¸è¯å¾
å¤ç'" content-position="left">å¾
å¤çä¿¡æ¯</el-divider> |
| | | <el-form-item label="å·¥åç¼å·" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产åç¼ç " class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partnumber }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼åå·" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åå·¥åº" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸éå·¥åº" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="任塿°é" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='ä¸è¯å¾
å¤ç'" label="åæ ¼æ°é" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='ä¸è¯å¾
å¤ç'" label="ä¸è¯æ°é" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noputqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="activeName!=='ä¸è¯å¾
å¤ç'" |
| | | :label="activeName==='ç产å表'? 'æªæ¥/å·²æ¥':(activeName==='å¤ååæ'?'æªå/å·²å':'æªæ¶/å·²æ¶')" |
| | | class="dialogFormItem" |
| | | > |
| | | <div class="dialogFormItemDiv">{{ dialogForm.noreportqty + '/' + dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" label="ä¸è¯æ°é" class="dialogFormItem"> |
| | | <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='ç产å表'" label="æ¥å·¥è®¾å¤" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | clearable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in eqpArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='ç产å表'" label="计件æ¹å¼" class="dialogFormItem"> |
| | | <el-radio-group |
| | | v-model="dialogForm.reckway" |
| | | style="width: 200px;" |
| | | @change="reckwayChange" |
| | | > |
| | | <el-radio label="person">个人</el-radio> |
| | | <el-radio label="group">çç»</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="activeName==='ç产å表'" |
| | | :prop="dialogForm.reckway==='group'?'usergroupcode':''" |
| | | label="æ¥å·¥çç»" |
| | | class="dialogFormItem" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.usergroupcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :disabled="dialogForm.reckway!=='group'" |
| | | :popper-append-to-body="false" |
| | | @change="usergroupChange" |
| | | > |
| | | <el-option |
| | | v-for="item in usergroupArr" |
| | | :key="item.usergroupcode" |
| | | :label="item.usergroupname" |
| | | :value="item.usergroupcode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='ç产å表'" prop="reportuser" label="æ¥å·¥äººå" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.reportuser" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | :multiple-limit="dialogForm.reckway==='group'?0:1" |
| | | :disabled="dialogForm.reckway==='group'&&dialogForm.usergroupcode===''" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='ç产å表'" prop="startqty" label="åæ ¼æ°é" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='å¤ååæ'||activeName==='å¤åæ¶æ'" prop="wxcode" label="å¤å便¹" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.wxcode" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in wxArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='å¤ååæ'" prop="outuser" label="åæäººå" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.outuser" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='å¤ååæ'" prop="fqty" label="åææ°é" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="activeName==='å¤åæ¶æ'" prop="inuser" label="æ¶æäººå" class="dialogFormItem"> |
| | | <el-select |
| | | v-model="dialogForm.inuser" |
| | | style="width:200px" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in reportuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="activeName==='å¤åæ¶æ'" prop="sqty" label="æ¶ææ°é" class="dialogFormItem"> |
| | | <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-divider v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" content-position="left">ä¸è¯æç»ä¿¡æ¯</el-divider> |
| | | <el-button |
| | | v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="addDefect" |
| | | >æ°å¢ |
| | | </el-button> |
| | | <el-table |
| | | v-if="activeName==='ç产å表'||activeName==='å¤åæ¶æ'" |
| | | ref="defectTableDataRef" |
| | | key="defectTableDataKey" |
| | | :data="defectTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | | height="200" |
| | | style="width: 100%;margin-top: 15px;" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column |
| | | prop="stepcode" |
| | | label="缺é·ç¼ç /åç§°" |
| | | align="center" |
| | | min-width="450" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-select |
| | | v-model="row.code" |
| | | style="width: 100%" |
| | | placeholder="è¯·éæ©" |
| | | multiple |
| | | filterable |
| | | > |
| | | <!-- collapse-tags--> |
| | | <el-option |
| | | v-for="item in defectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="badqty" |
| | | label="ä¸è¯æ°é" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.badqty" |
| | | placeholder="请è¾å
¥æ°é" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | @change="badqtyChange" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="50" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="margin-left: 7px;" |
| | | @click="defectDel(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-divider v-if="activeName==='å¤åæ¶æ'" content-position="left">坿¶æä¾åºå</el-divider> |
| | | <div |
| | | v-for="(item,index) in dialogForm.list" |
| | | v-if="item.fqty>0" |
| | | :key="item.name" |
| | | style="display: flex;line-height: 26px;height: 26px;margin-left:30px;align-items: center" |
| | | > |
| | | <div |
| | | style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%" |
| | | :style="{backgroundColor:$store.state.settings.theme}" |
| | | >{{ index + 1 }} |
| | | </div> |
| | | <div style="margin-left:30px;width: 160px;" class="ellipsis"> |
| | | {{ item.tp }} |
| | | </div> |
| | | <div style="margin-left:30px;"> |
| | | 坿¶æ°éï¼{{ item.acceptQty }} |
| | | </div> |
| | | </div> |
| | | |
| | | <el-divider v-if="activeName==='ä¸è¯å¾
å¤ç'" content-position="left">ä¸è¯ä¿¡æ¯æç»</el-divider> |
| | | <el-table |
| | | v-if="activeName==='ä¸è¯å¾
å¤ç'" |
| | | ref="badTableDataDataRef" |
| | | key="badTableDataDataKey" |
| | | :data="badTableData" |
| | | border |
| | | row-class-name="custom-row" |
| | | height="300" |
| | | style="width: 100%;margin-top: 15px;" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="step_code"--> |
| | | <!-- label="å·¥åºç¼ç "--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- align="center"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åºåç§°" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="report_qty" |
| | | label="åæ ¼æ°é" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="defect_name" |
| | | label="ä¸è¯åå " |
| | | show-tooltip-when-overflow |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="repair_qty" |
| | | label="ç»´ä¿®åæ ¼æ°é" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.repair_qty" |
| | | placeholder="请è¾å
¥æ°é" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="laborbad_qty" |
| | | label="å·¥åºæ°é" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.laborbad_qty" |
| | | placeholder="请è¾å
¥æ°é" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="materielbad_qty" |
| | | label="æåºæ°é" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.materielbad_qty" |
| | | placeholder="请è¾å
¥æ°é" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- prop="badqty"--> |
| | | <!-- label="ä¸è¯æ°é"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.badqty"--> |
| | | <!-- placeholder="请è¾å
¥æ°é"--> |
| | | <!-- oninput="value=value.replace(/[^0-9]/g,'')"--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- @click.stop=""--> |
| | | <!-- @change="badqtyChange"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | |
| | | <!-- <el-table-column--> |
| | | <!-- label="æä½"--> |
| | | <!-- width="50"--> |
| | | <!-- align="center"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- class="el-icon-delete"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="margin-left: 7px;"--> |
| | | <!-- @click="defectDel(row)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | |
| | | </el-table> |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- æµè½¬å°æ ç¾æå°--> |
| | | <!--æå°é¢è§é¡µé¢ å°æ ç¾--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="é¢è§" |
| | | :visible.sync="dialogVisible2" |
| | | width="1140" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | @close="dialogVisible2Close" |
| | | > |
| | | <!-- è¦æå°çåºå --> |
| | | <div id="printMe2" style="padding: 30px;"> |
| | | <div |
| | | style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | | > |
| | | |
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 90px;border-bottom:1px solid #000; |
| | | justify-content: center;align-items: center;position: relative" |
| | | > |
| | | <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" /> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center" |
| | | > |
| | | <div style="margin-left: 5px;width: 28px">æ°é:</div> |
| | | {{ qrForm.startqty }} |
| | | </div> |
| | | <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center"> |
| | | <div style="margin-left: 5px;width: 42px">å¤ç人:</div> |
| | | {{ qrForm.operator }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width:190px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">å·¥åç¼å·:</div> |
| | | <div>{{ qrForm.wo_code }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">产åç¼ç :</div> |
| | | <div>{{ qrForm.partcode }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产ååç§°:</div> |
| | | <div>{{ qrForm.partname }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">{{ qrForm.nextstepname?'ä¸éå·¥åº':'产åè§æ ¼' }}:</div> |
| | | <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</div> |
| | | </div> |
| | | <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left"> |
| | | <div style="width: 60px;margin-left: 5px;">å¤çæ¶é´:</div> |
| | | <div>{{ qrForm.operatorTime }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisible2 = false">å æ¶</el-button> |
| | | <el-button v-waves v-print="printObj2" type="primary">ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import $ from 'jquery' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | EditOrderNgStepSeave, |
| | | MesOrderNgStepSearch, |
| | | MesOrderNgSubStepSearch, |
| | | MesOrderStepSearch, MesOrderStepStart, |
| | | MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport |
| | | } from '@/api/WorkOrder' |
| | | import { |
| | | CustomerPermissions, |
| | | DefectPermissions, |
| | | EqpPermissions, |
| | | GroupsPermissions, |
| | | GroupsPersonPermissions, |
| | | PersonPermissions, PrentOrganizationNoCompany |
| | | } from '@/api/GeneralBasicData' |
| | | import { nanoid } from 'nanoid' |
| | | import { LabelBarCode } from '@/api/systemSetting' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { handleDatetime2 } from '@/utils/global' |
| | | import QRCode from 'qrcodejs2' |
| | | export default { |
| | | name: 'StepReport', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | wkshopcode: '', |
| | | wocode: '', // å·¥åå· |
| | | partcode: '', // 产åç¼ç |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | wkshopcodeArr: [], |
| | | total: 10, |
| | | tableData: [], |
| | | activeName: 'ç产å表', |
| | | elTabsArr: [ |
| | | { code: 'ZZ', name: 'ç产å表' }, |
| | | { code: 'OUT', name: 'å¤ååæ' }, |
| | | { code: 'IN', name: 'å¤åæ¶æ' }, |
| | | { code: 'BAD', name: 'ä¸è¯å¾
å¤ç' } |
| | | ], |
| | | |
| | | radioSelected: '', // å¤éæ¡éä¸å¼ |
| | | |
| | | dialogVisible: false, |
| | | dialogTitle: '', // å¯¹è¯æ¡å°æ é¢ |
| | | |
| | | dialogForm: { |
| | | 'wo_code': '', |
| | | 'partnumber': '', |
| | | 'partname': '', |
| | | 'partspec': '', |
| | | 'seq': '', |
| | | 'stepcode': '', |
| | | 'stepname': '', |
| | | 'stepprice': '', // å·¥åºåä»· |
| | | 'nextstepcode': '', |
| | | 'nextstepname': '', |
| | | 'nextstepprice': '', |
| | | 'stepdesc': '', |
| | | 'planqty': 0, |
| | | 'startqty': 0, // |
| | | 'noreportqty': 0, // æªæ¥æ°é |
| | | 'reportqty': 0, // å·²æ¥æ°é |
| | | 'noputqty': 0, // ä¸è¯æ°é |
| | | 'wkshopcode': '', |
| | | 'wkshopname': '', |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | remarks: '', // 夿³¨ |
| | | inbarcode: '', // å
¥åºæ¡ç |
| | | defectlist: '', // ä¸è¯æ±æ» |
| | | reckway: 'person', // 计件æ¹å¼(çç»:groupã个人:person) |
| | | usergroupcode: '', // çç»ç¼ç |
| | | reportuser: [], // æ¥å·¥äººå |
| | | |
| | | wxcode: '', |
| | | outuser: '', |
| | | fqty: '', |
| | | inuser: '', |
| | | sqty: '', |
| | | list: '' |
| | | |
| | | }, |
| | | dialogFormRules: { |
| | | eqpcode: [ |
| | | { required: true, message: 'è¯·éæ©æ¥å·¥è®¾å¤', trigger: ['blur', 'change'] } |
| | | ], |
| | | usergroupcode: [ |
| | | { required: true, message: 'è¯·éæ©æ¥å·¥çç»', trigger: ['blur', 'change'] } |
| | | ], |
| | | reportuser: [ |
| | | { required: true, message: 'è¯·éæ©æ¥å·¥äººå', trigger: ['blur', 'change'] } |
| | | ], |
| | | startqty: [ |
| | | { required: true, message: '请è¾å
¥åæ ¼æ°é', trigger: ['blur', 'change'] } |
| | | ], |
| | | wxcode: [ |
| | | { required: true, message: 'è¯·éæ©å¤å便¹', trigger: ['blur', 'change'] } |
| | | ], |
| | | outuser: [ |
| | | { required: true, message: 'è¯·éæ©åæäººå', trigger: ['blur', 'change'] } |
| | | ], |
| | | inuser: [ |
| | | { required: true, message: 'è¯·éæ©æ¶æäººå', trigger: ['blur', 'change'] } |
| | | ], |
| | | fqty: [ |
| | | { required: true, message: '请è¾å
¥åææ°é', trigger: ['blur', 'change'] } |
| | | ], |
| | | sqty: [ |
| | | { required: true, message: '请è¾å
¥æ¶ææ°é', trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | }, |
| | | reckwayArr: [// æ¥å·¥ç±»å |
| | | { code: 'group', name: 'çç»' }, |
| | | { code: 'person', name: '个人' } |
| | | ], |
| | | reportuserArr: [], // æ¥å·¥äººå |
| | | usergroupArr: [], // æ¥å·¥çç» |
| | | eqpArr: [], // æ¥å·¥è®¾å¤ |
| | | defectArr: [], // ä¸è¯ç¼ºé· |
| | | wxArr: [], // 徿¥åä½ä¸æ |
| | | |
| | | defectTableData: [], |
| | | badTableData: [], |
| | | workOrderCurrentValue: '', |
| | | |
| | | dialogVisible2: false, // |
| | | qrForm: { // æå°å
容 |
| | | qrvalue: '', |
| | | startqty: '', |
| | | wo_code: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | nextstepname: '', |
| | | operator: '', // æä½äºº |
| | | operatorTime: ''// æä½æ¶é´ |
| | | }, |
| | | printObj2: { |
| | | id: 'printMe2', |
| | | popTitle: 'æå°æ¨¡æ¿', |
| | | preview: false, |
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>', |
| | | closeCallback(vue) { // å
³éæå°çåè°äºä»¶ï¼æ æ³ç¡®å®ç¹å»çæ¯ç¡®è®¤è¿æ¯åæ¶ï¼ |
| | | console.log('11212', vue) |
| | | // vue.dialogVisible = false |
| | | vue.dialogVisible2 = false |
| | | vue.dialogVisible = false |
| | | }, |
| | | beforeOpenCallback(vue) { |
| | | vue.printLoading = true |
| | | console.log('æå¼ä¹å') |
| | | }, |
| | | openCallback(vue) { |
| | | vue.printLoading = false |
| | | console.log('æ§è¡äºæå°') |
| | | } |
| | | }, |
| | | xx: '' |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | |
| | | this.tabClick() |
| | | |
| | | this.getAllSelectArr() |
| | | }, |
| | | methods: { |
| | | |
| | | async getAllSelectArr() { |
| | | const { data: res1 } = await GroupsPermissions()// çç» |
| | | this.usergroupArr = res1 |
| | | |
| | | const { data: res2 } = await PersonPermissions() // 人å |
| | | this.reportuserArr = res2 |
| | | |
| | | const { data: res3 } = await DefectPermissions() // ç¼ºé· |
| | | this.defectArr = res3 |
| | | |
| | | const { data: res4 } = await EqpPermissions() // è®¾å¤ |
| | | this.eqpArr = res4 |
| | | |
| | | const { data: res5 } = await CustomerPermissions() // 徿¥åä½ |
| | | this.wxArr = res5 |
| | | |
| | | const { data: res6 } = await PrentOrganizationNoCompany()// æ å
¬å¸çç»ç»ä¸æ |
| | | this.wkshopcodeArr = res6 |
| | | }, |
| | | tabClick() { |
| | | let belong |
| | | switch (this.activeName) { |
| | | case 'ç产å表': |
| | | belong = 'produceCodeZZ' |
| | | this.dialogTitle = 'æ¥å·¥' |
| | | break |
| | | case 'å¤ååæ': |
| | | belong = 'produceCodeOUT' |
| | | this.dialogTitle = 'åæ' |
| | | break |
| | | case 'å¤åæ¶æ': |
| | | belong = 'produceCodeIN' |
| | | this.dialogTitle = 'æ¶æ' |
| | | break |
| | | case 'ä¸è¯å¾
å¤ç': |
| | | belong = 'produceCodeBAD' |
| | | this.dialogTitle = 'ä¸è¯å¤ç' |
| | | break |
| | | } |
| | | this.enterNative(this.form.wocode, belong) |
| | | |
| | | this.radioSelected = '' |
| | | }, |
| | | enterNative(val, belong) { |
| | | if (belong === 'produceCodeZZ') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeZZ\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeOUT') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeOUT\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeIN') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeIN\']')[0].focus() |
| | | }) |
| | | } |
| | | if (belong === 'produceCodeBAD') { |
| | | this.$nextTick(() => { |
| | | $('input[name=\'produceCodeBAD\']')[0].focus() |
| | | }) |
| | | } |
| | | this.search() |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.search() |
| | | }, |
| | | // æ¥è¯¢ |
| | | async search() { |
| | | this.form.wocode = this.workOrderCurrentValue |
| | | this.workOrderCurrentValue = '' |
| | | if (this.activeName === 'ç产å表') { |
| | | const res = await MesOrderStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | if (this.activeName === 'å¤ååæ' || this.activeName === 'å¤åæ¶æ') { |
| | | const res = await MesOrderWxStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | |
| | | if (this.activeName === 'ä¸è¯å¾
å¤ç') { |
| | | const res = await MesOrderNgStepSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | }, |
| | | // æ¥å·¥ |
| | | report(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // åæ |
| | | sendOut(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('WX', 'OUT', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('WX', 'OUT', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // æ¶æ |
| | | takeIn(row) { |
| | | if (row) { |
| | | this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode) |
| | | } else { |
| | | const temp = this.tableData.find(i => i.id === this.radioSelected) |
| | | this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode) |
| | | } |
| | | }, |
| | | // ä¸è¯å¤ç çäº§å¼æ¥å·¥æ«ç è·åå·¥å对åºå·¥åºä»»å¡(ä¸è¯æç») |
| | | async handleBad(row) { |
| | | const data = { |
| | | wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code, |
| | | stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode |
| | | } |
| | | let res = await MesOrderNgSubStepSearch(data) |
| | | if (res.code === '200') { |
| | | res = res.data |
| | | this.dialogForm.wo_code = res.data1.wo_code |
| | | this.dialogForm.partnumber = res.data1.partnumber |
| | | this.dialogForm.partname = res.data1.partname |
| | | this.dialogForm.partspec = res.data1.partspec |
| | | this.dialogForm.seq = res.data1.seq |
| | | this.dialogForm.stepcode = res.data1.stepcode |
| | | this.dialogForm.stepname = res.data1.stepname |
| | | this.dialogForm.stepprice = res.data1.stepprice |
| | | this.dialogForm.nextstepcode = res.data1.nextstepcode |
| | | this.dialogForm.nextstepname = res.data1.nextstepname |
| | | this.dialogForm.nextstepprice = res.data1.nextstepprice |
| | | this.dialogForm.stepdesc = res.data1.stepdesc |
| | | this.dialogForm.planqty = res.data1.planqty |
| | | this.dialogForm.startqty = res.data1.startqty |
| | | this.dialogForm.noreportqty = res.data1.noreportqty // åæ ¼æ°é |
| | | this.dialogForm.reportqty = res.data1.reportqty |
| | | this.dialogForm.noputqty = res.data1.noputqty // ä¸è¯æ°é |
| | | this.dialogForm.wkshopcode = res.data1.wkshopcode |
| | | this.dialogForm.wkshopname = res.data1.wkshopname |
| | | this.dialogForm.eqpcode = res.data1.eqpcode |
| | | this.dialogForm.eqpname = res.data1.eqpname |
| | | |
| | | res.data2.forEach(item => { |
| | | item.repair_qty = 0 |
| | | item.laborbad_qty = 0 |
| | | item.materielbad_qty = 0 |
| | | }) |
| | | |
| | | this.badTableData = res.data2 |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | | }, |
| | | // çäº§å¼æ¥å·¥ï¼æ¥å·¥/å¤å(åæ/æ¶æ)æ¶æ¡ä»¶å¤æåæ°æ®è¿åæ¥å£ |
| | | async getMesOrderStepStart(OperType, SelectType, wocode, stepcode) { |
| | | const data = { |
| | | OperType, SelectType, wocode, stepcode |
| | | } |
| | | let res = await MesOrderStepStart(data) |
| | | if (res.code === '200') { |
| | | res = res.data |
| | | this.dialogForm.wo_code = res.wo_code |
| | | this.dialogForm.partnumber = res.partnumber |
| | | this.dialogForm.partname = res.partname |
| | | this.dialogForm.partspec = res.partspec |
| | | this.dialogForm.seq = res.seq |
| | | this.dialogForm.stepcode = res.stepcode |
| | | this.dialogForm.stepname = res.stepname |
| | | this.dialogForm.stepprice = res.stepprice |
| | | this.dialogForm.nextstepcode = res.nextstepcode |
| | | this.dialogForm.nextstepname = res.nextstepname |
| | | this.dialogForm.nextstepprice = res.nextstepprice |
| | | this.dialogForm.stepdesc = res.stepdesc |
| | | this.dialogForm.planqty = res.planqty |
| | | this.dialogForm.startqty = res.startqty |
| | | this.dialogForm.noreportqty = res.noreportqty// æªæ¥æ°é |
| | | this.dialogForm.reportqty = res.reportqty // å·²æ¥æ°é |
| | | this.dialogForm.noputqty = res.noputqty |
| | | this.dialogForm.wkshopcode = res.wkshopcode |
| | | this.dialogForm.wkshopname = res.wkshopname |
| | | this.dialogForm.eqpcode = res.eqpcode |
| | | this.dialogForm.eqpname = res.eqpname |
| | | |
| | | if (this.activeName === 'å¤åæ¶æ') { |
| | | this.dialogForm.list = [] |
| | | res.list.forEach(i => { |
| | | i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty) |
| | | if (i.acceptQty > 0) { |
| | | this.dialogForm.list.push(i) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.dialogForm.list = res.list |
| | | |
| | | this.dialogVisible = true |
| | | } |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm = { |
| | | 'wo_code': '', |
| | | 'partnumber': '', |
| | | 'partname': '', |
| | | 'partspec': '', |
| | | 'seq': '', |
| | | 'stepcode': '', |
| | | 'stepname': '', |
| | | 'stepprice': '', // å·¥åºåä»· |
| | | 'nextstepcode': '', |
| | | 'nextstepname': '', |
| | | 'nextstepprice': '', |
| | | 'stepdesc': '', |
| | | 'planqty': 0, |
| | | 'startqty': 0, // |
| | | 'noreportqty': 0, // æªæ¥æ°é |
| | | 'reportqty': 0, // å·²æ¥æ°é |
| | | 'noputqty': 0, // ä¸è¯æ°é |
| | | 'wkshopcode': '', |
| | | 'wkshopname': '', |
| | | 'eqpcode': '', |
| | | 'eqpname': '', |
| | | |
| | | wxcode: '', |
| | | outuser: '', |
| | | fqty: '', |
| | | inuser: '', |
| | | sqty: '', |
| | | list: '', |
| | | |
| | | remarks: '', // 夿³¨ |
| | | inbarcode: '', // å
¥åºæ¡ç |
| | | defectlist: '', // ä¸è¯æ±æ» |
| | | reckway: 'person', // 计件æ¹å¼(çç»:groupã个人:person) |
| | | usergroupcode: '', // çç»ç¼ç |
| | | reportuser: [] // æ¥å·¥äººå |
| | | |
| | | } |
| | | |
| | | this.defectTableData = [] |
| | | this.badTableData = [] |
| | | |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(async valid => { |
| | | if (valid) { |
| | | if (this.activeName === 'ç产å表') { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('åæ ¼æ°éå ä¸è¯æ°éä¸è½å¤§äºäºæªæ¥æ°é!') |
| | | } |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | | rightcode: getCookie('ruleCode'), |
| | | partcode: this.dialogForm.partnumber, |
| | | qty: this.dialogForm.startqty, |
| | | onelabqty: this.dialogForm.startqty |
| | | } |
| | | |
| | | const res1 = await LabelBarCode(data1) |
| | | inbarcode = res1.data[0].labcode |
| | | } |
| | | |
| | | const defectlist = [] |
| | | this.defectTableData.forEach(i => { |
| | | defectlist.push({ |
| | | defect_code: i.code.join(','), |
| | | badqty: i.badqty |
| | | }) |
| | | }) |
| | | |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | stepprice: this.dialogForm.stepprice, |
| | | eqpcode: this.dialogForm.eqpcode, |
| | | inbarcode, |
| | | reckway: this.dialogForm.reckway, |
| | | usergroupcode: this.dialogForm.usergroupcode, |
| | | reportuser: this.dialogForm.reportuser.join(','), |
| | | taskqty: this.dialogForm.planqty, |
| | | |
| | | payrate: this.dialogForm.reckway === 'person' ? this.reportuserArr.find(i => i.usercode === this.dialogForm.reportuser[0]).payrate : '', |
| | | // startqty: this.dialogForm.startqty, |
| | | // reportqty: this.dialogForm.reportqty, |
| | | |
| | | startqty: this.dialogForm.startqty, |
| | | reportqty: this.dialogForm.startqty, // æ¥å·¥æ°é |
| | | |
| | | defectlist, |
| | | remarks: '' |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(this.defectTableData))) |
| | | // console.log(JSON.parse(JSON.stringify(data))) |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepReport(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('æ¥å·¥æåï¼') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | |
| | | // èªå¶æ¥å·¥æå°æ ç¾å£åå·²å¼å¥½ |
| | | // if (JSON.parse(localStorage.getItem('mesSetting')).every) { |
| | | // this.dialogVisible2 = true |
| | | // this.ZZprint2(localStorage.getItem('username')) |
| | | // } |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('æ¥å·¥å¤±è´¥ï¼') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === 'å¤ååæ') { |
| | | if (parseFloat(this.dialogForm.fqty) < 1) { |
| | | return this.$message.info('åææ°éä¸è½ä¸ºé¶ï¼') |
| | | } |
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('åææ°éä¸è½å¤§äºæªåæ°é!') |
| | | } |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | |
| | | wxcode: this.dialogForm.wxcode, |
| | | outuser: this.dialogForm.outuser, |
| | | taskqty: this.dialogForm.planqty, |
| | | fqty: this.dialogForm.fqty |
| | | } |
| | | // console.log(JSON.stringify(data)) |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepOut(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('åææåï¼') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('åæå¤±è´¥ï¼') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === 'å¤åæ¶æ') { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('æ¶ææ°éå ä¸è¯æ°éä¸è½å¤§äºäºå¯æ¶æ°é!') |
| | | } |
| | | |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) { |
| | | if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('æ¶ææ°éå ä¸è¯æ°éä¸è½å¤§äºè¯¥ä¾åºå坿¶æ°é!') |
| | | } |
| | | } else { |
| | | return this.$message.info('æ¤ä¾åºåæ 坿¶æ°é!') |
| | | } |
| | | |
| | | let inbarcode = '' |
| | | if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') { |
| | | const data1 = { |
| | | rightcode: getCookie('ruleCode'), |
| | | partcode: this.dialogForm.partnumber, |
| | | qty: this.dialogForm.startqty, |
| | | onelabqty: this.dialogForm.startqty |
| | | } |
| | | |
| | | const res1 = await LabelBarCode(data1) |
| | | inbarcode = res1.data[0].labcode |
| | | } |
| | | const defectlist = [] |
| | | this.defectTableData.forEach(i => { |
| | | defectlist.push({ |
| | | defect_code: i.code.join(','), |
| | | badqty: i.badqty |
| | | }) |
| | | }) |
| | | |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, |
| | | partcode: this.dialogForm.partnumber, |
| | | stepseq: this.dialogForm.seq, |
| | | stepcode: this.dialogForm.stepcode, |
| | | |
| | | wxcode: this.dialogForm.wxcode, |
| | | inbarcode, |
| | | inuser: this.dialogForm.inuser, |
| | | taskqty: this.dialogForm.planqty, |
| | | sqty: this.dialogForm.sqty, |
| | | defectlist, |
| | | remarks: '' |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(data)), 1) |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await SavaMesOrderStepIn(data) |
| | | if (res.code === '200') { |
| | | this.$notify.success('æ¶ææåï¼') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('æ¶æå¤±è´¥ï¼') |
| | | } |
| | | } |
| | | |
| | | if (this.activeName === 'ä¸è¯å¾
å¤ç') { |
| | | let flag = false |
| | | this.badTableData.forEach(i => { |
| | | if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | return this.$message.info('ç»´ä¿®åæ ¼æ°é+å·¥åºæ°é+æåºæ°éä¸è½å¤§äºä¸è¯æ°éï¼') |
| | | } |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const res = await EditOrderNgStepSeave({ Data: this.badTableData }) |
| | | if (res.code === '200') { |
| | | this.$notify.success('æäº¤æåï¼') |
| | | // await this.search() |
| | | await this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.dialogVisible = false |
| | | } else { |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | this.$notify.error('æäº¤å¤±è´¥ï¼') |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | dialogVisible2Close() { |
| | | this.qrForm.qrvalue = '' |
| | | this.qrForm.startqty = '' |
| | | this.qrForm.wo_code = '' |
| | | this.qrForm.partcode = '' |
| | | this.qrForm.partname = '' |
| | | this.qrForm.partspec = '' |
| | | this.qrForm.nextstepname = '' |
| | | this.qrForm.operator = '' |
| | | this.qrForm.operatorTime = '' |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | }, |
| | | |
| | | ZZprint2(username) { |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |
| | | } else { |
| | | this.qrForm.qrvalue = this.dialogForm.inbarcode |
| | | } |
| | | |
| | | this.qrForm.startqty = this.dialogForm.startqty |
| | | this.qrForm.wo_code = this.dialogForm.wo_code |
| | | this.qrForm.partcode = this.dialogForm.partnumber |
| | | this.qrForm.partname = this.dialogForm.partname |
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | // çæäºç»´ç |
| | | bindQRCode(text) { |
| | | new QRCode(this.$refs.qrCodeDiv2, { |
| | | text: text, |
| | | // width: 50, |
| | | width: 60, |
| | | // height: 50, |
| | | height: 60, |
| | | colorDark: '#000', // äºç»´ç é¢è² |
| | | colorLight: '#ffffff', // äºç»´ç èæ¯è² |
| | | correctLevel: QRCode.CorrectLevel.L// 容éçï¼L/M/H |
| | | }) |
| | | }, |
| | | // ç¼ºé·æ°å¢ |
| | | addDefect() { |
| | | if (this.defectTableData.find(i => i.code.length === 0)) { |
| | | return this.$message.info('缺é·ç¼ç /åç§°ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) { |
| | | return this.$message.info('ä¸è¯æ°éä¸è½ä¸ºç©ºæä¸ºé¶ï¼') |
| | | } |
| | | |
| | | this.defectTableData.push({ |
| | | uuid: nanoid(), code: [], badqty: '' |
| | | }) |
| | | }, |
| | | // 缺é·å é¤ |
| | | defectDel(row) { |
| | | this.defectTableData = this.defectTableData.filter(i => i.uuid !== row.uuid) |
| | | |
| | | this.dialogForm.noputqty = 0 |
| | | this.defectTableData.forEach(i => { |
| | | this.dialogForm.noputqty += parseFloat(i.badqty) |
| | | }) |
| | | }, |
| | | badqtyChange(val) { |
| | | this.dialogForm.noputqty = 0 |
| | | this.defectTableData.forEach(i => { |
| | | this.dialogForm.noputqty += parseFloat(i.badqty) |
| | | }) |
| | | }, |
| | | reckwayChange(val) { |
| | | // console.log(val) |
| | | this.dialogForm.usergroupcode = '' |
| | | this.dialogForm.reportuser = [] |
| | | }, |
| | | async usergroupChange(val) { |
| | | const { data: res } = await GroupsPersonPermissions({ groupcode: val }) |
| | | this.dialogForm.reportuser = res[0].usercode_list ? res[0].usercode_list.split(',') : [] |
| | | }, |
| | | rowClick(row, event, column) { |
| | | this.radioSelected = row.id |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 275 |
| | | // this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | reset() { |
| | | this.form.wkshopcode = '' |
| | | this.form.wocode = '' |
| | | this.form.workOrderCurrentValue = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.search() |
| | | }, |
| | | |
| | | headerCellStyle() { |
| | | return this.$headerCellStyle |
| | | }, |
| | | cellStyle() { |
| | | return this.$cellStyle |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | |
| | | ::v-deep .elTableDiv .el-radio__label { |
| | | display: none !important; |
| | | } |
| | | |
| | | .dialogFormItem { |
| | | margin: 0 10px 0 0; |
| | | } |
| | | |
| | | .dialogFormItemDiv { |
| | | width: 200px; |
| | | } |
| | | |
| | | ::v-deep .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-form-item__label { |
| | | font-weight: lighter !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog .el-divider__text { |
| | | font-weight: bolder !important; |
| | | } |
| | | |
| | | </style> |
| | |
| | | v-if="item.indexOf('ç¼å·(å¯ä¸)')!==-1|| |
| | | item.indexOf('ç¨æ·å§å')!==-1|| |
| | | item.indexOf('å¯ç ')!==-1|| |
| | | item.indexOf('èªèµç±»å')!==-1|| |
| | | item.indexOf('ææºå·')!==-1|| |
| | | item.indexOf('é®ç®±')!==-1|| |
| | | item.indexOf('åç§°')!==-1|| |
| | |
| | | if (!j['*å¯ç ']) { |
| | | flag = false |
| | | msg = '*å¯ç ' |
| | | } |
| | | if (!j['*èªèµç±»å']) { |
| | | flag = false |
| | | msg = '*èªèµç±»å' |
| | | } |
| | | if (!j['*å¨èç¶æ']) { |
| | | flag = false |
| | |
| | | '*ç¨æ·ç¼å·(å¯ä¸)': '', |
| | | '*ç¨æ·å§å': '', |
| | | '*å¯ç ': '', |
| | | '*èªèµç±»å': '', |
| | | '*å¨èç¶æ': 'Y', |
| | | 'ææºå·': '', |
| | | 'é®ç®±': '', |
| | |
| | | <template>
|
| | | <div>
|
| | | <div class="body" :style="{height:mainHeight+'px'}">
|
| | |
|
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between">
|
| | | <el-button
|
| | | v-waves
|
| | | icon="el-icon-refresh-right"
|
| | | @click="syncERP"
|
| | | >忥ERP
|
| | | </el-button>
|
| | | <div style="display: flex">
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | icon="el-icon-bottom"
|
| | | @click="batchHandle"
|
| | | >æ¹éä¸è¾¾
|
| | | </el-button>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | |
|
| | | <div class="bodyTopFormGroup">
|
| | | <el-form
|
| | | ref="form"
|
| | | :model="form"
|
| | | label-width="100px"
|
| | | inline
|
| | | style="display: flex;"
|
| | | >
|
| | | <div class="elForm">
|
| | | <el-form-item label="车é´åç§°" style=" display: flex;">
|
| | | <el-select
|
| | | v-model="form.wkshopcode"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | style="width: 200px"
|
| | | placeholder="è¯·éæ©"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in wkshopcodeArr"
|
| | | :key="item.torg_code"
|
| | | :label="item.torg_name"
|
| | | :value="item.torg_code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="订åç¶æ" style=" display: flex;">
|
| | | <el-select
|
| | | v-model="form.erporderstus"
|
| | | filterable
|
| | | :popper-append-to-body="false"
|
| | | style="width: 200px"
|
| | | placeholder="è¯·éæ©"
|
| | | >
|
| | | <el-option
|
| | | v-for="item in erporderstusArr"
|
| | | :key="item.code"
|
| | | :label="item.name"
|
| | | :value="item.code"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="订åç¼å·" style=" display: flex;">
|
| | | <el-input v-model="form.erpordercode" placeholder="请è¾å
¥" style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="éå®è®¢å" style=" display: flex;">
|
| | | <el-input v-model="form.saleordercode" style="width: 200px" placeholder="请è¾å
¥" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-show="isExpandForm" label="产åç¼ç " style=" display: flex;">
|
| | | <el-input v-model="form.partcode" style="width: 200px" placeholder="请è¾å
¥" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item v-show="isExpandForm" label="产ååç§°" style=" display: flex;">
|
| | | <el-input v-model="form.partname" style="width: 200px" placeholder="请è¾å
¥" />
|
| | | </el-form-item>
|
| | | <el-form-item v-show="isExpandForm" label="产åè§æ ¼" style=" display: flex;">
|
| | | <el-input v-model="form.partspec" style="width: 200px" placeholder="请è¾å
¥" />
|
| | | </el-form-item>
|
| | |
|
| | | <DateType
|
| | | ref="DateTypeRef"
|
| | | :is-expand-form="isExpandForm"
|
| | | style="display:flex;justify-content: center;align-items: center;position: relative"
|
| | | @DateTypeChange="DateTypeChange"
|
| | | @cycleTimeChange="cycleTimeChange"
|
| | | />
|
| | |
|
| | | <!-- <el-form-item-->
|
| | | <!-- v-show="isExpandForm"-->
|
| | | <!-- label="é¢è®¡å¼å·¥æ¶é´"-->
|
| | | <!-- label-width="100px"-->
|
| | | <!-- style="display: flex;font-size: 14px;align-items: center"-->
|
| | | <!-- >-->
|
| | | <!-- <el-date-picker-->
|
| | | <!-- v-model="form.paystartdate"-->
|
| | | <!-- type="datetimerange"-->
|
| | | <!-- range-separator="~"-->
|
| | | <!-- class="timeMini"-->
|
| | | <!-- size="mini"-->
|
| | | <!-- style="width: 200px;display: flex;line-height: 34px;height: 34px;"-->
|
| | | <!-- :clearable="false"-->
|
| | | <!-- start-placeholder="å¼å§æ¥æ"-->
|
| | | <!-- end-placeholder="ç»ææ¥æ"-->
|
| | | <!-- :picker-options="pickerOptions"-->
|
| | | <!-- value-format="yyyy-MM-dd"-->
|
| | | <!-- @change="pickerChange"-->
|
| | | <!-- />-->
|
| | | <!-- </el-form-item>-->
|
| | |
|
| | | <!-- <el-form-item-->
|
| | | <!-- v-show="isExpandForm"-->
|
| | | <!-- label="é¢è®¡å®å·¥æ¶é´"-->
|
| | | <!-- label-width="100px"-->
|
| | | <!-- style=" display: flex;font-size: 14px;align-items: center"-->
|
| | | <!-- >-->
|
| | | <!-- <el-date-picker-->
|
| | | <!-- v-model="form.payenddate"-->
|
| | | <!-- type="daterange"-->
|
| | | <!-- :clearable="false"-->
|
| | | <!-- class="timeMini"-->
|
| | | <!-- range-separator="~"-->
|
| | | <!-- start-placeholder="å¼å§æ¥æ"-->
|
| | | <!-- style="width: 200px;display: flex;line-height: 34px ;height: 34px ;"-->
|
| | | <!-- end-placeholder="ç»ææ¥æ"-->
|
| | | <!-- size="mini"-->
|
| | | <!-- />-->
|
| | | <!-- </el-form-item>-->
|
| | | </div>
|
| | |
|
| | | <div
|
| | | class="bodySearchReset"
|
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
|
| | | >
|
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">æ¥è¯¢</el-button>
|
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button>
|
| | | </div>
|
| | |
|
| | | </el-form>
|
| | |
|
| | | <div
|
| | | class="bodyTopFormExpand"
|
| | | >
|
| | | <svg-icon
|
| | | v-show="mouseHoverType==='mouseout'"
|
| | | style="cursor: pointer"
|
| | | :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
|
| | | @mouseenter="mouseHoverType=$event.type"
|
| | | />
|
| | | <svg-icon
|
| | | v-show="mouseHoverType==='mouseenter'"
|
| | | style="cursor: pointer"
|
| | | :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
|
| | | @click="isExpandForm=!isExpandForm"
|
| | | @mouseout="mouseHoverType=$event.type"
|
| | | />
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | <div class="elTableDiv">
|
| | | <el-table
|
| | | ref="tableDataRef"
|
| | | class="tableFixed"
|
| | | :data="tableData"
|
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
|
| | | border
|
| | | :row-class-name="tableRowClassName"
|
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
|
| | | highlight-current-row
|
| | | :header-cell-style="this.$headerCellStyle"
|
| | | :cell-style="this.$cellStyle"
|
| | | :summary-method="getSummaries"
|
| | | show-summary
|
| | | @sort-change="sortChange"
|
| | | @selection-change="handleSelectionChange"
|
| | | >
|
| | | <!-- @row-click="rowClick"-->
|
| | | <el-table-column
|
| | | type="selection"
|
| | | width="50"
|
| | | :selectable="selected"
|
| | | />
|
| | | <!-- <el-table-column-->
|
| | | <!-- width="50"-->
|
| | | <!-- fixed-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <el-radio-->
|
| | | <!-- v-model="radioSelectedId"-->
|
| | | <!-- :label="row.id"-->
|
| | | <!-- style="color: transparent;padding-left: 10px;"-->
|
| | | <!-- />-->
|
| | | <!-- <!– @change.native="getCurrentRow(row.id)"–>-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | | <el-table-column
|
| | | prop="rowNum"
|
| | | width="50"
|
| | | fixed
|
| | | label="åºå·"
|
| | | />
|
| | | <el-table-column
|
| | | prop="status"
|
| | | label="订åç¶æ"
|
| | | sortable="custom"
|
| | | width="110"
|
| | | show-tooltip-when-overflow
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div>
|
| | | <div v-if="row.status==='CREATING'">é¨åä¸è¾¾</div>
|
| | | <div v-if="row.status==='CREATED'">å
¨é¨ä¸è¾¾</div>
|
| | | <div v-if="row.status==='CLOSED'">å·²å
³é</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wo"
|
| | | label="订åç¼å·"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | min-width="150"
|
| | | />
|
| | | <el-table-column
|
| | | show-tooltip-when-overflow
|
| | | prop="saleOrderCode"
|
| | | label="éå®è®¢å"
|
| | | sortable="custom"
|
| | | width="150"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="partcode"
|
| | | label="产åç¼ç "
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | min-width="150"
|
| | | />
|
| | | <el-table-column
|
| | | prop="partname"
|
| | | label="产ååç§°"
|
| | | sortable="custom"
|
| | | min-width="200"
|
| | | show-tooltip-when-overflow
|
| | | />
|
| | | <el-table-column
|
| | | prop="partspec"
|
| | | label="产åè§æ ¼"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | min-width="110"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.partspec">{{ row.partspec }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="qty"
|
| | | label="è®¢åæ°é"
|
| | | width="150"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="relse_qty"
|
| | | label="å·²ä¸åæ°é"
|
| | | show-tooltip-when-overflow
|
| | | width="150"
|
| | | sortable="custom"
|
| | | />
|
| | | <el-table-column
|
| | | prop="clerkuser"
|
| | | label="éå®ä¸å¡å"
|
| | | show-tooltip-when-overflow
|
| | | width="150"
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.clerkuser">{{ row.clerkuser }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="wkshp_name"
|
| | | label="ç产车é´"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | width="150"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="planstartdate"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- label="é¢è®¡å¼å·¥æ¶é´"-->
|
| | | <!-- sortable="custom"-->
|
| | | <!-- width="130"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>-->
|
| | | <!-- <div v-else>/</div>-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | | <!-- <el-table-column-->
|
| | | <!-- prop="planenddate"-->
|
| | | <!-- label="é¢è®¡å®å·¥æ¶é´"-->
|
| | | <!-- show-tooltip-when-overflow-->
|
| | | <!-- sortable="custom"-->
|
| | | <!-- width="130"-->
|
| | | <!-- >-->
|
| | | <!-- <template slot-scope="{row}">-->
|
| | | <!-- <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>-->
|
| | | <!-- <div v-else>/</div>-->
|
| | | <!-- </template>-->
|
| | | <!-- </el-table-column>-->
|
| | | <el-table-column
|
| | | prop="planenddate"
|
| | | label="é¢è®¡å¼å·¥æ¥æ"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | width="130"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="planstartdate"
|
| | | label="é¢è®¡å®å·¥æ¥æ"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | width="130"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | prop="saleOrderDeliveryDate"
|
| | | label="é¢è®¡äº¤ä»æ¥æ"
|
| | | sortable="custom"
|
| | | show-tooltip-when-overflow
|
| | | width="130"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.saleOrderDeliveryDate">{{ row.saleOrderDeliveryDate.substring(0, 11) }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
|
| | | <el-table-column
|
| | | show-tooltip-when-overflow
|
| | | prop="createuser"
|
| | | label="å建人å"
|
| | | sortable="custom"
|
| | | width="150"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.createuser">{{ row.createuser }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | prop="createdate"
|
| | | label="å建æ¶é´"
|
| | | width="130"
|
| | | show-tooltip-when-overflow
|
| | | sortable="custom"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div v-if="row.createdate">{{ row.createdate.substring(0, 11) }}</div>
|
| | | <div v-else>/</div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | fixed="right"
|
| | | width="120"
|
| | | >
|
| | | <template slot-scope="{row}">
|
| | | <div class="operationClass">
|
| | | <el-tooltip class="item" effect="dark" content="ä¸è¾¾" placement="top">
|
| | | <!-- <el-button v-waves type="text" @click="edit('edit',row)">ä¸è¾¾</el-button>-->
|
| | | <i
|
| | | class="el-icon-bottom"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="cursor: pointer;margin-left: 5px"
|
| | | @click="edit('edit',row)"
|
| | | />
|
| | | </el-tooltip>
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订åå
³é" placement="top">
|
| | | <i
|
| | | class="el-icon-switch-button"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="cursor: pointer;margin-left: 15px"
|
| | | @click="orderClose(row.id)"
|
| | | />
|
| | | </el-tooltip>
|
| | |
|
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订åå é¤" placement="top">
|
| | | <i
|
| | | class="el-icon-delete"
|
| | | :style="{color:$store.state.settings.theme}"
|
| | | style="cursor: pointer;margin-left: 15px"
|
| | | @click="orderDel(row.id)"
|
| | | />
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | </div>
|
| | | <!--å页-->
|
| | | <pagination
|
| | | :total="total"
|
| | | :page.sync="form.page"
|
| | | :limit.sync="form.rows"
|
| | | align="right"
|
| | | layout="total,prev, pager, next,sizes,jumper"
|
| | | popper-class="select_bottom"
|
| | | @pagination="getErpOrderSearch"
|
| | | />
|
| | | </div>
|
| | |
|
| | | <el-dialog
|
| | | v-el-drag-dialog
|
| | | :title="operation==='add'?'æ°å¢':'ä¸è¾¾'"
|
| | | :visible.sync="dialogVisible"
|
| | | width="900px"
|
| | | top="12vh"
|
| | | :close-on-click-modal="false"
|
| | | @closed="handleClose"
|
| | | @close="handleClose"
|
| | | >
|
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="106px">
|
| | | <el-form-item label="订åç¼å·" prop="erpordercode">
|
| | | <el-input v-model="dialogForm.erpordercode" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="产åç¼ç " prop="partcode">
|
| | | <el-input v-model="dialogForm.partcode" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="产ååç§°" prop="partname">
|
| | | <el-input v-model="dialogForm.partname" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="产åè§æ ¼" prop="partspec">
|
| | | <el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç产车é´" prop="wkshopname">
|
| | | <el-input v-model="dialogForm.wkshopname" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æå±ä»åº" prop="warehousename">
|
| | | <el-input v-model="dialogForm.warehousename" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="è®¢åæ°é" prop="erpqty">
|
| | | <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" />
|
| | | </el-form-item>
|
| | | <el-form-item label="å·²ä¸åæ°" prop="relse_qty">
|
| | | <el-input
|
| | | v-model="dialogForm.relse_qty"
|
| | | disabled
|
| | | oninput="value=value.replace(/[^0-9.]/g,'')"
|
| | | style="width: 200px"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ä¸åæ°é" prop="markqty">
|
| | | <el-input
|
| | | v-model="dialogForm.markqty"
|
| | | oninput="value=value.replace(/[^0-9.]/g,'')"
|
| | | style="width: 200px"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ä¸ååæ°" prop="ordernum">
|
| | | <el-input
|
| | | v-model="dialogForm.ordernum"
|
| | | oninput="value=value.replace(/[^0-9.]/g,'')"
|
| | | style="width: 200px"
|
| | | />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="éå®ä¸å¡å" prop="">
|
| | | <el-input
|
| | | v-model="dialogForm.clerkuser"
|
| | | disabled
|
| | | style="width: 200px"
|
| | | />
|
| | | </el-form-item>
|
| | | <!-- :picker-options="pickerOptions"-->
|
| | |
|
| | | <el-form-item label="é¢è®¡äº¤ä»æ¥æ" prop="saleOrderDeliveryDate">
|
| | | <el-date-picker
|
| | | v-model="dialogForm.saleOrderDeliveryDate"
|
| | | type="date"
|
| | | size="mini"
|
| | | :clearable="false"
|
| | | class="dateMini"
|
| | | format="yyyy-MM-dd"
|
| | | style="width: 200px"
|
| | | placeholder="éæ©æ¥æ"
|
| | | :disabled="dialogForm.saleOrderDeliveryDateIsDisabled"
|
| | | />
|
| | | </el-form-item>
|
| | |
|
| | | <div style="display: flex">
|
| | | <el-form-item label="é¢è®¡å¼å·¥æ¥æ" prop="" style="display: flex">
|
| | | <el-date-picker
|
| | | v-model="dialogForm.paystartdate"
|
| | | type="date"
|
| | | size="mini"
|
| | | style="width: 200px"
|
| | | :clearable="false"
|
| | | class="dateMini"
|
| | | format="yyyy-MM-dd"
|
| | | value-format="yyyy-MM-dd"
|
| | | placeholder="éæ©æ¥æ"
|
| | | />
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item label="é¢è®¡å®å·¥æ¥æ" prop="" style="display: flex">
|
| | | <el-date-picker
|
| | | v-model="dialogForm.payenddate"
|
| | | type="date"
|
| | | size="mini"
|
| | | style="width: 200px"
|
| | | :clearable="false"
|
| | | class="dateMini"
|
| | | format="yyyy-MM-dd"
|
| | | value-format="yyyy-MM-dd"
|
| | | placeholder="éæ©æ¥æ"
|
| | | />
|
| | | </el-form-item>
|
| | |
|
| | | </div>
|
| | |
|
| | | </el-form>
|
| | | <span slot="footer" class="dialog-footer">
|
| | | <div class="footerButton">
|
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button>
|
| | | <el-button
|
| | | v-waves
|
| | | type="primary"
|
| | | :loading="$store.state.app.buttonIsDisabled"
|
| | | :disabled="$store.state.app.buttonIsDisabled"
|
| | | @click="dialogVisibleConfirm"
|
| | | >ä¸ è¾¾</el-button>
|
| | | </div>
|
| | | </span>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import Pagination from '@/components/Pagination'
|
| | | import { handleDatetime } from '@/utils/global'
|
| | | import elDragDialog from '@/directive/el-drag-dialog'
|
| | | import waves from '@/directive/waves'
|
| | | import {
|
| | | ClosedErpOrder,
|
| | | DeleteErpOrder,
|
| | | ErpOrderSearch,
|
| | | MarkBatchSaveErpOrder,
|
| | | MarkSaveErpOrder
|
| | | } from '@/api/WorkOrder'
|
| | | import { SeaveSearchErpOrder } from '@/api/ErpSyncMes'
|
| | | import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
|
| | | import DateType from '@/components/DateType'
|
| | |
|
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/
|
| | | export default {
|
| | | name: 'ProduceOrderList',
|
| | | components: {
|
| | | Pagination, DateType
|
| | | },
|
| | | directives: { elDragDialog, waves },
|
| | | data() {
|
| | | const validateName = (rule, value, callback) => {
|
| | | if (!value) {
|
| | | return callback(new Error('请è¾å
¥ç¼ç '))
|
| | | } else {
|
| | | if (SER_HZ.test(value)) {
|
| | | return callback(new Error('ç¼ç ä¸è½ä¸ºä¸æ'))
|
| | | } else {
|
| | | callback()
|
| | | }
|
| | | }
|
| | | }
|
| | | return {
|
| | | mouseHoverType: 'mouseout',
|
| | | isExpandForm: false,
|
| | | mainHeight: 0,
|
| | | tableHeight: 0,
|
| | | form: {
|
| | | wkshopcode: '', // 车é´ç¼ç
|
| | | erporderstus: '', // 订åç¶æç
|
| | | erpordercode: '', // 订åç¼å·
|
| | | partcode: '', // 产åç¼ç
|
| | | partname: '', // 产ååç§°
|
| | | partspec: '', // 产åè§æ ¼
|
| | | creatuser: '', // å建人å
|
| | | saleordercode: '', // éå®è®¢å
|
| | | // paystartdate: '', // äº¤ä»æ¶é´
|
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¶é´
|
| | | payenddate: '', // é¢è®¡å®å·¥æ¶é´
|
| | | createdate: '', // å建æ¶é´
|
| | |
|
| | | datatype: 'ED', // æ¶é´ç±»å
|
| | | timeValue: [], // æ¶é´å¼
|
| | |
|
| | | prop: 'wo', // æåºå段
|
| | | order: 'desc', // æåºå段
|
| | | page: 1, // 第å 页
|
| | | rows: 20 // æ¯é¡µå¤å°æ¡
|
| | | },
|
| | |
|
| | | erporderstusArr: [
|
| | | { code: 'NEW', name: 'æ°è®¢å' },
|
| | | { code: 'CREATING', name: 'é¨åä¸è¾¾' },
|
| | | { code: 'CREATED', name: 'å
¨é¨ä¸è¾¾' },
|
| | | { code: 'CLOSED', name: 'å·²å
³é' }
|
| | | ],
|
| | | wkshopcodeArr: [],
|
| | | total: 10,
|
| | | radioSelectedId: '',
|
| | | tableData: [],
|
| | | dialogVisible: false,
|
| | | dialogForm: {
|
| | | erporderid: '', // 订åid
|
| | | sbid: '', // 订åæç»id
|
| | | erpordercode: '', // 订åç¼å·
|
| | | saleordercode: '', // éå®è®¢å
|
| | |
|
| | | partcode: '', // 产åç¼ç
|
| | | partname: '', // 产ååç§°
|
| | | partspec: '', // 产åè§æ ¼
|
| | |
|
| | | wkshopcode: '', // 车é´ç¼ç
|
| | | wkshopname: '', // 车é´åç§°
|
| | |
|
| | | warehousecode: '', // ä»åºç¼ç
|
| | | warehousename: '', // ä»åºåç§°
|
| | |
|
| | | erpqty: '', // è®¢åæ°é
|
| | | markqty: '', // ä¸åæ°é
|
| | | ordernum: '', // ä¸ååæ°
|
| | | relse_qty: '', // å·²ä¸åæ°é
|
| | |
|
| | | clerkuser: '', // éå®ä¸å¡å
|
| | |
|
| | | saleOrderDeliveryDate: '', // é¢è®¡äº¤ä»æ¥æ
|
| | |
|
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¥æ
|
| | | payenddate: ''// é¢è®¡å®å·¥æ¥æ
|
| | | },
|
| | | operation: '',
|
| | | dialogFormRules: {
|
| | | // OrgType: [
|
| | | // { required: true, message: '请è¾å
¥éæ©ç±»å', trigger: ['blur', 'change'] }
|
| | | // ],
|
| | | // OrgCode: [
|
| | | // { required: true, validator: validateName, trigger: ['blur', 'change'] }
|
| | | // ],
|
| | | markqty: [
|
| | | { required: true, message: '请è¾å
¥ä¸åæ°é', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | ordernum: [
|
| | | { required: true, message: '请è¾å
¥ä¸ååæ°', trigger: ['blur', 'change'] }
|
| | | ],
|
| | | saleOrderDeliveryDate: [
|
| | | { required: true, message: 'è¯·éæ©é¢è®¡äº¤ä»æ¥æ', trigger: ['blur', 'change'] }
|
| | | ]
|
| | |
|
| | | },
|
| | | pickerOptions: {
|
| | | disabledDate(time) {
|
| | | return time.getTime() < Date.now() - 8.64e7
|
| | | }
|
| | | },
|
| | | multipleSelection: []
|
| | |
|
| | | // expireTimeOption: {
|
| | | // disabledDate(time) {
|
| | | // return time.getTime() > Date.now() - 8.64e6 // å¦ææ²¡æåé¢ç-8.64e6å°±æ¯ä¸å¯ä»¥éæ©ä»å¤©ç
|
| | | // }
|
| | | // }
|
| | |
|
| | | }
|
| | | },
|
| | | activated() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
created() {
|
| | | this.getErpOrderSearch()
|
| | | // this.getPartSelect()// è·å产åç¼ç ä¿¡æ¯
|
| | |
|
| | | this.getPrentOrganizationNoCompany()
|
| | | },
|
| | | mounted() {
|
| | | window.addEventListener('resize', this.getHeight)
|
| | | this.getHeight()
|
| | | },
|
| | | methods: {
|
| | |
|
| | | DateTypeChange(value) {
|
| | | this.form.datatype = value
|
| | | },
|
| | | cycleTimeChange(val) {
|
| | | this.form.timeValue = val
|
| | | },
|
| | |
|
| | | pickerChange(value) {
|
| | | console.log(value, 123)
|
| | | this.cycleTime = null
|
| | | },
|
| | |
|
| | | async getPrentOrganizationNoCompany() {
|
| | | const { data: res } = await PrentOrganizationNoCompany()
|
| | | this.wkshopcodeArr = res
|
| | | },
|
| | | async getErpOrderSearch() {
|
| | | console.log(this.form, 1)
|
| | | // let tempDate2 = this.form.paystartdate
|
| | | // if (tempDate2.length > 0) {
|
| | | // tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
|
| | | // }
|
| | | //
|
| | | // let tempDate = this.form.payenddate
|
| | | // if (tempDate.length > 0) {
|
| | | // tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
|
| | | // }
|
| | |
|
| | | const data = {
|
| | |
|
| | | erporderstus: this.form.erporderstus, // 订åç¶æç
|
| | | wkshopcode: this.form.wkshopcode, // 车é´ç¼ç
|
| | | erpordercode: this.form.erpordercode, // 订åç¼å·
|
| | | saleordercode: this.form.saleordercode, // éå®åå·
|
| | |
|
| | | partcode: this.form.partcode, // 产åç¼ç
|
| | | partname: this.form.partname, // 产ååç§°
|
| | | partspec: this.form.partspec, // 产åè§æ ¼
|
| | |
|
| | | datatype: this.form.datatype, // æ¥æç±»å(计åå¼å·¥(PS)ã计åå®å·¥(PE)ãé¢è®¡äº¤ä»(ED))
|
| | | searchdate: this.form.timeValue.join('~'), // æ¶é´æ®µ
|
| | | // paystartdate: tempDate2, // äº¤ä»æ¶é´
|
| | | // payenddate: tempDate, // äº¤ä»æ¶é´
|
| | |
|
| | | creatuser: this.form.creatuser, // å建人å
|
| | |
|
| | | prop: this.form.prop, // æåºå段
|
| | | order: this.form.order, // æåºå段
|
| | | page: this.form.page, // 第å 页
|
| | | rows: this.form.rows // æ¯é¡µå¤å°æ¡
|
| | |
|
| | | }
|
| | |
|
| | | const res = await ErpOrderSearch(data)
|
| | | this.tableData = res.data
|
| | | this.total = res.count
|
| | | },
|
| | | // æåºæ¹åæ¶
|
| | | sortChange({ column, prop, order }) {
|
| | | if (order === 'descending') {
|
| | | order = 'desc'
|
| | | } else if (order === 'ascending') {
|
| | | order = 'asc'
|
| | | } else {
|
| | | order = 'desc'
|
| | | }
|
| | | this.form.order = order
|
| | | this.form.prop = prop
|
| | | this.getErpOrderSearch()
|
| | | },
|
| | | // 忥ERP
|
| | | syncERP() {
|
| | | const loading = this.$loading({
|
| | | lock: true,
|
| | | text: 'æ£å¨åæ¥ERPï¼è¯·ç¨ç...',
|
| | | spinner: 'el-icon-loading',
|
| | | customClass: 'osloading',
|
| | | background: 'rgba(0, 0, 0, 0.7)'
|
| | | })
|
| | |
|
| | | SeaveSearchErpOrder().then(res => {
|
| | | console.log(res, 11)
|
| | | if (res.code === '200') {
|
| | | setTimeout(() => {
|
| | | this.getErpOrderSearch()
|
| | | loading.close()
|
| | | this.$message.success('忥æåï¼')
|
| | | }, 2000)
|
| | | }
|
| | | // else if (res.code === '300') {
|
| | | // setTimeout(() => {
|
| | | // loading.close()
|
| | | // this.$message.error('åæ¥å¤±è´¥ï¼')
|
| | | // }, 10000)
|
| | | // }
|
| | | }).catch(e => {
|
| | | loading.close()
|
| | | })
|
| | | },
|
| | | // æ¥è¯¢
|
| | | search() {
|
| | | this.getErpOrderSearch()
|
| | | },
|
| | | // éç½®
|
| | | reset() {
|
| | | this.form.wkshopcode = ''
|
| | | this.form.erporderstus = ''
|
| | | this.form.erpordercode = ''
|
| | | this.form.partcode = ''
|
| | | this.form.partname = ''
|
| | | this.form.partspec = ''
|
| | | this.form.paystartdate = ''
|
| | | this.form.payenddate = ''
|
| | | this.form.creatuser = ''
|
| | | this.form.saleordercode = ''
|
| | | this.form.createdate = ''
|
| | |
|
| | | this.form.timeValue = []
|
| | | this.cycleTime = null
|
| | |
|
| | | this.$refs.DateTypeRef.clearValue()
|
| | |
|
| | | this.getErpOrderSearch()
|
| | | },
|
| | | // åéæ¡éä¸è·åå½åè¡ä¿¡æ¯
|
| | | // getCurrentRow(id) {
|
| | | // this.radioSelectedId = id
|
| | | // },
|
| | | // rowClick(row) {
|
| | | // this.radioSelectedId = row.id
|
| | | // },
|
| | |
|
| | | // 订åå é¤
|
| | | orderDel(id) {
|
| | | this.tableData.forEach(item => {
|
| | | if (item.id === id) {
|
| | | if (item.status === 'CLOSED') {
|
| | | return this.$message.info('æ¤è®¢åå·²å
³éï¼æ æ³å é¤ï¼')
|
| | | } else {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å
³é订å?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | DeleteErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$message.success('订åå 餿å!')
|
| | | this.getErpOrderSearch()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$message.info('已忶å é¤ï¼')
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | },
|
| | | // 订åå
³é
|
| | | async orderClose(id) {
|
| | | this.tableData.forEach(item => {
|
| | | if (item.id === id) {
|
| | | if (item.status !== 'NEW') {
|
| | | return this.$message.info('æ¤è®¢åéæ°è®¢åï¼æ æ³å
³éï¼')
|
| | | } else {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å
³é订å?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.$message.success('订åå
³éæå!')
|
| | | this.getErpOrderSearch()
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$message.info('已忶å
³éï¼')
|
| | | })
|
| | | }
|
| | | }
|
| | | })
|
| | | },
|
| | | batchHandle() {
|
| | | this.$confirm('æ¯å¦æ¹éä¸è¾¾?', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | if (this.multipleSelection.length === 0) {
|
| | | return this.$message.info('请å
éæ©è®¢åï¼')
|
| | | }
|
| | | // console.log(JSON.parse(JSON.stringify(this.multipleSelection)))
|
| | | const data = []
|
| | | this.multipleSelection.forEach(i => {
|
| | | data.push({
|
| | | 'erporderid': i.id,
|
| | | 'sbid': i.sbid,
|
| | | 'erpordercode': i.wo,
|
| | | 'partcode': i.partcode,
|
| | | 'wkshopcode': i.wkshp_code,
|
| | | 'warehousecode': i.stck_code,
|
| | | 'erpqty': i.qty,
|
| | | 'markqty': i.qty,
|
| | | 'ordernum': 1,
|
| | | 'clerkuser': i.clerkuser,
|
| | | 'relse_qty': i.qty,
|
| | | 'saleordercode': i.saleOrderCode,
|
| | | // 'saleOrderDeliveryDate': i.saleOrderDeliveryDate
|
| | | 'saleOrderDeliveryDate': handleDatetime(new Date()) + ' 00:00:00',
|
| | |
|
| | | 'paystartdate': i.planstartdate,
|
| | | 'payenddate': i.planenddate
|
| | | })
|
| | | })
|
| | | // console.log(JSON.parse(JSON.stringify(data)))
|
| | | MarkBatchSaveErpOrder(data).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.multipleSelection = []
|
| | | this.$message.success('æ¹éä¸è¾¾æåï¼')
|
| | | this.getErpOrderSearch()
|
| | | } else {
|
| | | this.$message.error('æ¹éä¸è¾¾å¤±è´¥ï¼')
|
| | | }
|
| | | })
|
| | | }).catch(() => {
|
| | | this.$message.info('已忶ä¸è¾¾ï¼')
|
| | | })
|
| | | },
|
| | | selected(row, index) {
|
| | | return row.status === 'NEW'
|
| | | },
|
| | | handleSelectionChange(val) {
|
| | | this.multipleSelection = val
|
| | | },
|
| | | // æ°å¢æé®
|
| | | add(operation) {
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | | },
|
| | | // ä¿®æ¹æé®
|
| | | edit(operation, row) {
|
| | | if (parseFloat(row.qty) === parseFloat(row.relse_qty) || row.status === 'CLOSED') {
|
| | | return this.$message.info('æ¤å·¥åå·²å
¨é¨ä¸è¾¾ï¼')
|
| | | }
|
| | |
|
| | | this.operation = operation
|
| | | this.dialogVisible = true
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.dialogForm.sbid = row.sbid
|
| | | this.dialogForm.erporderid = row.id
|
| | | this.dialogForm.erpordercode = row.wo
|
| | | this.dialogForm.saleordercode = row.saleOrderCode
|
| | |
|
| | | this.dialogForm.partcode = row.partcode
|
| | | this.dialogForm.partname = row.partname
|
| | | this.dialogForm.partspec = row.partspec
|
| | |
|
| | | this.dialogForm.wkshopcode = row.wkshp_code
|
| | | this.dialogForm.wkshopname = row.wkshp_name
|
| | |
|
| | | this.dialogForm.warehousecode = row.stck_code
|
| | | this.dialogForm.warehousename = row.stck_name
|
| | |
|
| | | this.dialogForm.saleOrderDeliveryDate = row.saleOrderDeliveryDate
|
| | |
|
| | | this.dialogForm.erpqty = row.qty
|
| | | this.dialogForm.markqty = parseFloat(row.qty) - parseFloat(row.relse_qty)
|
| | | this.dialogForm.ordernum = 1
|
| | | this.dialogForm.relse_qty = row.relse_qty
|
| | | this.dialogForm.clerkuser = row.clerkuser
|
| | |
|
| | | this.dialogForm.paystartdate = row.planstartdate
|
| | | this.dialogForm.payenddate = row.planenddate
|
| | | })
|
| | | },
|
| | | // å¯¹è¯æ¡å
³éäºä»¶
|
| | | handleClose() {
|
| | | this.dialogForm = {
|
| | | erporderid: '', // 订åid
|
| | | sbid: '', // 订åæç»id
|
| | | erpordercode: '', // 订åç¼å·
|
| | | saleordercode: '', // éå®è®¢å
|
| | |
|
| | | partcode: '', // 产åç¼ç
|
| | | partname: '', // 产ååç§°
|
| | | partspec: '', // 产åè§æ ¼
|
| | |
|
| | | wkshopcode: '', // 车é´ç¼ç
|
| | | wkshopname: '', // 车é´åç§°
|
| | |
|
| | | warehousecode: '', // ä»åºç¼ç
|
| | | warehousename: '', // ä»åºåç§°
|
| | |
|
| | | erpqty: '', // è®¢åæ°é
|
| | | markqty: '', // ä¸åæ°é
|
| | | ordernum: '', // ä¸ååæ°
|
| | | relse_qty: '', // å·²ä¸åæ°é
|
| | |
|
| | | payenddate: '', // é¢è®¡å®å·¥æ¥æ
|
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¥æ
|
| | |
|
| | | saleOrderDeliveryDate: '' // é¢è®¡äº¤ä»æ¥æ
|
| | | }
|
| | | this.$refs.dialogForm.clearValidate()
|
| | | },
|
| | | // å¯¹è¯æ¡åæ¶
|
| | | dialogVisibleCancel() {
|
| | | this.dialogVisible = false
|
| | | },
|
| | | // å¯¹è¯æ¡ç¡®è®¤
|
| | | dialogVisibleConfirm() {
|
| | | this.dialogForm.markqty = parseFloat(this.dialogForm.markqty)
|
| | | this.dialogForm.erpqty = parseFloat(this.dialogForm.erpqty)
|
| | | this.dialogForm.relse_qty = parseFloat(this.dialogForm.relse_qty)
|
| | | this.dialogForm.ordernum = parseFloat(this.dialogForm.ordernum)
|
| | | if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) {
|
| | | return this.$message.info('ä¸åæ°éè¶
åºå¯ä¸åæ°çèå´ï¼')
|
| | | }
|
| | |
|
| | | if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) {
|
| | | return this.$message.info('ä¸ååæ°è¶
åºå¯ä¸ååæ°çèå´ï¼')
|
| | | }
|
| | |
|
| | | this.$refs.dialogForm.validate(valid => {
|
| | | if (valid) {
|
| | | this.$store.state.app.buttonIsDisabled = true
|
| | | const data = {
|
| | | 'sbid': this.dialogForm.sbid,
|
| | | 'erporderid': this.dialogForm.erporderid,
|
| | | 'erpordercode': this.dialogForm.erpordercode,
|
| | | 'saleordercode': this.dialogForm.saleordercode,
|
| | | 'partcode': this.dialogForm.partcode,
|
| | | 'wkshopcode': this.dialogForm.wkshopcode,
|
| | | 'warehousecode': this.dialogForm.warehousecode,
|
| | | 'clerkuser': this.dialogForm.clerkuser,
|
| | | 'erpqty': this.dialogForm.erpqty,
|
| | | 'markqty': this.dialogForm.markqty,
|
| | | 'ordernum': this.dialogForm.ordernum,
|
| | | 'payenddate': this.dialogForm.payenddate,
|
| | | 'paystartdate': this.dialogForm.paystartdate,
|
| | | 'relse_qty': this.dialogForm.relse_qty,
|
| | | 'saleOrderDeliveryDate': handleDatetime(this.dialogForm.saleOrderDeliveryDate) + ' 00:00:00'
|
| | | }
|
| | |
|
| | | MarkSaveErpOrder(data).then(res => {
|
| | | if (res.code === '200') {
|
| | | this.dialogVisible = false
|
| | | this.$message.success('ä¸è¾¾æåï¼')
|
| | | this.getErpOrderSearch()
|
| | | this.$store.state.app.buttonIsDisabled = false
|
| | | } else {
|
| | | this.$message.error('ä¸è¾¾å¤±è´¥ï¼')
|
| | | }
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | // è·å页é¢é«åº¦
|
| | | getHeight() {
|
| | | this.$nextTick(() => {
|
| | | this.mainHeight = window.innerHeight - 85
|
| | | this.tableHeight = this.mainHeight - 250
|
| | |
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | },
|
| | | tableRowClassName({ row, rowIndex }) {
|
| | | return 'custom-row'
|
| | | },
|
| | | getSummaries(param) {
|
| | | const { columns, data } = param
|
| | | const sums = []
|
| | | const i = 7
|
| | | columns.forEach((column, index) => {
|
| | | if (index === i) {
|
| | | sums[index] = 'æ»æ°'
|
| | | return
|
| | | }
|
| | | const values = data.map(item => Number(item[column.property]))
|
| | | if (column.property === 'qty') {
|
| | | sums[index] = values.reduce((prev, curr) => {
|
| | | const value = Number(curr)
|
| | | if (!isNaN(value)) {
|
| | | return prev + curr
|
| | | // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
|
| | | }
|
| | | }, 0)
|
| | |
|
| | | sums[index] += ' å'
|
| | | }
|
| | | if (column.property === 'relse_qty') {
|
| | | sums[index] = values.reduce((prev, curr) => {
|
| | | const value = Number(curr)
|
| | | if (!isNaN(value)) {
|
| | | return prev + curr
|
| | | // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
|
| | | }
|
| | | }, 0)
|
| | |
|
| | | sums[index] += ' å'
|
| | | }
|
| | | })
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.$refs.tableDataRef.doLayout()
|
| | | })
|
| | | return sums
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <!--å
Œ
±é¡µé¢æ ·å¼-->
|
| | | <style lang="scss" scoped>
|
| | | $main_color: #42b983;
|
| | |
|
| | | ::v-deep .el-range__icon {
|
| | | line-height: 28px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-range-separator {
|
| | | line-height: 28px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-range-input {
|
| | | font-size: 14px;
|
| | | }
|
| | |
|
| | | ::v-deep .el-range-separator {
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | }
|
| | |
|
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline {
|
| | | color: $main_color;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .el-icon-edit-outline {
|
| | | margin-right: 15px;
|
| | | }
|
| | |
|
| | | //::v-deep .el-button--primary, .el-button--default, .el-button--info {
|
| | | // height: 34px;
|
| | | // display: flex;
|
| | | // align-items: center;
|
| | | // padding: 0 15px;
|
| | | //}
|
| | |
|
| | | ::v-deep .el-button--primary {
|
| | | //background-color: $main_color !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-button--default {
|
| | | background-color: #f8f8fa;
|
| | | border: none;
|
| | | }
|
| | |
|
| | | ::v-deep .el-input__inner {
|
| | | height: 34px;
|
| | | line-height: 34px;
|
| | | //color: #a7a7a7;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog__body {
|
| | | padding: 20px 100px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .dialogVisibleRoles .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .importPickerClass .el-dialog__body {
|
| | | padding: 20px 20px !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-dialog__footer {
|
| | | display: flex;
|
| | | justify-content: flex-end;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table .caret-wrapper {
|
| | | transform: scale(0.8);
|
| | | }
|
| | |
|
| | | ::v-deep .cell {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table::before {
|
| | | height: 0;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body-wrapper {
|
| | | background-color: #f8f8fa;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__body .el-table__row.hover-row td {
|
| | | background-color: #eaecef;
|
| | | }
|
| | |
|
| | | ::v-deep .el-form--inline .el-form-item__label {
|
| | | color: #a7a7a7;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-divider {
|
| | | border: 1px solid #eee;
|
| | | width: 99%;
|
| | | margin: 10px auto;
|
| | | }
|
| | |
|
| | | .body ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | .userDialogVisible ::v-deep .el-form-item {
|
| | | margin-bottom: 0;
|
| | | }
|
| | |
|
| | | .elTableDiv {
|
| | | ::v-deep .el-radio__label {
|
| | | display: none;
|
| | | }
|
| | | }
|
| | |
|
| | | .tableFixed {
|
| | | ::v-deep .el-table__fixed-right {
|
| | | height: 100% !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-table__fixed {
|
| | | height: 100% !important;
|
| | | }
|
| | | }
|
| | |
|
| | | .dateMini {
|
| | | ::v-deep .el-input__inner {
|
| | | line-height: 34px;
|
| | | height: 34px;
|
| | | width: 200px;
|
| | | display: flex;
|
| | | font-size: 14px !important;
|
| | | align-items: center !important;
|
| | | }
|
| | |
|
| | | ::v-deep .el-input__prefix {
|
| | | margin-top: -3px;
|
| | | }
|
| | | }
|
| | |
|
| | | ::v-deep .el-icon-delete {
|
| | | cursor: pointer;
|
| | | margin-right: 0px !important;
|
| | | }
|
| | | </style>
|
| | | <style>
|
| | | .el-table .custom-row {
|
| | | background: #f8f8fa;
|
| | | }
|
| | |
|
| | | .osloading {
|
| | | font-size: 26px !important;
|
| | | }
|
| | |
|
| | | .el-loading-text {
|
| | | font-size: 26px !important;
|
| | | }
|
| | |
|
| | | .el-picker-panel__footer {
|
| | | display: flex !important;
|
| | | justify-content: flex-end !important;
|
| | | }
|
| | |
|
| | | </style>
|
| | |
|
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button |
| | | v-waves |
| | | icon="el-icon-refresh-right" |
| | | @click="syncERP" |
| | | >忥ERP |
| | | </el-button> |
| | | <div style="display: flex"> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-bottom" |
| | | @click="batchHandle" |
| | | >æ¹éä¸è¾¾ |
| | | </el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="车é´åç§°" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.wkshopcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopcodeArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="订åç¶æ" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.erporderstus" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in erporderstusArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="订åç¼å·" style=" display: flex;"> |
| | | <el-input v-model="form.erpordercode" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="éå®è®¢å" style=" display: flex;"> |
| | | <el-input v-model="form.saleordercode" style="width: 200px" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-show="isExpandForm" label="产åç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.partcode" style="width: 200px" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-show="isExpandForm" label="产ååç§°" style=" display: flex;"> |
| | | <el-input v-model="form.partname" style="width: 200px" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | <el-form-item v-show="isExpandForm" label="产åè§æ ¼" style=" display: flex;"> |
| | | <el-input v-model="form.partspec" style="width: 200px" placeholder="请è¾å
¥" /> |
| | | </el-form-item> |
| | | |
| | | <DateType |
| | | ref="DateTypeRef" |
| | | :is-expand-form="isExpandForm" |
| | | style="display:flex;justify-content: center;align-items: center;position: relative" |
| | | @DateTypeChange="DateTypeChange" |
| | | @cycleTimeChange="cycleTimeChange" |
| | | /> |
| | | |
| | | <!-- <el-form-item--> |
| | | <!-- v-show="isExpandForm"--> |
| | | <!-- label="é¢è®¡å¼å·¥æ¶é´"--> |
| | | <!-- label-width="100px"--> |
| | | <!-- style="display: flex;font-size: 14px;align-items: center"--> |
| | | <!-- >--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.paystartdate"--> |
| | | <!-- type="datetimerange"--> |
| | | <!-- range-separator="~"--> |
| | | <!-- class="timeMini"--> |
| | | <!-- size="mini"--> |
| | | <!-- style="width: 200px;display: flex;line-height: 34px;height: 34px;"--> |
| | | <!-- :clearable="false"--> |
| | | <!-- start-placeholder="å¼å§æ¥æ"--> |
| | | <!-- end-placeholder="ç»ææ¥æ"--> |
| | | <!-- :picker-options="pickerOptions"--> |
| | | <!-- value-format="yyyy-MM-dd"--> |
| | | <!-- @change="pickerChange"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | <!-- <el-form-item--> |
| | | <!-- v-show="isExpandForm"--> |
| | | <!-- label="é¢è®¡å®å·¥æ¶é´"--> |
| | | <!-- label-width="100px"--> |
| | | <!-- style=" display: flex;font-size: 14px;align-items: center"--> |
| | | <!-- >--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.payenddate"--> |
| | | <!-- type="daterange"--> |
| | | <!-- :clearable="false"--> |
| | | <!-- class="timeMini"--> |
| | | <!-- range-separator="~"--> |
| | | <!-- start-placeholder="å¼å§æ¥æ"--> |
| | | <!-- style="width: 200px;display: flex;line-height: 34px ;height: 34px ;"--> |
| | | <!-- end-placeholder="ç»ææ¥æ"--> |
| | | <!-- size="mini"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | </div> |
| | | |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | |
| | | </el-form> |
| | | |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | > |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseout'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'" |
| | | @mouseenter="mouseHoverType=$event.type" |
| | | /> |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseenter'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown':'doubleUp'" |
| | | @click="isExpandForm=!isExpandForm" |
| | | @mouseout="mouseHoverType=$event.type" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | :summary-method="getSummaries" |
| | | show-summary |
| | | @sort-change="sortChange" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <!-- @row-click="rowClick"--> |
| | | <el-table-column |
| | | type="selection" |
| | | width="50" |
| | | :selectable="selected" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelectedId"--> |
| | | <!-- :label="row.id"--> |
| | | <!-- style="color: transparent;padding-left: 10px;"--> |
| | | <!-- />--> |
| | | <!-- <!– @change.native="getCurrentRow(row.id)"–>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="订åç¶æ" |
| | | sortable="custom" |
| | | width="110" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div> |
| | | <div v-if="row.status==='CREATING'">é¨åä¸è¾¾</div> |
| | | <div v-if="row.status==='CREATED'">å
¨é¨ä¸è¾¾</div> |
| | | <div v-if="row.status==='CLOSED'">å·²å
³é</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wo" |
| | | label="订åç¼å·" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | min-width="150" |
| | | /> |
| | | <el-table-column |
| | | show-tooltip-when-overflow |
| | | prop="saleOrderCode" |
| | | label="éå®è®¢å" |
| | | sortable="custom" |
| | | width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | min-width="150" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="产ååç§°" |
| | | sortable="custom" |
| | | min-width="200" |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="产åè§æ ¼" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | min-width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.partspec">{{ row.partspec }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="qty" |
| | | label="è®¢åæ°é" |
| | | width="150" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="relse_qty" |
| | | label="å·²ä¸åæ°é" |
| | | show-tooltip-when-overflow |
| | | width="150" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="priuserdefnvc1" |
| | | label="客æ·åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc1 ? row.priuserdefnvc1 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc6" |
| | | label="客æ·ç¼ç " |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc6 ? row.priuserdefnvc6 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc2" |
| | | label="对å
åç§°" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc2 ? row.priuserdefnvc2 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc3" |
| | | label="CTPæ¥æ" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc3 ? row.priuserdefnvc3 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc4" |
| | | label="é¢åç¼å·" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc4 ? row.priuserdefnvc4 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="priuserdefnvc5" |
| | | label="çå" |
| | | width="110" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.priuserdefnvc5 ? row.priuserdefnvc5 : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="clerkuser" |
| | | label="éå®ä¸å¡å" |
| | | show-tooltip-when-overflow |
| | | width="150" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.clerkuser">{{ row.clerkuser }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wkshp_name" |
| | | label="ç产车é´" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="planstartdate"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- label="é¢è®¡å¼å·¥æ¶é´"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- width="130"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>--> |
| | | <!-- <div v-else>/</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="planenddate"--> |
| | | <!-- label="é¢è®¡å®å·¥æ¶é´"--> |
| | | <!-- show-tooltip-when-overflow--> |
| | | <!-- sortable="custom"--> |
| | | <!-- width="130"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>--> |
| | | <!-- <div v-else>/</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="planenddate" |
| | | label="é¢è®¡å¼å·¥æ¥æ" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | width="130" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="planstartdate" |
| | | label="é¢è®¡å®å·¥æ¥æ" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | width="130" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="saleOrderDeliveryDate" |
| | | label="é¢è®¡äº¤ä»æ¥æ" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | width="130" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.saleOrderDeliveryDate">{{ row.saleOrderDeliveryDate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | show-tooltip-when-overflow |
| | | prop="createuser" |
| | | label="å建人å" |
| | | sortable="custom" |
| | | width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.createuser">{{ row.createuser }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="createdate" |
| | | label="å建æ¶é´" |
| | | width="130" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.createdate">{{ row.createdate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ä¸è¾¾" placement="top"> |
| | | <!-- <el-button v-waves type="text" @click="edit('edit',row)">ä¸è¾¾</el-button>--> |
| | | <i |
| | | class="el-icon-bottom" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 5px" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订åå
³é" placement="top"> |
| | | <i |
| | | class="el-icon-switch-button" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 15px" |
| | | @click="orderClose(row.id)" |
| | | /> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="订åå é¤" placement="top"> |
| | | <i |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | style="cursor: pointer;margin-left: 15px" |
| | | @click="orderDel(row.id)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getErpOrderSearch" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ä¸è¾¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="900px" |
| | | top="12vh" |
| | | :close-on-click-modal="false" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="106px"> |
| | | <el-form-item label="订åç¼å·" prop="erpordercode"> |
| | | <el-input v-model="dialogForm.erpordercode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产åç¼ç " prop="partcode"> |
| | | <el-input v-model="dialogForm.partcode" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°" prop="partname"> |
| | | <el-input v-model="dialogForm.partname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="产åè§æ ¼" prop="partspec"> |
| | | <el-input v-model="dialogForm.partspec" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç产车é´" prop="wkshopname"> |
| | | <el-input v-model="dialogForm.wkshopname" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ä»åº" prop="warehousename"> |
| | | <el-input v-model="dialogForm.warehousename" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="è®¢åæ°é" prop="erpqty"> |
| | | <el-input v-model="dialogForm.erpqty" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·²ä¸åæ°" prop="relse_qty"> |
| | | <el-input |
| | | v-model="dialogForm.relse_qty" |
| | | disabled |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸åæ°é" prop="markqty"> |
| | | <el-input |
| | | v-model="dialogForm.markqty" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸ååæ°" prop="ordernum"> |
| | | <el-input |
| | | v-model="dialogForm.ordernum" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="éå®ä¸å¡å" prop=""> |
| | | <el-input |
| | | v-model="dialogForm.clerkuser" |
| | | disabled |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <!-- :picker-options="pickerOptions"--> |
| | | |
| | | <el-form-item label="é¢è®¡äº¤ä»æ¥æ" prop="saleOrderDeliveryDate"> |
| | | <el-date-picker |
| | | v-model="dialogForm.saleOrderDeliveryDate" |
| | | type="date" |
| | | size="mini" |
| | | :clearable="false" |
| | | class="dateMini" |
| | | format="yyyy-MM-dd" |
| | | style="width: 200px" |
| | | placeholder="éæ©æ¥æ" |
| | | :disabled="dialogForm.saleOrderDeliveryDateIsDisabled" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <div style="display: flex"> |
| | | <el-form-item label="é¢è®¡å¼å·¥æ¥æ" prop="" style="display: flex"> |
| | | <el-date-picker |
| | | v-model="dialogForm.paystartdate" |
| | | type="date" |
| | | size="mini" |
| | | style="width: 200px" |
| | | :clearable="false" |
| | | class="dateMini" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="éæ©æ¥æ" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="é¢è®¡å®å·¥æ¥æ" prop="" style="display: flex"> |
| | | <el-date-picker |
| | | v-model="dialogForm.payenddate" |
| | | type="date" |
| | | size="mini" |
| | | style="width: 200px" |
| | | :clearable="false" |
| | | class="dateMini" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="éæ©æ¥æ" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </div> |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >ä¸ è¾¾</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { handleDatetime } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import { |
| | | ClosedErpOrder, |
| | | DeleteErpOrder, |
| | | ErpOrderSearch, |
| | | MarkBatchSaveErpOrder, |
| | | MarkSaveErpOrder |
| | | } from '@/api/WorkOrder' |
| | | import { SeaveSearchErpOrder } from '@/api/ErpSyncMes' |
| | | import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData' |
| | | import DateType from '@/components/DateType' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'ProduceOrderList', |
| | | components: { |
| | | Pagination, DateType |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请è¾å
¥ç¼ç ')) |
| | | } else { |
| | | if (SER_HZ.test(value)) { |
| | | return callback(new Error('ç¼ç ä¸è½ä¸ºä¸æ')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | wkshopcode: '', // 车é´ç¼ç |
| | | erporderstus: '', // 订åç¶æç |
| | | erpordercode: '', // 订åç¼å· |
| | | partcode: '', // 产åç¼ç |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | creatuser: '', // å建人å |
| | | saleordercode: '', // éå®è®¢å |
| | | // paystartdate: '', // äº¤ä»æ¶é´ |
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¶é´ |
| | | payenddate: '', // é¢è®¡å®å·¥æ¶é´ |
| | | createdate: '', // å建æ¶é´ |
| | | |
| | | datatype: 'ED', // æ¶é´ç±»å |
| | | timeValue: [], // æ¶é´å¼ |
| | | |
| | | prop: 'wo', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | |
| | | erporderstusArr: [ |
| | | { code: 'NEW', name: 'æ°è®¢å' }, |
| | | { code: 'CREATING', name: 'é¨åä¸è¾¾' }, |
| | | { code: 'CREATED', name: 'å
¨é¨ä¸è¾¾' }, |
| | | { code: 'CLOSED', name: 'å·²å
³é' } |
| | | ], |
| | | wkshopcodeArr: [], |
| | | total: 10, |
| | | radioSelectedId: '', |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | erporderid: '', // 订åid |
| | | sbid: '', // 订åæç»id |
| | | erpordercode: '', // 订åç¼å· |
| | | saleordercode: '', // éå®è®¢å |
| | | |
| | | partcode: '', // 产åç¼ç |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | |
| | | wkshopcode: '', // 车é´ç¼ç |
| | | wkshopname: '', // 车é´åç§° |
| | | |
| | | warehousecode: '', // ä»åºç¼ç |
| | | warehousename: '', // ä»åºåç§° |
| | | |
| | | erpqty: '', // è®¢åæ°é |
| | | markqty: '', // ä¸åæ°é |
| | | ordernum: '', // ä¸ååæ° |
| | | relse_qty: '', // å·²ä¸åæ°é |
| | | |
| | | clerkuser: '', // éå®ä¸å¡å |
| | | |
| | | saleOrderDeliveryDate: '', // é¢è®¡äº¤ä»æ¥æ |
| | | |
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¥æ |
| | | payenddate: ''// é¢è®¡å®å·¥æ¥æ |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | // OrgType: [ |
| | | // { required: true, message: '请è¾å
¥éæ©ç±»å', trigger: ['blur', 'change'] } |
| | | // ], |
| | | // OrgCode: [ |
| | | // { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | // ], |
| | | markqty: [ |
| | | { required: true, message: '请è¾å
¥ä¸åæ°é', trigger: ['blur', 'change'] } |
| | | ], |
| | | ordernum: [ |
| | | { required: true, message: '请è¾å
¥ä¸ååæ°', trigger: ['blur', 'change'] } |
| | | ], |
| | | saleOrderDeliveryDate: [ |
| | | { required: true, message: 'è¯·éæ©é¢è®¡äº¤ä»æ¥æ', trigger: ['blur', 'change'] } |
| | | ] |
| | | |
| | | }, |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < Date.now() - 8.64e7 |
| | | } |
| | | }, |
| | | multipleSelection: [] |
| | | |
| | | // expireTimeOption: { |
| | | // disabledDate(time) { |
| | | // return time.getTime() > Date.now() - 8.64e6 // å¦ææ²¡æåé¢ç-8.64e6å°±æ¯ä¸å¯ä»¥éæ©ä»å¤©ç |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | }, |
| | | activated() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | created() { |
| | | this.getErpOrderSearch() |
| | | // this.getPartSelect()// è·å产åç¼ç ä¿¡æ¯ |
| | | |
| | | this.getPrentOrganizationNoCompany() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | |
| | | DateTypeChange(value) { |
| | | this.form.datatype = value |
| | | }, |
| | | cycleTimeChange(val) { |
| | | this.form.timeValue = val |
| | | }, |
| | | |
| | | pickerChange(value) { |
| | | console.log(value, 123) |
| | | this.cycleTime = null |
| | | }, |
| | | |
| | | async getPrentOrganizationNoCompany() { |
| | | const { data: res } = await PrentOrganizationNoCompany() |
| | | this.wkshopcodeArr = res |
| | | }, |
| | | async getErpOrderSearch() { |
| | | console.log(this.form, 1) |
| | | // let tempDate2 = this.form.paystartdate |
| | | // if (tempDate2.length > 0) { |
| | | // tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1]) |
| | | // } |
| | | // |
| | | // let tempDate = this.form.payenddate |
| | | // if (tempDate.length > 0) { |
| | | // tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) |
| | | // } |
| | | |
| | | const data = { |
| | | |
| | | erporderstus: this.form.erporderstus, // 订åç¶æç |
| | | wkshopcode: this.form.wkshopcode, // 车é´ç¼ç |
| | | erpordercode: this.form.erpordercode, // 订åç¼å· |
| | | saleordercode: this.form.saleordercode, // éå®åå· |
| | | |
| | | partcode: this.form.partcode, // 产åç¼ç |
| | | partname: this.form.partname, // 产ååç§° |
| | | partspec: this.form.partspec, // 产åè§æ ¼ |
| | | |
| | | datatype: this.form.datatype, // æ¥æç±»å(计åå¼å·¥(PS)ã计åå®å·¥(PE)ãé¢è®¡äº¤ä»(ED)) |
| | | searchdate: this.form.timeValue.join('~'), // æ¶é´æ®µ |
| | | // paystartdate: tempDate2, // äº¤ä»æ¶é´ |
| | | // payenddate: tempDate, // äº¤ä»æ¶é´ |
| | | |
| | | creatuser: this.form.creatuser, // å建人å |
| | | |
| | | prop: this.form.prop, // æåºå段 |
| | | order: this.form.order, // æåºå段 |
| | | page: this.form.page, // 第å 页 |
| | | rows: this.form.rows // æ¯é¡µå¤å°æ¡ |
| | | |
| | | } |
| | | |
| | | const res = await ErpOrderSearch(data) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getErpOrderSearch() |
| | | }, |
| | | // 忥ERP |
| | | syncERP() { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: 'æ£å¨åæ¥ERPï¼è¯·ç¨ç...', |
| | | spinner: 'el-icon-loading', |
| | | customClass: 'osloading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }) |
| | | |
| | | SeaveSearchErpOrder().then(res => { |
| | | console.log(res, 11) |
| | | if (res.code === '200') { |
| | | setTimeout(() => { |
| | | this.getErpOrderSearch() |
| | | loading.close() |
| | | this.$message.success('忥æåï¼') |
| | | }, 2000) |
| | | } |
| | | // else if (res.code === '300') { |
| | | // setTimeout(() => { |
| | | // loading.close() |
| | | // this.$message.error('åæ¥å¤±è´¥ï¼') |
| | | // }, 10000) |
| | | // } |
| | | }).catch(e => { |
| | | loading.close() |
| | | }) |
| | | }, |
| | | // æ¥è¯¢ |
| | | search() { |
| | | this.getErpOrderSearch() |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.form.wkshopcode = '' |
| | | this.form.erporderstus = '' |
| | | this.form.erpordercode = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.form.paystartdate = '' |
| | | this.form.payenddate = '' |
| | | this.form.creatuser = '' |
| | | this.form.saleordercode = '' |
| | | this.form.createdate = '' |
| | | |
| | | this.form.timeValue = [] |
| | | this.cycleTime = null |
| | | |
| | | this.$refs.DateTypeRef.clearValue() |
| | | |
| | | this.getErpOrderSearch() |
| | | }, |
| | | // åéæ¡éä¸è·åå½åè¡ä¿¡æ¯ |
| | | // getCurrentRow(id) { |
| | | // this.radioSelectedId = id |
| | | // }, |
| | | // rowClick(row) { |
| | | // this.radioSelectedId = row.id |
| | | // }, |
| | | |
| | | // 订åå é¤ |
| | | orderDel(id) { |
| | | this.tableData.forEach(item => { |
| | | if (item.id === id) { |
| | | if (item.status === 'CLOSED') { |
| | | return this.$message.info('æ¤è®¢åå·²å
³éï¼æ æ³å é¤ï¼') |
| | | } else { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å
³é订å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('订åå 餿å!') |
| | | this.getErpOrderSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶å é¤ï¼') |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 订åå
³é |
| | | async orderClose(id) { |
| | | this.tableData.forEach(item => { |
| | | if (item.id === id) { |
| | | if (item.status !== 'NEW') { |
| | | return this.$message.info('æ¤è®¢åéæ°è®¢åï¼æ æ³å
³éï¼') |
| | | } else { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å
³é订å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | ClosedErpOrder({ erpordercode: item.wo, erporderid: id }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('订åå
³éæå!') |
| | | this.getErpOrderSearch() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶å
³éï¼') |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | batchHandle() { |
| | | this.$confirm('æ¯å¦æ¹éä¸è¾¾?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (this.multipleSelection.length === 0) { |
| | | return this.$message.info('请å
éæ©è®¢åï¼') |
| | | } |
| | | // console.log(JSON.parse(JSON.stringify(this.multipleSelection))) |
| | | const data = [] |
| | | this.multipleSelection.forEach(i => { |
| | | data.push({ |
| | | 'erporderid': i.id, |
| | | 'sbid': i.sbid, |
| | | 'erpordercode': i.wo, |
| | | 'partcode': i.partcode, |
| | | 'wkshopcode': i.wkshp_code, |
| | | 'warehousecode': i.stck_code, |
| | | 'erpqty': i.qty, |
| | | 'markqty': i.qty, |
| | | 'ordernum': 1, |
| | | 'clerkuser': i.clerkuser, |
| | | 'relse_qty': i.qty, |
| | | 'saleordercode': i.saleOrderCode, |
| | | // 'saleOrderDeliveryDate': i.saleOrderDeliveryDate |
| | | 'saleOrderDeliveryDate': handleDatetime(new Date()) + ' 00:00:00', |
| | | |
| | | 'paystartdate': i.planstartdate, |
| | | 'payenddate': i.planenddate |
| | | }) |
| | | }) |
| | | // console.log(JSON.parse(JSON.stringify(data))) |
| | | MarkBatchSaveErpOrder(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.multipleSelection = [] |
| | | this.$message.success('æ¹éä¸è¾¾æåï¼') |
| | | this.getErpOrderSearch() |
| | | } else { |
| | | this.$message.error('æ¹éä¸è¾¾å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message.info('已忶ä¸è¾¾ï¼') |
| | | }) |
| | | }, |
| | | selected(row, index) { |
| | | return row.status === 'NEW' |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | edit(operation, row) { |
| | | if (parseFloat(row.qty) === parseFloat(row.relse_qty) || row.status === 'CLOSED') { |
| | | return this.$message.info('æ¤å·¥åå·²å
¨é¨ä¸è¾¾ï¼') |
| | | } |
| | | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.sbid = row.sbid |
| | | this.dialogForm.erporderid = row.id |
| | | this.dialogForm.erpordercode = row.wo |
| | | this.dialogForm.saleordercode = row.saleOrderCode |
| | | |
| | | this.dialogForm.partcode = row.partcode |
| | | this.dialogForm.partname = row.partname |
| | | this.dialogForm.partspec = row.partspec |
| | | |
| | | this.dialogForm.wkshopcode = row.wkshp_code |
| | | this.dialogForm.wkshopname = row.wkshp_name |
| | | |
| | | this.dialogForm.warehousecode = row.stck_code |
| | | this.dialogForm.warehousename = row.stck_name |
| | | |
| | | this.dialogForm.saleOrderDeliveryDate = row.saleOrderDeliveryDate |
| | | |
| | | this.dialogForm.erpqty = row.qty |
| | | this.dialogForm.markqty = parseFloat(row.qty) - parseFloat(row.relse_qty) |
| | | this.dialogForm.ordernum = 1 |
| | | this.dialogForm.relse_qty = row.relse_qty |
| | | this.dialogForm.clerkuser = row.clerkuser |
| | | |
| | | this.dialogForm.paystartdate = row.planstartdate |
| | | this.dialogForm.payenddate = row.planenddate |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm = { |
| | | erporderid: '', // 订åid |
| | | sbid: '', // 订åæç»id |
| | | erpordercode: '', // 订åç¼å· |
| | | saleordercode: '', // éå®è®¢å |
| | | |
| | | partcode: '', // 产åç¼ç |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | |
| | | wkshopcode: '', // 车é´ç¼ç |
| | | wkshopname: '', // 车é´åç§° |
| | | |
| | | warehousecode: '', // ä»åºç¼ç |
| | | warehousename: '', // ä»åºåç§° |
| | | |
| | | erpqty: '', // è®¢åæ°é |
| | | markqty: '', // ä¸åæ°é |
| | | ordernum: '', // ä¸ååæ° |
| | | relse_qty: '', // å·²ä¸åæ°é |
| | | |
| | | payenddate: '', // é¢è®¡å®å·¥æ¥æ |
| | | paystartdate: '', // é¢è®¡å¼å·¥æ¥æ |
| | | |
| | | saleOrderDeliveryDate: '' // é¢è®¡äº¤ä»æ¥æ |
| | | } |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.dialogForm.markqty = parseFloat(this.dialogForm.markqty) |
| | | this.dialogForm.erpqty = parseFloat(this.dialogForm.erpqty) |
| | | this.dialogForm.relse_qty = parseFloat(this.dialogForm.relse_qty) |
| | | this.dialogForm.ordernum = parseFloat(this.dialogForm.ordernum) |
| | | if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) { |
| | | return this.$message.info('ä¸åæ°éè¶
åºå¯ä¸åæ°çèå´ï¼') |
| | | } |
| | | |
| | | if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) { |
| | | return this.$message.info('ä¸ååæ°è¶
åºå¯ä¸ååæ°çèå´ï¼') |
| | | } |
| | | |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const data = { |
| | | 'sbid': this.dialogForm.sbid, |
| | | 'erporderid': this.dialogForm.erporderid, |
| | | 'erpordercode': this.dialogForm.erpordercode, |
| | | 'saleordercode': this.dialogForm.saleordercode, |
| | | 'partcode': this.dialogForm.partcode, |
| | | 'wkshopcode': this.dialogForm.wkshopcode, |
| | | 'warehousecode': this.dialogForm.warehousecode, |
| | | 'clerkuser': this.dialogForm.clerkuser, |
| | | 'erpqty': this.dialogForm.erpqty, |
| | | 'markqty': this.dialogForm.markqty, |
| | | 'ordernum': this.dialogForm.ordernum, |
| | | 'payenddate': this.dialogForm.payenddate, |
| | | 'paystartdate': this.dialogForm.paystartdate, |
| | | 'relse_qty': this.dialogForm.relse_qty, |
| | | 'saleOrderDeliveryDate': handleDatetime(this.dialogForm.saleOrderDeliveryDate) + ' 00:00:00' |
| | | } |
| | | |
| | | MarkSaveErpOrder(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$message.success('ä¸è¾¾æåï¼') |
| | | this.getErpOrderSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$message.error('ä¸è¾¾å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 250 |
| | | |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | getSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | const i = 7 |
| | | columns.forEach((column, index) => { |
| | | if (index === i) { |
| | | sums[index] = 'æ»æ°' |
| | | return |
| | | } |
| | | const values = data.map(item => Number(item[column.property])) |
| | | if (column.property === 'qty') { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100 |
| | | } |
| | | }, 0) |
| | | |
| | | sums[index] += ' å' |
| | | } |
| | | if (column.property === 'relse_qty') { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100 |
| | | } |
| | | }, 0) |
| | | |
| | | sums[index] += ' å' |
| | | } |
| | | }) |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | return sums |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!--å
Œ
±é¡µé¢æ ·å¼--> |
| | | <style lang="scss" scoped> |
| | | $main_color: #42b983; |
| | | |
| | | ::v-deep .el-range__icon { |
| | | line-height: 28px !important; |
| | | } |
| | | |
| | | ::v-deep .el-range-separator { |
| | | line-height: 28px !important; |
| | | } |
| | | |
| | | ::v-deep .el-range-input { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | ::v-deep .el-range-separator { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline { |
| | | color: $main_color; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-edit-outline { |
| | | margin-right: 15px; |
| | | } |
| | | |
| | | //::v-deep .el-button--primary, .el-button--default, .el-button--info { |
| | | // height: 34px; |
| | | // display: flex; |
| | | // align-items: center; |
| | | // padding: 0 15px; |
| | | //} |
| | | |
| | | ::v-deep .el-button--primary { |
| | | //background-color: $main_color !important; |
| | | } |
| | | |
| | | ::v-deep .el-button--default { |
| | | background-color: #f8f8fa; |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | height: 34px; |
| | | line-height: 34px; |
| | | //color: #a7a7a7; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 100px !important; |
| | | } |
| | | |
| | | ::v-deep .dialogVisibleRoles .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .importPickerClass .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | ::v-deep .el-table .caret-wrapper { |
| | | transform: scale(0.8); |
| | | } |
| | | |
| | | ::v-deep .cell { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | ::v-deep .el-table::before { |
| | | height: 0; |
| | | } |
| | | |
| | | ::v-deep .el-table__body-wrapper { |
| | | background-color: #f8f8fa; |
| | | } |
| | | |
| | | ::v-deep .el-table__body .el-table__row.hover-row td { |
| | | background-color: #eaecef; |
| | | } |
| | | |
| | | ::v-deep .el-form--inline .el-form-item__label { |
| | | color: #a7a7a7; |
| | | } |
| | | |
| | | .body ::v-deep .el-divider { |
| | | border: 1px solid #eee; |
| | | width: 99%; |
| | | margin: 10px auto; |
| | | } |
| | | |
| | | .body ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .userDialogVisible ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .elTableDiv { |
| | | ::v-deep .el-radio__label { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | .tableFixed { |
| | | ::v-deep .el-table__fixed-right { |
| | | height: 100% !important; |
| | | } |
| | | |
| | | ::v-deep .el-table__fixed { |
| | | height: 100% !important; |
| | | } |
| | | } |
| | | |
| | | .dateMini { |
| | | ::v-deep .el-input__inner { |
| | | line-height: 34px; |
| | | height: 34px; |
| | | width: 200px; |
| | | display: flex; |
| | | font-size: 14px !important; |
| | | align-items: center !important; |
| | | } |
| | | |
| | | ::v-deep .el-input__prefix { |
| | | margin-top: -3px; |
| | | } |
| | | } |
| | | |
| | | ::v-deep .el-icon-delete { |
| | | cursor: pointer; |
| | | margin-right: 0px !important; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | |
| | | .osloading { |
| | | font-size: 26px !important; |
| | | } |
| | | |
| | | .el-loading-text { |
| | | font-size: 26px !important; |
| | | } |
| | | |
| | | .el-picker-panel__footer { |
| | | display: flex !important; |
| | | justify-content: flex-end !important; |
| | | } |
| | | |
| | | </style> |
| | | |