|
|
@@ -0,0 +1,1880 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div v-if="pageDisplay" class="app-container">
|
|
|
+ <formComponent
|
|
|
+ v-if="searchWhether"
|
|
|
+ :formOption="formOption"
|
|
|
+ :dataList="dataList"
|
|
|
+ :inDex="inDex"
|
|
|
+ ref="avatar"
|
|
|
+ @submitForm="submitForm"
|
|
|
+ @returnToForm="returnToForm"
|
|
|
+ ></formComponent>
|
|
|
+ <listComponent
|
|
|
+ :tableData="tableData"
|
|
|
+ @selectionbox="selectionbox"
|
|
|
+ @see="viewMethod"
|
|
|
+ @modify="modification"
|
|
|
+ @deletion="deletion"
|
|
|
+ @buttonList="buttonList"
|
|
|
+ @showSearch="showSearch"
|
|
|
+ @feedback="feedback"
|
|
|
+ @getList="getList"
|
|
|
+ :tatolLabel="['金额']"
|
|
|
+ :hasPermi="hasPermi"
|
|
|
+ :isItHidden="isItHidden"
|
|
|
+ :customButton="customButton"
|
|
|
+ :listStyle="listStyle"
|
|
|
+ :queryList="queryList"
|
|
|
+ :setRowList="setRowList"
|
|
|
+ ></listComponent>
|
|
|
+ <div style="float: right;margin-bottom: 10px">
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="formDataList.pageNum"
|
|
|
+ :limit.sync="formDataList.pageSize"
|
|
|
+ :page-sizes="[10,100,200,500,1000]"
|
|
|
+ @pagination="feedback('搜索')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="app-container">
|
|
|
+ <div style="display: flex;margin-bottom: 10px">
|
|
|
+ <el-breadcrumb>
|
|
|
+ <el-breadcrumb-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger" plain
|
|
|
+ @click="backToList"
|
|
|
+ icon="el-icon-arrow-left">
|
|
|
+ 返回列表</el-button>
|
|
|
+ </el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ </div>
|
|
|
+ <h1 style="text-align: center;margin-top: -42px">仓库调拨单</h1>
|
|
|
+ <formComponent
|
|
|
+ v-if="searchWhether"
|
|
|
+ :formOption="contentOption"
|
|
|
+ :dataList="dataList"
|
|
|
+ :inDex="inDex"
|
|
|
+ ref="avatar"
|
|
|
+ @writeOff="writeOff"
|
|
|
+ @submitForm="submitForm"
|
|
|
+ @returnToForm="returnToForm"
|
|
|
+ @submitAndSave="submitAndSave"
|
|
|
+ @selectTrigger="selectTrigger"
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
+ <span class="detail-title">调出信息</span>
|
|
|
+ </div>
|
|
|
+ <el-form :inline="true" :model="formIn" ref="formIn" :rules="inRules">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="调出项目" prop="fGoodsid">
|
|
|
+ <el-select
|
|
|
+ v-model="formIn.fGoodsid"
|
|
|
+ placeholder="模糊查询"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dict, index) in dataList.fGoodsid"
|
|
|
+ :key="index.fId"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="调出仓库" prop="fWarehouseid">
|
|
|
+ <el-select
|
|
|
+ v-model="formIn.fWarehouseid"
|
|
|
+ placeholder="模糊查询"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ @change="changeWarehouse(1)"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dict, index) in dataList.fWarehouseid"
|
|
|
+ :key="index.fId"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
+ <span class="detail-title">调入信息</span>
|
|
|
+ </div>
|
|
|
+ <el-form :inline="true" :model="formOut" ref="formOut" :rules="outRules">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="调入项目" prop="fProject">
|
|
|
+ <el-select
|
|
|
+ v-model="formOut.fProject"
|
|
|
+ placeholder="模糊查询"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dict, index) in dataList.fProject"
|
|
|
+ :key="index.fId"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="调入仓库" prop="fAllotWarehouseid">
|
|
|
+ <el-select
|
|
|
+ v-model="formOut.fAllotWarehouseid"
|
|
|
+ placeholder="模糊查询"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ @change="changeWarehouse(2)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dict, index) in dataList.fAllotWarehouseid"
|
|
|
+ :key="index.fId"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <listComponent
|
|
|
+ ref="listComponent"
|
|
|
+ :tableData="contentList"
|
|
|
+ @selectionbox="selectionbox"
|
|
|
+ @see="viewMethod"
|
|
|
+ @modify="modification"
|
|
|
+ @deletion="deletion"
|
|
|
+ @buttonList="buttonList"
|
|
|
+ @showSearch="showSearch"
|
|
|
+ @feedback="feedback"
|
|
|
+ @getList="getList"
|
|
|
+ @deletRows="deletRows"
|
|
|
+ @totalAmount="totalAmount"
|
|
|
+ @change="change"
|
|
|
+ :hasPermi="hasPermi"
|
|
|
+ :tatolLabel="tatolLabel"
|
|
|
+ :isItHidden="isItHidden"
|
|
|
+ :customButton="contentButton"
|
|
|
+ :listStyle="contentStyle"
|
|
|
+ :queryList="purchaseList"
|
|
|
+ :setRowList="setRowList"
|
|
|
+ :listData="listData"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Cookies from 'js-cookie'
|
|
|
+import moment from 'moment'
|
|
|
+import { select } from '@/api/system/set'
|
|
|
+import {
|
|
|
+ listQuery,
|
|
|
+ submit,
|
|
|
+ viewSingle,
|
|
|
+ deleteQuery,
|
|
|
+ productName,
|
|
|
+ queryItem,
|
|
|
+ company,
|
|
|
+ warehouse,
|
|
|
+ listDelete,
|
|
|
+ tableDeleteQuery,
|
|
|
+ confirmDeletion,
|
|
|
+ pleaseCheck,
|
|
|
+ copyNew,
|
|
|
+ revoke,
|
|
|
+ withdrawBy,
|
|
|
+ getName,
|
|
|
+ queryUserVal
|
|
|
+} from '@/api/purchaseRequest/index'
|
|
|
+import {allocationListQuery,selectMessage,getKeeper,getStockNumPrice,isAllocation} from '@/api/allocation/index'
|
|
|
+import {
|
|
|
+ getArea
|
|
|
+} from '@/api/warehouse/inStock'
|
|
|
+import log from '../../monitor/job/log'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'allocation',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ addOrUpdateVisible: false,
|
|
|
+ form: {},
|
|
|
+ hasPermi:{
|
|
|
+ lookup:['anpin:stockControl:query'],
|
|
|
+ disappear:['anpin:stockControl:remove']
|
|
|
+ },
|
|
|
+ // 列表页与详情页切换,true列表 false详情
|
|
|
+ pageDisplay: true,
|
|
|
+ // 搜索是否隐藏
|
|
|
+ searchWhether: true,
|
|
|
+ // 主页表单
|
|
|
+ formOption: [
|
|
|
+ {
|
|
|
+ index:'1',
|
|
|
+ span: 6,
|
|
|
+ label: 'fGoodsid',
|
|
|
+ name: '调出项目',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'2',
|
|
|
+ span: 6,
|
|
|
+ label: 'fProject',
|
|
|
+ name: '调入项目',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'3',
|
|
|
+ span: 6,
|
|
|
+ label: 'fWarehouseid',
|
|
|
+ name: '调出仓库',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'4',
|
|
|
+ span: 6,
|
|
|
+ label: 'fAllotWarehouseid',
|
|
|
+ name: '调入仓库',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'5',
|
|
|
+ span: 6,
|
|
|
+ label: 'fBsdate',
|
|
|
+ name: '调拨日期',
|
|
|
+ inputType: 6,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'6',
|
|
|
+ span: 6,
|
|
|
+ label: 'fSbu',
|
|
|
+ name: '开票公司',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'7',
|
|
|
+ span: 6,
|
|
|
+ label: 'creatBy',
|
|
|
+ name: '申请人',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'8',
|
|
|
+ span: 6,
|
|
|
+ label: 'fBillno',
|
|
|
+ name: '系统编号',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'9',
|
|
|
+ span: 6,
|
|
|
+ label: 'fFeeid',
|
|
|
+ name: '品名',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'10',
|
|
|
+ span: 6,
|
|
|
+ label: 'remark',
|
|
|
+ name: '备注',
|
|
|
+ inputType: 4,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 详情页表单
|
|
|
+ contentOption: [
|
|
|
+ {
|
|
|
+ index:'1',
|
|
|
+ span: 6,
|
|
|
+ label: 'fBillno',
|
|
|
+ name: '系统编号',
|
|
|
+ inputType: 2,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ disabled: true,
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'2',
|
|
|
+ span: 6,
|
|
|
+ label: 'fStorekeeper',
|
|
|
+ name: '库管员',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{ required: true, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'3',
|
|
|
+ span: 6,
|
|
|
+ label: 'fBsdate',
|
|
|
+ name: '调拨日期',
|
|
|
+ inputType: 6,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{ required: true, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'4',
|
|
|
+ span: 6,
|
|
|
+ label: 'fSbu',
|
|
|
+ name: '开票公司',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ disabled: false,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: true, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index:'5',
|
|
|
+ span: 6,
|
|
|
+ label: 'remark',
|
|
|
+ name: '备注',
|
|
|
+ inputType: 4,
|
|
|
+ disabled: false,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 表单下拉框的内容
|
|
|
+ dataList: {
|
|
|
+ // 开票公司
|
|
|
+ fSbu: [],
|
|
|
+ // 品名
|
|
|
+ fFeeid: [],
|
|
|
+ // 调入仓库
|
|
|
+ fAllotWarehouseid: [],
|
|
|
+ // 调出仓库
|
|
|
+ fWarehouseid: [],
|
|
|
+ // 调出项目
|
|
|
+ fGoodsid: [],
|
|
|
+ // 调入项目
|
|
|
+ fProject: [],
|
|
|
+ // 库管员
|
|
|
+ fStorekeeper: [],
|
|
|
+ // 供应商
|
|
|
+ fCorpid: [],
|
|
|
+ },
|
|
|
+ inDex: 4,
|
|
|
+ // 主表内容
|
|
|
+ tableData: [],
|
|
|
+ isItHidden: true,
|
|
|
+ // 首页按钮
|
|
|
+ customButton: [
|
|
|
+ {
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-plus',
|
|
|
+ name: '新单',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:anPingApply']
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // type: 'success',
|
|
|
+ // size: 'mini',
|
|
|
+ // icon: 'el-icon-edit',
|
|
|
+ // name: '修改',
|
|
|
+ // disabled: false
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ type: 'danger',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-delete',
|
|
|
+ name: '删除',
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'warning',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-upload2',
|
|
|
+ name: '导出',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:export']
|
|
|
+ }, {
|
|
|
+ type: 'success',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-c-scale-to-original',
|
|
|
+ name: '复制新单',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:generateReceipts']
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 详情页按钮
|
|
|
+ contentButton: [
|
|
|
+ {
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ name: '录入明细',
|
|
|
+ nameTwo:'详情页',
|
|
|
+ // plain: true,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'success',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-check',
|
|
|
+ name: '保存',
|
|
|
+ // plain: true,
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:anPingApply']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-plus',
|
|
|
+ name: '新单',
|
|
|
+ nameTwo:'详情页',
|
|
|
+ plain: true,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'primary',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ name: '复制新单',
|
|
|
+ nameTwo: '详情页',
|
|
|
+ copyeRow: true,
|
|
|
+ plain: true,
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'warning',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit',
|
|
|
+ name: '修改',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:anPingApply']
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'warning',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-refresh',
|
|
|
+ name: '刷新',
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'info',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '打印',
|
|
|
+ disabled: false
|
|
|
+ },{
|
|
|
+ type: 'info',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '调拨确认',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:cannibalize']
|
|
|
+ },{
|
|
|
+ type: 'info',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '撤销调拨',
|
|
|
+ disabled: false,
|
|
|
+ hasPermi:['anpin:stockControl:cannibalize']
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 首页表头
|
|
|
+ listStyle: [
|
|
|
+ {
|
|
|
+ surface: '1',
|
|
|
+ label: 'serialNumber',
|
|
|
+ name: '序号',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '2',
|
|
|
+ label: 'fBillno',
|
|
|
+ name: '系统编号',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '3',
|
|
|
+ label: 'projectName',
|
|
|
+ name: '调出项目',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '4',
|
|
|
+ label: 'fWarehouseName',
|
|
|
+ name: '调出仓库',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '5',
|
|
|
+ label: 'fProjectName',
|
|
|
+ name: '调入项目',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '6',
|
|
|
+ label: 'fAllotWarehouseName',
|
|
|
+ name: '调入仓库',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '7',
|
|
|
+ label: 'fsbuName',
|
|
|
+ name: '开票公司',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '8',
|
|
|
+ label: 'createTime',
|
|
|
+ name: '申请日期',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '9',
|
|
|
+ label: 'createBy',
|
|
|
+ name: '申请人',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '10',
|
|
|
+ label: 'fBillstatusName',
|
|
|
+ name: '状态',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '11',
|
|
|
+ label: 'fReviewDate',
|
|
|
+ name: '审核日期',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '12',
|
|
|
+ label: 'remark',
|
|
|
+ name: '备注',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '13',
|
|
|
+ label: 'operation',
|
|
|
+ name: '操作',
|
|
|
+ checked: 0,
|
|
|
+ width: 160,
|
|
|
+ fixed:'right',
|
|
|
+ operation: '1',
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 详情页表头
|
|
|
+ contentStyle: [
|
|
|
+ {
|
|
|
+ surface: '1',
|
|
|
+ label: 'serialNumber',
|
|
|
+ name: '序号',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '2',
|
|
|
+ label: 'fFeeid',
|
|
|
+ name: '品名',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ //changeable: 1 下拉 2 input 3 date
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '3',
|
|
|
+ label: 'fFeeunitid',
|
|
|
+ name: '计量单位',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '4',
|
|
|
+ label: 'fWarehouseid',
|
|
|
+ name: '调出库区',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '5',
|
|
|
+ label: 'fCorpid',
|
|
|
+ name: '供应商',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '7',
|
|
|
+ label: 'fGrossweightblc',
|
|
|
+ name: '库存数量',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ disabled: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '8',
|
|
|
+ label: 'fVolumnblc',
|
|
|
+ name: '库存单价',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ disabled: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '9',
|
|
|
+ label: 'fAllotWarehouseid',
|
|
|
+ name: '调入库区',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '10',
|
|
|
+ label: 'fQty',
|
|
|
+ name: '数量',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '11',
|
|
|
+ label: 'fUnitprice',
|
|
|
+ name: '单价',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '12',
|
|
|
+ label: 'fAmount',
|
|
|
+ name: '金额',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '13',
|
|
|
+ label: 'fStltypeid',
|
|
|
+ name: '付费方式',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '14',
|
|
|
+ label: 'remark',
|
|
|
+ name: '备注',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: '',
|
|
|
+ changeable: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '15',
|
|
|
+ label: 'createTime',
|
|
|
+ name: '申请日期',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '16',
|
|
|
+ label: 'createBy',
|
|
|
+ name: '操作员',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '17',
|
|
|
+ label: 'fReviewDate',
|
|
|
+ name: '审核日期',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '18',
|
|
|
+ label: 'operation',
|
|
|
+ name: '操作',
|
|
|
+ checked: 0,
|
|
|
+ width: 160,
|
|
|
+ fixed:'right',
|
|
|
+ operation: '2',
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ //
|
|
|
+ queryList: {
|
|
|
+ tableName: '仓库调拨',
|
|
|
+ columnList: []
|
|
|
+ },
|
|
|
+ purchaseList: {
|
|
|
+ tableName: '仓库调拨详情',
|
|
|
+ columnList: []
|
|
|
+ },
|
|
|
+ setRowList: [],
|
|
|
+ // 总数
|
|
|
+ total: 0,
|
|
|
+ // 选择框选择的数据
|
|
|
+ selection: [],
|
|
|
+ formDataList:{
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ },
|
|
|
+ // 详情页表格数据
|
|
|
+ contentList: [],
|
|
|
+ //
|
|
|
+ listData: {
|
|
|
+ fFeeid: [],
|
|
|
+ fFeeunitid: [],
|
|
|
+ fStltypeid: [],
|
|
|
+ fCorpid: [],
|
|
|
+ // 调入仓库
|
|
|
+ fAllotWarehouseid: [],
|
|
|
+ // 调出仓库
|
|
|
+ fWarehouseid: [],
|
|
|
+ },
|
|
|
+ tatolLabel:['金额'],
|
|
|
+ formIn: {
|
|
|
+ fGoodsid: null,
|
|
|
+ fWarehouseid: null,
|
|
|
+ },
|
|
|
+ formOut: {
|
|
|
+ fProject: null,
|
|
|
+ fAllotWarehouseid: null,
|
|
|
+ },
|
|
|
+ inRules: {
|
|
|
+ fGoodsid: [{required: true, message: '不能为空', trigger: 'change'}],
|
|
|
+ fWarehouseid: [{required: true, message: '不能为空', trigger: 'change'}],
|
|
|
+ },
|
|
|
+ outRules: {
|
|
|
+ fProject: [{required: true, message: '不能为空', trigger: 'change'}],
|
|
|
+ fAllotWarehouseid: [{required: true, message: '不能为空', trigger: 'change'}],
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ let data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ // 付费方式
|
|
|
+ this.getDicts('f_paymode').then(res => {
|
|
|
+ console.log(res)
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fStltypeid.push({
|
|
|
+ label: res.data[item].dictLabel,
|
|
|
+ value: JSON.parse(res.data[item].dictValue)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 查询计量单位
|
|
|
+ this.getDicts('data_unitfees').then(res => {
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fFeeunitid.push({
|
|
|
+ label: res.data[item].dictLabel,
|
|
|
+ value: JSON.parse(res.data[item].dictValue)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ productName().then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ for (let item in res.rows) {
|
|
|
+ this.dataList.fFeeid.push({
|
|
|
+ label: res.rows[item].fName,
|
|
|
+ value: res.rows[item].fId
|
|
|
+ })
|
|
|
+ this.listData.fFeeid.push({
|
|
|
+ label: res.rows[item].fName,
|
|
|
+ value: res.rows[item].fId,
|
|
|
+ fFeeunitid: res.rows[item].fFeeunitid,
|
|
|
+ fCurrency: res.rows[item].fCurrency
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 查询项目
|
|
|
+ queryItem().then(res => {
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.dataList.fGoodsid.push({
|
|
|
+ label: res.data[item].projectName,
|
|
|
+ value: res.data[item].fId,
|
|
|
+ personNaem: res.data[item].personNaem,
|
|
|
+ corpsName: res.data[item].corpsName,
|
|
|
+ fCorpid: res.data[item].fCorpid
|
|
|
+ })
|
|
|
+ this.dataList.fProject.push({
|
|
|
+ label: res.data[item].projectName,
|
|
|
+ value: res.data[item].fId,
|
|
|
+ personNaem: res.data[item].personNaem,
|
|
|
+ corpsName: res.data[item].corpsName,
|
|
|
+ fCorpid: res.data[item].fCorpid
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //查询仓库
|
|
|
+ warehouse().then(res => {
|
|
|
+ for (let item in res.rows) {
|
|
|
+ this.dataList.fWarehouseid.push({
|
|
|
+ label: res.rows[item].fName,
|
|
|
+ value: res.rows[item].fId
|
|
|
+ })
|
|
|
+ this.dataList.fAllotWarehouseid.push({
|
|
|
+ label: res.rows[item].fName,
|
|
|
+ value: res.rows[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 查询库管员
|
|
|
+ const keeper = {
|
|
|
+ pageNum: 1,
|
|
|
+ roleName: '库管'
|
|
|
+ }
|
|
|
+ getKeeper(keeper).then(res => {
|
|
|
+ for (let item in res.rows) {
|
|
|
+ this.dataList.fStorekeeper.push(
|
|
|
+ {
|
|
|
+ label: res.rows[item].userName,
|
|
|
+ value: res.rows[item].userId.toString()
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.fCompany(1)
|
|
|
+ this.fCompany(2)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //表单验证通过执行搜索
|
|
|
+ submitForm() {
|
|
|
+ let list = this.formDataList
|
|
|
+ this.formDataList = this.$refs.avatar.form
|
|
|
+ this.formDataList.fBilltype = list.fBilltype
|
|
|
+ this.formDataList.pageSize = list.pageSize
|
|
|
+ this.formDataList.pageNum = list.pageNum
|
|
|
+ this.formDataList.timeInterval = list.timeInterval
|
|
|
+ this.query(this.formDataList)
|
|
|
+ },
|
|
|
+ returnToForm(row) {
|
|
|
+ console.log(row, 111)
|
|
|
+ },
|
|
|
+ //选择框
|
|
|
+ selectionbox(selection) {
|
|
|
+ if (selection.length > 1){
|
|
|
+ this.customButton.forEach(item =>{
|
|
|
+ if (item.name === '复制新单'){
|
|
|
+ item.disabled = true
|
|
|
+ }else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.customButton.forEach(item => item.disabled = false)
|
|
|
+ this.selection = selection
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询公司
|
|
|
+ fCompany(name) {
|
|
|
+ company(name).then(res => {
|
|
|
+ if (name == 1) {
|
|
|
+ this.dataList.fCorpid = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.dataList.fCorpid.push({
|
|
|
+ label: res.data[item].fName,
|
|
|
+ value: res.data[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fCorpid.push({
|
|
|
+ label: res.data[item].fName,
|
|
|
+ value: res.data[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else if (name == 2) {
|
|
|
+ this.dataList.fSbu = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.dataList.fSbu.push({
|
|
|
+ label: res.data[item].fName,
|
|
|
+ value: res.data[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //查看-列表
|
|
|
+ viewMethod(scope,res,i) {
|
|
|
+ if(res){
|
|
|
+ this.contentButton.forEach(item => {
|
|
|
+ item.disabled = false
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.contentOption.forEach(item => item.disabled = true)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = true)
|
|
|
+ }
|
|
|
+ selectMessage(scope.row.fId).then(res => {
|
|
|
+ let data = {
|
|
|
+ tableName: this.purchaseList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ let list = {
|
|
|
+ warehouseBills:res.data.warehouseBills,
|
|
|
+ tWarehousebillsfees:res.data.tWarehousebillsfees
|
|
|
+ }
|
|
|
+ this.getRow(data,list,'',i)
|
|
|
+ })
|
|
|
+ // viewSingle(scope.row.fId).then(res => {
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // let data = {
|
|
|
+ // tableName: this.purchaseList.tableName,
|
|
|
+ // userId: Cookies.get('userName')
|
|
|
+ // }
|
|
|
+ // let list ={
|
|
|
+ // warehouseBills:res.data.warehouseBills,
|
|
|
+ // tWarehousebillsfees:res.data.tWarehousebillsfees
|
|
|
+ // }
|
|
|
+ // // this.$refs.avatar.form = {}
|
|
|
+ // this.getRow(data,list,'',i)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ //修改
|
|
|
+ modification(scope) {
|
|
|
+ console.log(scope)
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ deletion(scope) {
|
|
|
+ console.log(scope.row.fId)
|
|
|
+ tableDeleteQuery(scope.row.fId).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.$confirm(res.msg == 1 ? '主表数据为空' : (res.msg == 2 ? '主表有数据' : '未知状态') + '是否永久删除该条数据?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ confirmDeletion(scope.row.fId).then(data => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.query(this.formDataList)
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看审批流
|
|
|
+ getDataList() {
|
|
|
+ this.addOrUpdateVisible = false
|
|
|
+ },
|
|
|
+ //所有按钮
|
|
|
+ buttonList(row) {
|
|
|
+ let data
|
|
|
+ switch (row.name) {
|
|
|
+ case '新单':
|
|
|
+ if(row.nameTwo == '详情页'){
|
|
|
+ if(this.$refs.avatar.form.fId){
|
|
|
+ this.contentList = []
|
|
|
+ data = {
|
|
|
+ tableName: this.purchaseList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = {}
|
|
|
+ this.getRow(data,'',1)
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.contentButton.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ this.$refs.avatar.clearVerification()
|
|
|
+ this.$refs.avatar.form.createBy = Cookies.get('userName')
|
|
|
+ }else{
|
|
|
+ this.$message.error("当前数据未保存,请先保存")
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.contentList = []
|
|
|
+ data = {
|
|
|
+ tableName: this.purchaseList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = {}
|
|
|
+ this.getRow(data,'',1)
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.contentButton.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ this.$refs.avatar.clearVerification()
|
|
|
+ this.$refs.avatar.form.createBy = Cookies.get('userName')
|
|
|
+
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '保存':
|
|
|
+ this.$refs.formIn.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ this.$refs.formOut.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ this.$refs.avatar.submitForm('submit')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.$refs.avatar.submitForm('submit')
|
|
|
+ break
|
|
|
+ case '打印':
|
|
|
+ console.log(this.listData.fFeeid,this.contentList)
|
|
|
+ for (let item in this.contentList){
|
|
|
+ for (let li in this.listData.fFeeid){
|
|
|
+ if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value){
|
|
|
+ this.contentList[item].feeName = this.listData.fFeeid[li].label
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let i in this.listData.fFeeunitid){
|
|
|
+ if (this.contentList[item].fFeeunitid == this.listData.fFeeunitid[i].value){
|
|
|
+ this.contentList[item].fFeeunitName = this.listData.fFeeunitid[i].label
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.$refs.avatar.form.fId){
|
|
|
+ this.$message.error('未保存,不允许打印');
|
|
|
+ }else if (this.$refs.avatar.form.fBillstatus >= 4){
|
|
|
+ this.formList = this.$refs.avatar.form
|
|
|
+ this.dialogVisible = true
|
|
|
+ }else {
|
|
|
+ this.formList = this.$refs.avatar.form
|
|
|
+ console.log(this.$refs.avatar.form.fBillstatus)
|
|
|
+ this.submitAndSave(1)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '修改':
|
|
|
+ this.contentButton.forEach(item =>{
|
|
|
+ if (this.$refs.avatar.form.fBillstatus >= 4){
|
|
|
+ if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '生成入库单' || item.name === '生成销售单'||item.name === '生成出库单' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批'){
|
|
|
+ item.disabled = false
|
|
|
+ }else {
|
|
|
+ item.disabled = true
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ item.disabled = false
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '录入明细':
|
|
|
+ this.contentList.push({
|
|
|
+ fFeeid: '',
|
|
|
+ fFeeunitid: '',
|
|
|
+ fWarehouseid: '',
|
|
|
+ fCorpid: '',
|
|
|
+ fGrossweightblc: 0,
|
|
|
+ fVolumnblc: 0,
|
|
|
+ fAllotWarehouseid: '',
|
|
|
+ fQty: '',
|
|
|
+ fUnitprice: '',
|
|
|
+ fAmount: '',
|
|
|
+ fStltypeid: '',
|
|
|
+ remark: '',
|
|
|
+ createTime: '',
|
|
|
+ createBy: Cookies.get('userName'),
|
|
|
+ fReviewDate: '',
|
|
|
+ operation: '',
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '查看审批':
|
|
|
+ this.addOrUpdateHandle()
|
|
|
+ break
|
|
|
+ case '审批':
|
|
|
+ this.addOrUpdateHand()
|
|
|
+ break
|
|
|
+ case '请核':
|
|
|
+ if (this.$refs.avatar.form.fBillstatus < 4){
|
|
|
+ this.$refs.avatar.submitForm('check')
|
|
|
+ }else {
|
|
|
+ this.$message.error('请先保存');
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '调拨确认':
|
|
|
+ if (this.contentList.length === 0) {
|
|
|
+ this.$message.error("请维护明细")
|
|
|
+ } else {
|
|
|
+ let pass = false;
|
|
|
+ this.contentList.forEach(item => {
|
|
|
+ if (item.fGrossweightblc === 0) {
|
|
|
+ pass = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (pass) {
|
|
|
+ this.$message.error('当前库存数量为0,请修改调拨信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for(let item in this.contentList) {
|
|
|
+ let num = Number(item) + 1
|
|
|
+ if (!this.contentList[item].fUnitprice) {
|
|
|
+ this.$message.error("请维护第" + num + "行单价")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(!this.contentList[item].fQty){
|
|
|
+ this.$message.error("请维护第" + num + "数量")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.contentList[item].fFeeunitid) {
|
|
|
+ this.$message.error("请维护第" + num + "行计量单位")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.contentList[item].fAmount) {
|
|
|
+ this.$message.error("请维护第" + num + "行金额")
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // fTypeid 1确认 2撤销
|
|
|
+ let data = {
|
|
|
+ fId: this.$refs.avatar.form.fId,
|
|
|
+ fTypeid: 1
|
|
|
+ }
|
|
|
+ isAllocation(data).then(res => {
|
|
|
+ this.$message({
|
|
|
+ message: '调拨成功',
|
|
|
+ type: 'success',
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '撤销调拨':
|
|
|
+ let data2 = {
|
|
|
+ fId: this.$refs.avatar.form.fId,
|
|
|
+ fTypeid: 2
|
|
|
+ }
|
|
|
+ isAllocation(data2).then(res => {
|
|
|
+ this.$message({
|
|
|
+ message: '撤销成功',
|
|
|
+ type: 'success',
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '生成入库单':
|
|
|
+ let listData = {
|
|
|
+ fId:this.$refs.avatar.form.fId,
|
|
|
+ fBilltype:'RK'
|
|
|
+ }
|
|
|
+ copyNew(listData).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ message: '生成成功',
|
|
|
+ type: 'success',
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '生成销售单':
|
|
|
+ let liste = {
|
|
|
+ fId:this.$refs.avatar.form.fId,
|
|
|
+ fBilltype:'XS'
|
|
|
+ }
|
|
|
+ copyNew(liste).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ message: '生成成功',
|
|
|
+ type: 'success',
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '生成出库单':
|
|
|
+ let listd = {
|
|
|
+ fId:this.$refs.avatar.form.fId,
|
|
|
+ fBilltype:'CK'
|
|
|
+ }
|
|
|
+ copyNew(listd).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ message: '生成成功',
|
|
|
+ type: 'success',
|
|
|
+ showClose:true
|
|
|
+ });
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '复制新单':
|
|
|
+ if (row.nameTwo === '详情页'){
|
|
|
+ this.$refs.avatar.submitForm('submit',3)
|
|
|
+ }else {
|
|
|
+ if (this.selection.length > 0){
|
|
|
+ let scope = {
|
|
|
+ row:{
|
|
|
+ fId:this.selection[0].fId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.query(this.formDataList)
|
|
|
+ this.viewMethod(scope,'',1)
|
|
|
+ }else {
|
|
|
+ this.$message.warning('未选择列表,请选择后再点击');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '撤销审批':
|
|
|
+ let date = new Date()
|
|
|
+ let y = date.getFullYear()
|
|
|
+ let m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
|
|
|
+ let d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
|
|
|
+ data = {
|
|
|
+ actId:520,
|
|
|
+ id:this.$refs.avatar.form.fId,
|
|
|
+ billId:this.$refs.avatar.form.fId,
|
|
|
+ auditItem:y + '-' + m + '-' + d
|
|
|
+ }
|
|
|
+ console.log(data)
|
|
|
+ revoke(data).then(res=>{
|
|
|
+ if (res.code === 200){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '撤销成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '撤销采购':
|
|
|
+ withdrawBy(this.$refs.avatar.form.fId).then(res=>{
|
|
|
+ if (res.code === 200){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '撤销成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ this.$message.error('该按钮暂无功能')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //更换仓库
|
|
|
+ changeWarehouse(inOrOut) {
|
|
|
+ if (inOrOut == 1) {
|
|
|
+ this.contentList.forEach(item => {
|
|
|
+ item.fWarehouseid = ''
|
|
|
+ })
|
|
|
+ this.listData.fWarehouseid = []
|
|
|
+ getArea(this.formIn.fWarehouseid).then(res => {
|
|
|
+ this.listData.fWarehouseid = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fWarehouseid.push({
|
|
|
+ label: res.data[item].fWarehouseInformation,
|
|
|
+ value: res.data[item].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // if (this.formIn.length != 0) {
|
|
|
+ // for (let li in this.dataList) {
|
|
|
+ // this.dataList[li].fWarehouseid = ''
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ this.contentList.forEach(item => {
|
|
|
+ item.fAllotWarehouseid = ''
|
|
|
+ })
|
|
|
+ this.listData.fAllotWarehouseid = []
|
|
|
+ getArea(this.formOut.fAllotWarehouseid).then(res => {
|
|
|
+ this.listData.fAllotWarehouseid = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fAllotWarehouseid.push({
|
|
|
+ label: res.data[item].fWarehouseInformation,
|
|
|
+ value: res.data[item].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // if (this.formOut.length != 0) {
|
|
|
+ // for (let li in this.dataList) {
|
|
|
+ // this.dataList[li].fAllotWarehouseid = null
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 显示搜索条件、点击后会调用此方法
|
|
|
+ showSearch() {
|
|
|
+ console.log('到我了')
|
|
|
+ this.searchWhether = !this.searchWhether
|
|
|
+ },
|
|
|
+ //搜索、重置、展开
|
|
|
+ feedback(res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res == '展开') {
|
|
|
+ if (this.inDex == 4) {
|
|
|
+ this.inDex = this.formOption.length
|
|
|
+ } else {
|
|
|
+ this.inDex = 4
|
|
|
+ }
|
|
|
+ } else if (res == '搜索') {
|
|
|
+ this.$refs.avatar.submitForm()
|
|
|
+ } else if (res == '重置') {
|
|
|
+ this.formDataList = {
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:10,
|
|
|
+ timeInterval:null
|
|
|
+ }
|
|
|
+ this.$refs.avatar.assignmentTime(this.formDataList)
|
|
|
+ this.$refs.avatar.submitForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //点击刷新会调用此方法
|
|
|
+ getList() {
|
|
|
+ this.feedback('重置')
|
|
|
+ this.submitForm()
|
|
|
+ },
|
|
|
+ //查询主页列数据
|
|
|
+ query(data) {
|
|
|
+ console.log(data)
|
|
|
+ allocationListQuery(data).then(res => {
|
|
|
+ console.log('11111')
|
|
|
+ this.tableData = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ backToList(){
|
|
|
+ let data
|
|
|
+ if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3 && !this.$route.query.data) {
|
|
|
+ data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ // this.pageDisplay = true
|
|
|
+ this.query(this.formDataList)
|
|
|
+ } else if(this.$route.query.data){
|
|
|
+ this.cancelTwo();
|
|
|
+ // this.$router.push({path:'/index'})
|
|
|
+ }else {
|
|
|
+ this.$confirm('当前数据是否保存?', '提示', {
|
|
|
+ confirmButtonText: '保存',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.submitAndSave(2,1)
|
|
|
+ }).catch(() => {
|
|
|
+ data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询列数据
|
|
|
+ getRow(data,list,add,i) {
|
|
|
+ // console.log(data,list,add)
|
|
|
+ select(data).then((res) => {
|
|
|
+ this.$refs.avatar.form = {}
|
|
|
+ if (data.tableName === '仓库调拨详情') {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ this.purchaseList.columnList = res.data.filter((e) => e.checked == 0)
|
|
|
+ this.purchaseList.columnList = res.data
|
|
|
+ this.setRowList = res.data
|
|
|
+ this.purchaseList.columnList = this.purchaseList.columnList.filter((e) => e.checked == 0)
|
|
|
+ // this.waitFor = true
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$set(this.purchaseList,'columnList',this.$options.data().contentStyle)
|
|
|
+ this.setRowList = this.$options.data().contentStyle
|
|
|
+ }
|
|
|
+ if(add){
|
|
|
+ this.listData.fWarehouseid = []
|
|
|
+ this.listData.fAllotWarehouseid = []
|
|
|
+ this.formIn = {
|
|
|
+ fGoodsid: null,
|
|
|
+ fWarehouseid: null,
|
|
|
+ }
|
|
|
+ this.formOut = {
|
|
|
+ fProject: null,
|
|
|
+ fAllotWarehouseid: null,
|
|
|
+ }
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = false)
|
|
|
+ }else{
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = true)
|
|
|
+ }
|
|
|
+ this.pageDisplay = false
|
|
|
+ this.isItHidden = false
|
|
|
+ this.inDex = this.contentOption.length
|
|
|
+ } else {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ this.queryList.columnList = res.data.filter((e) => e.checked == 0)
|
|
|
+ this.queryList.columnList = res.data
|
|
|
+ this.setRowList = res.data
|
|
|
+ this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
|
|
|
+ // this.waitFor = true
|
|
|
+ } else {
|
|
|
+ this.$set(this.queryList,'columnList',this.$options.data().listStyle)
|
|
|
+ this.setRowList = this.$options.data().listStyle
|
|
|
+ }
|
|
|
+ this.pageDisplay = true
|
|
|
+ this.isItHidden = true
|
|
|
+ this.inDex = 4
|
|
|
+ // let y = moment(Date.parse(new Date())).format('YYYY-MM-DD')
|
|
|
+ // if (this.formDataList.timeInterval === undefined){
|
|
|
+ // this.$set(this.formDataList,'timeInterval',[ y + ' 00:00:00', y + ' 23:59:59'])
|
|
|
+ // }else {
|
|
|
+ // this.$set(this.formDataList,'timeInterval',this.formDataList.timeInterval)
|
|
|
+ // }
|
|
|
+ this.$refs.avatar.assignmentTime(this.formDataList)
|
|
|
+ }
|
|
|
+ if (list){
|
|
|
+ this.$refs.avatar.form = list.warehouseBills
|
|
|
+ this.formIn.fGoodsid = list.warehouseBills.fGoodsid
|
|
|
+ this.formIn.fWarehouseid = list.warehouseBills.fWarehouseid
|
|
|
+ this.formOut.fProject = list.warehouseBills.fProject
|
|
|
+ this.formOut.fAllotWarehouseid = list.warehouseBills.fAllotWarehouseid
|
|
|
+ this.contentList = list.tWarehousebillsfees
|
|
|
+ this.contentButton = this.$options.data().contentButton
|
|
|
+ console.log(this.$route.query.list)
|
|
|
+ getArea(this.formOut.fAllotWarehouseid).then(res => {
|
|
|
+ this.listData.fAllotWarehouseid = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fAllotWarehouseid.push({
|
|
|
+ label: res.data[item].fWarehouseInformation,
|
|
|
+ value: res.data[item].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getArea(this.formIn.fWarehouseid).then(res => {
|
|
|
+ this.listData.fWarehouseid = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.listData.fWarehouseid.push({
|
|
|
+ label: res.data[item].fWarehouseInformation,
|
|
|
+ value: res.data[item].id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // if (this.pendingPage.name) {
|
|
|
+ // this.contentButton.push(JSON.parse(this.$route.query.list))
|
|
|
+ // if (JSON.parse(this.$route.query.list)) this.$router.push({ query: {} })
|
|
|
+ // }
|
|
|
+ let data = {
|
|
|
+ actId: 520,
|
|
|
+ id: this.$refs.avatar.form.fId
|
|
|
+ }
|
|
|
+ getName(data).then(response => {
|
|
|
+ this.getStockNumPrice();
|
|
|
+ console.log(response)
|
|
|
+ if (response.data.length != 0) {
|
|
|
+ this.before = response.data[0].userName
|
|
|
+ if (this.$refs.avatar.form.fBillstatus === 6 && this.before == this.lander) {
|
|
|
+ // this.contentButton.forEach(item =>{
|
|
|
+ // if (item.name === '审批'){
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ this.contentButton.push({
|
|
|
+ type: 'danger',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '撤销采购',
|
|
|
+ disabled: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let operator = this.$refs.avatar.form.createBy
|
|
|
+ if(this.$refs.avatar.form.fBillstatus === 4 && this.lander === operator){
|
|
|
+ this.contentButton.push({
|
|
|
+ type: 'danger',
|
|
|
+ size: 'mini',
|
|
|
+ icon: 'el-icon-edit-outline',
|
|
|
+ name: '撤销审批',
|
|
|
+ disabled: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.contentButton.forEach(item =>{
|
|
|
+ if(this.$refs.avatar.form.fBillstatus < 4){
|
|
|
+ if (item.name == '录入明细' || item.name == '保存'){
|
|
|
+ item.disabled = true
|
|
|
+ }else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (item.name == '录入明细' || item.name == '保存' || item.name == '调拨确认' || item.name == '修改'){
|
|
|
+ item.disabled = true
|
|
|
+ }else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.$refs.avatar.form.fBillstatus != 6) {
|
|
|
+ if (item.name == '撤销调拨') {
|
|
|
+ item.disabled = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (i == 1) this.submitAnd()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //请核
|
|
|
+ writeOff(){
|
|
|
+ let formData = new window.FormData()
|
|
|
+ formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
|
|
|
+ formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
|
|
|
+ formData.append('fBilltype', 'SQ')
|
|
|
+ pleaseCheck(formData).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('请核成功')
|
|
|
+ this.contentOption.forEach(item => item.disabled = true)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = true)
|
|
|
+ this.contentButton.forEach(item =>{
|
|
|
+ if (item.name == '返回列表' || item.name == '修改'){
|
|
|
+ item.disabled = false
|
|
|
+ }else {
|
|
|
+ item.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.$refs.avatar.form = res.data.warehouseBills
|
|
|
+ // this.contentList = res.data.tWarehousebillsCntrs
|
|
|
+ let data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //详情内容保存
|
|
|
+ submitAndSave(item,res) {
|
|
|
+ let pass = false;
|
|
|
+ this.contentList.forEach(item => {
|
|
|
+ if (item.fGrossweightblc === 0) {
|
|
|
+ pass = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (pass) {
|
|
|
+ this.$message.error('当前库存数量为0,请修改调拨信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.$refs.avatar.form.fBillstatus <= 4 || !this.$refs.avatar.form.fBillstatus) {
|
|
|
+ let formData = new window.FormData()
|
|
|
+ this.$refs.avatar.form.fMoney = 0
|
|
|
+ this.contentList.forEach(item => this.$refs.avatar.form.fMoney += Number(item.fAmount))
|
|
|
+ // formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
|
|
|
+ formData.append('tWarehousebills', JSON.stringify(Object.assign({},this.$refs.avatar.form, this.formOut, this.formIn)))
|
|
|
+ formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
|
|
|
+ // formData.append('tWarehousebillsfees', JSON.stringify(listForm))
|
|
|
+ formData.append('fBilltype', 'DB')
|
|
|
+ console.log(formData)
|
|
|
+ if (item === 3){
|
|
|
+ this.$refs.avatar.form.fId = ''
|
|
|
+ this.$refs.avatar.form.fBillno = ''
|
|
|
+ this.$refs.avatar.form.fCreateLog = ''
|
|
|
+ this.$refs.avatar.form.fPrintLog = ''
|
|
|
+ this.$refs.avatar.form.fBillstatus = 2
|
|
|
+ this.$refs.avatar.form.fPrint = 0
|
|
|
+ this.contentList.forEach(item=>item.fId = '')
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = false)
|
|
|
+ this.contentButton.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ }else {
|
|
|
+ submit(formData).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if(res){
|
|
|
+ this.$refs.avatar.form = res.data.warehouseBills
|
|
|
+ }
|
|
|
+ this.contentList = res.data.tWarehousebillsCntrs
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item == 1){
|
|
|
+ this.dialogVisible = true
|
|
|
+ }else if (item === 2){
|
|
|
+ let data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ this.getRow(data)
|
|
|
+ this.query(this.formDataList)
|
|
|
+ }
|
|
|
+ if (item === 3 && this.$refs.avatar.form.fBillstatus > 3){
|
|
|
+ this.$refs.avatar.form.fId = ''
|
|
|
+ this.$refs.avatar.form.fBillno = ''
|
|
|
+ this.$refs.avatar.form.fCreateLog = ''
|
|
|
+ this.$refs.avatar.form.fReviewDate = ''
|
|
|
+ this.$refs.avatar.form.fReviewDate = ''
|
|
|
+ this.$refs.avatar.form.fPrintLog = ''
|
|
|
+ this.$refs.avatar.form.fBillstatus = 2
|
|
|
+ this.$refs.avatar.form.fPrint = 0
|
|
|
+ this.contentList.forEach(item=>item.fId = '')
|
|
|
+ this.contentOption.forEach(item => {
|
|
|
+ if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
|
|
|
+ item.disabled = true
|
|
|
+ } else {
|
|
|
+ item.disabled = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.purchaseList.columnList.forEach(item => item.disabled = false)
|
|
|
+ this.contentButton.forEach(item => item.disabled = false)
|
|
|
+ this.contentStyle.forEach(item => item.disabled = false)
|
|
|
+ // let datae = {
|
|
|
+ // fId:this.$refs.avatar.form.fId,
|
|
|
+ // fBilltype:'SQ'
|
|
|
+ // }
|
|
|
+ // copyNew(datae).then(res=> {
|
|
|
+ // this.$message({
|
|
|
+ // message: '复制新单成功',
|
|
|
+ // type: 'success',
|
|
|
+ // showClose: true
|
|
|
+ // });
|
|
|
+ // let scope = {
|
|
|
+ // row: {
|
|
|
+ // fId: res.data
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.query(this.formDataList)
|
|
|
+ // this.viewMethod(scope,res)
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //表单选中后触发
|
|
|
+ selectTrigger(name, list, id) {
|
|
|
+ console.log(list, id)
|
|
|
+ if (name == 'fGoodsid') {
|
|
|
+ for (let item in list) {
|
|
|
+ if (list[item].value == id) {
|
|
|
+ this.$refs.avatar.form.personNaem = list[item].personNaem
|
|
|
+ this.$refs.avatar.form.corpsName = list[item].corpsName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //详情表内容移出
|
|
|
+ deletRows(index, rows) {
|
|
|
+ console.log(index, rows)
|
|
|
+ if (rows[index].fId) {
|
|
|
+ deleteQuery(this.$refs.avatar.form.fId, this.$refs.avatar.form.fDateChanged).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ listDelete(rows[index].fId).then(data => {
|
|
|
+ rows.splice(index, 1)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ rows.splice(index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //计算金额
|
|
|
+ totalAmount(scope,item) {
|
|
|
+ if (item.label === 'fAmount'){
|
|
|
+ if (scope.row.fAmount && scope.row.fQty) {
|
|
|
+ this.$set(scope.row,'fUnitprice',(scope.row.fAmount / scope.row.fQty).toFixed(2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.label === 'fUnitprice'||item.label === 'fQty'){
|
|
|
+ if (scope.row.fUnitprice && scope.row.fQty) {
|
|
|
+ this.$set(scope.row,'fAmount',(scope.row.fUnitprice * scope.row.fQty).toFixed(2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ change(scope){
|
|
|
+ console.log(this.contentList)
|
|
|
+ for(let item in this.contentList){
|
|
|
+ for(let li in this.listData.fFeeid){
|
|
|
+ if(this.contentList[item].fFeeid == this.listData.fFeeid[li].value){
|
|
|
+ // console.log("111")
|
|
|
+ this.$set(this.contentList[item],'fFeeunitid',this.listData.fFeeid[li].fFeeunitid)
|
|
|
+ this.$set(this.contentList[item],'fCurrencyName',this.listData.fFeeid[li].fCurrency)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (scope.row.fFeeid === '' || scope.row.fFeeunitid === '' || scope.row.fWarehouseid === '' || scope.row.fCorpid === '') {
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ const data = {
|
|
|
+ fGoodsid: scope.row.fFeeid,
|
|
|
+ fBillingway: scope.row.fFeeunitid,
|
|
|
+ fWarehouseLocationid: scope.row.fWarehouseid,
|
|
|
+ fCorpid: scope.row.fCorpid,
|
|
|
+ }
|
|
|
+ getStockNumPrice(data).then(res => {
|
|
|
+ scope.row.fGrossweightblc = res.data.fGrossweightblc
|
|
|
+ scope.row.fVolumnblc = res.data.fVolumnblc
|
|
|
+ }).catch(e => {
|
|
|
+ scope.row.fGrossweightblc = 0
|
|
|
+ scope.row.fVolumnblc = 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 品名、计量单位、调出库区和供应商变化获得库存数量和库存单价
|
|
|
+ getStockNumPrice() {
|
|
|
+ this.contentList.forEach((item, index) => {
|
|
|
+ if (item.fFeeid === '' || item.fFeeunitid === '' || item.fWarehouseid === '' || item.fCorpid === '') {
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ const data = {
|
|
|
+ fGoodsid: item.fFeeid,
|
|
|
+ fBillingway: item.fFeeunitid,
|
|
|
+ fWarehouseLocationid: item.fWarehouseid,
|
|
|
+ fCorpid: item.fCorpid,
|
|
|
+ }
|
|
|
+ getStockNumPrice(data).then(res => {
|
|
|
+ item.fGrossweightblc = res.data.fGrossweightblc
|
|
|
+ item.fVolumnblc = res.data.fVolumnblc
|
|
|
+ }).catch(e => {
|
|
|
+ item.fGrossweightblc = 0
|
|
|
+ item.fVolumnblc = 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.detail-title {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+</style>
|