|
|
|
<template>
|
|
|
|
<basic-container>
|
|
|
|
<!-- <div class="avue-crud">
|
|
|
|
<el-row :hidden="!search" style="padding:6px 18px">
|
|
|
|
<!– 查询模块 –>
|
|
|
|
<el-form :inline="true" :model="query">
|
|
|
|
<el-form-item label="提货证件:">
|
|
|
|
<el-input v-model="query.deliveryDocument" placeholder="请输入提货证件"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="证件类型:">
|
|
|
|
<el-input v-model="query.certificateType" placeholder="请输入证件类型"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
<!– 查询按钮 –>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchChange">搜 索</el-button>
|
|
|
|
<el-button icon="el-icon-delete" @click="searchReset()">清 空</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<div class="avue-crud__header">
|
|
|
|
<!– 头部左侧按钮模块 –>
|
|
|
|
<div class="avue-crud__left">
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新 增</el-button>
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain>删 除</el-button>
|
|
|
|
</div>
|
|
|
|
<!– 头部右侧按钮模块 –>
|
|
|
|
<div class="avue-crud__right">
|
|
|
|
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<!– 列表模块 –>
|
|
|
|
<el-table ref="table" v-loading="loading"
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
:data="data"
|
|
|
|
:height="height"
|
|
|
|
style="width: 100%"
|
|
|
|
:border="option.border">
|
|
|
|
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
|
|
|
|
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
|
|
|
|
<el-table-column v-if="option.index" label="#" type="index" width="50" align="center">
|
|
|
|
</el-table-column>
|
|
|
|
<template v-for="(item,index) in option.column">
|
|
|
|
<!– table字段 –>
|
|
|
|
<el-table-column v-if="item.hide!==true"
|
|
|
|
:prop="item.prop"
|
|
|
|
:label="item.label"
|
|
|
|
:width="item.width"
|
|
|
|
:key="index">
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
<!– 操作栏模块 –>
|
|
|
|
<el-table-column prop="menu" label="操作" :width="220" align="center">
|
|
|
|
<template #="{row}">
|
|
|
|
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
|
|
|
|
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
|
|
|
|
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<div class="avue-crud__pagination" style="width:100%">
|
|
|
|
<!– 分页模块 –>
|
|
|
|
<el-pagination align="right"
|
|
|
|
background
|
|
|
|
@size-change="sizeChange"
|
|
|
|
@current-change="currentChange"
|
|
|
|
:current-page="page.currentPage"
|
|
|
|
:page-sizes="[10, 20, 30, 40, 50, 100]"
|
|
|
|
:page-size="page.pageSize"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:total="page.total">
|
|
|
|
</el-pagination>
|
|
|
|
</div>
|
|
|
|
</el-row>
|
|
|
|
<!– 表单模块 –>
|
|
|
|
<el-dialog :title="title"
|
|
|
|
v-model="box"
|
|
|
|
width="50%"
|
|
|
|
:before-close="beforeClose"
|
|
|
|
append-to-body>
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="80px">
|
|
|
|
<!– 表单字段 –>
|
|
|
|
<el-form-item label="提货时间" prop="pickUpTime">
|
|
|
|
<el-input v-model="form.pickUpTime" placeholder="请输入提货时间"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="提货人" prop="consignee">
|
|
|
|
<el-input v-model="form.consignee" placeholder="请输入提货人"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="提货车牌" prop="pickUpPlate">
|
|
|
|
<el-input v-model="form.pickUpPlate" placeholder="请输入提货车牌"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="提货证件" prop="deliveryDocument">
|
|
|
|
<el-input v-model="form.deliveryDocument" placeholder="请输入提货证件"/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="证件类型" prop="certificateType">
|
|
|
|
<el-select v-model="form.certificateType" clearable placeholder="请选择证件类型">
|
|
|
|
<el-option
|
|
|
|
v-for="item in certificateTypeData"
|
|
|
|
:key="item.dictKey"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey">
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="费用合计" prop="totalCost">
|
|
|
|
<el-input v-model="form.totalCost" placeholder="请输入费用合计"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
<!– 表单按钮 –>
|
|
|
|
<template #footer>
|
|
|
|
<span v-if="!view" class="dialog-footer">
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit">提 交</el-button>
|
|
|
|
<el-button icon="el-icon-circle-close" @click="box = false">取 消</el-button>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</el-dialog>
|
|
|
|
</div>-->
|
|
|
|
<div class="avue-crud" :style="`height:`+ height+';overflow:auto;' " >
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="80px">
|
|
|
|
<!-- 表单字段 -->
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="提货时间" prop="pickUpTime">
|
|
|
|
<!-- <el-input v-model="form.pickUpTime" placeholder="请输入提货时间"/>-->
|
|
|
|
<el-date-picker style="width: 100%"
|
|
|
|
v-model="form.pickUpTime"
|
|
|
|
type="datetime"
|
|
|
|
placeholder="请输入提货时间"
|
|
|
|
format="YYYY-MM-DD hh:mm:ss"
|
|
|
|
value-format="YYYY-MM-DD hh:mm:ss"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="提货人" prop="consignee">
|
|
|
|
<el-input v-model="form.consignee" placeholder="请输入提货人"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="提货车牌号码" prop="pickUpPlate" label-width="98px">
|
|
|
|
<el-input v-model="form.pickUpPlate" placeholder="请输入提货车牌"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="提货证件号码" prop="deliveryDocument" label-width="120px">
|
|
|
|
<el-input v-model="form.deliveryDocument" placeholder="请输入提货证件"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="证件类型" prop="certificateType">
|
|
|
|
<el-select v-model="form.certificateType" clearable placeholder="请选择证件类型" style="width: 100%">
|
|
|
|
<el-option
|
|
|
|
v-for="item in certificateType"
|
|
|
|
:key="item.dictKey"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey">
|
|
|
|
</el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="费用" prop="certificateType">
|
|
|
|
<el-checkbox-group v-model="form.freightMark" @change="handleCheckedCitiesChange">
|
|
|
|
<el-checkbox style="width: 16%;margin-bottom: 3%"
|
|
|
|
v-for="(item,index) in clientType"
|
|
|
|
:key="item.dictKey"
|
|
|
|
:label="item.dictKey"
|
|
|
|
>{{item.dictValue}}
|
|
|
|
<el-input type="number" v-model="item.remark" placeholder="请输入费用" :disabled = "this.form?.freightMark?.indexOf(item.dictKey) == -1"
|
|
|
|
@change="textbox($event,index)" style="width: 70%"/>
|
|
|
|
</el-checkbox>
|
|
|
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="费用合计" prop="totalCost">
|
|
|
|
<el-input v-model="form.totalCost" placeholder="请输入费用合计"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item label="物品明细" prop="certificateType">
|
|
|
|
<el-tabs type="border-card" style="width: 100%">
|
|
|
|
<el-tab-pane label="定制品">
|
|
|
|
<el-table ref="table" v-loading="loading"
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
:data="dataList"
|
|
|
|
style="width: 100%"
|
|
|
|
:border="option.border">
|
|
|
|
|
|
|
|
<template v-for="(item,index) in option.columnList">
|
|
|
|
<!-- table字段 -->
|
|
|
|
<el-table-column v-if="item.hide!==true"
|
|
|
|
:prop="item.prop"
|
|
|
|
:label="item.label"
|
|
|
|
:width="item.width"
|
|
|
|
:key="index">
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
<!-- 操作栏模块 -->
|
|
|
|
<!-- <el-table-column prop="menu" label="操作" :width="220" align="center">-->
|
|
|
|
<!-- <template #="{row}">-->
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>-->
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>-->
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
</el-table>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="标准品">
|
|
|
|
<el-button type="primary" text icon="el-icon-view" @click="handleAddView(row)">新增</el-button>
|
|
|
|
<el-table ref="table" v-loading="loading"
|
|
|
|
@selection-change="selectionChange"
|
|
|
|
:data="data"
|
|
|
|
style="width: 100%"
|
|
|
|
:border="option.border">
|
|
|
|
<!-- <el-table-column type="selection" v-if="option.selection" width="50" align="center"></el-table-column>-->
|
|
|
|
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
|
|
|
|
<el-table-column v-if="option.index" label="序号" type="index" width="70" align="center">
|
|
|
|
</el-table-column>
|
|
|
|
<template v-for="(item,index) in option.columnStock">
|
|
|
|
<!-- table字段 -->
|
|
|
|
<el-table-column v-if="item.hide!==true"
|
|
|
|
:prop="item.prop"
|
|
|
|
:label="item.label"
|
|
|
|
:width="item.width"
|
|
|
|
:key="index">
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
<!-- 操作栏模块 -->
|
|
|
|
<el-table-column prop="menu" label="添加数量" :width="220" align="center">
|
|
|
|
<template #="{row}">
|
|
|
|
<el-input v-model="row.inventoryQuantity" @blur="handleNumberRange($event,row)" ></el-input>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<!-- 操作栏模块 -->
|
|
|
|
<el-table-column prop="menu" label="操作" :width="220" align="center">
|
|
|
|
<template #="{row}">
|
|
|
|
<el-button type="primary" text icon="el-icon-delete" @click="rowStock(row)">移除</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="提货证件" prop="totalCost" label-width ='120px'>
|
|
|
|
<el-upload
|
|
|
|
v-model:file-list="fileListSell"
|
|
|
|
class="upload-demo"
|
|
|
|
:action="action"
|
|
|
|
:headers="headers"
|
|
|
|
multiple
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
:on-success="(response, file, fileList) => {uploadSuccess(fileListSell)}"
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
list-type="picture"
|
|
|
|
>
|
|
|
|
<el-button type="primary">上传</el-button>
|
|
|
|
<template #tip>
|
|
|
|
<div class="el-upload__tip">
|
|
|
|
只能上传jpg/png文件,且不超过500kb
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</el-upload>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="文员确定图片" prop="totalCost" label-width ='120px'>
|
|
|
|
<el-upload
|
|
|
|
v-model:file-list="fileListClerk"
|
|
|
|
class="upload-demo"
|
|
|
|
:action="action"
|
|
|
|
:headers="headers"
|
|
|
|
multiple
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
:on-success="(response, file, fileList) => {uploadSuccess(fileListClerk)}"
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
list-type="picture"
|
|
|
|
>
|
|
|
|
<el-button type="primary">上传</el-button>
|
|
|
|
<template #tip>
|
|
|
|
<div class="el-upload__tip">
|
|
|
|
只能上传jpg/png文件,且不超过500kb
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</el-upload>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item label="库管签收图片" prop="totalCost" label-width ='120px'>
|
|
|
|
<el-upload
|
|
|
|
v-model:file-list="fileListLibrary"
|
|
|
|
class="upload-demo"
|
|
|
|
:action="action"
|
|
|
|
:headers="headers"
|
|
|
|
multiple
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
:on-success="(response, file, fileList) => {uploadSuccess(fileListLibrary)}"
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
list-type="picture"
|
|
|
|
>
|
|
|
|
<el-button type="primary">上传</el-button>
|
|
|
|
<template #tip>
|
|
|
|
<div class="el-upload__tip">
|
|
|
|
只能上传jpg/png文件,且不超过500kb
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</el-upload>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
<!-- 表单按钮 -->
|
|
|
|
<div class="foot" v-if="!view" >
|
|
|
|
<div class="dialog-footer" >
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit('form')">提 交</el-button>
|
|
|
|
<!-- <el-button icon="el-icon-circle-close" @click="box = false">取 消</el-button>-->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-dialog v-model="dialogFormVisible" title="添加标准品" style="width: 80% ">
|
|
|
|
<el-table ref="table" v-loading="loading"
|
|
|
|
@selection-change="selectionChangeStock"
|
|
|
|
:data="dataOwn"
|
|
|
|
style="width: 100%"
|
|
|
|
:border="option.border">
|
|
|
|
<el-table-column type="selection" v-if="option.selection" width="50" align="center"></el-table-column>
|
|
|
|
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
|
|
|
|
<el-table-column v-if="option.index" label="序号" type="index" width="70" align="center">
|
|
|
|
</el-table-column>
|
|
|
|
<template v-for="(item,index) in option.columnStock">
|
|
|
|
<!-- table字段 -->
|
|
|
|
<el-table-column v-if="item.hide!==true"
|
|
|
|
:prop="item.prop"
|
|
|
|
:label="item.label"
|
|
|
|
:width="item.width"
|
|
|
|
:key="index">
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
</el-table>
|
|
|
|
<div class="avue-crud__pagination" style="width:100%">
|
|
|
|
<!-- 分页模块 -->
|
|
|
|
<el-pagination align="right"
|
|
|
|
background
|
|
|
|
@size-change="sizeChangeStock"
|
|
|
|
@current-change="currentChangeStock"
|
|
|
|
:current-page="pageStock.currentPage"
|
|
|
|
:page-sizes="[10, 20, 30, 40, 50, 100]"
|
|
|
|
:page-size="pageStock.pageSize"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:total="pageStock.total">
|
|
|
|
</el-pagination>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
<span class="dialog-footer">
|
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
|
<!-- <el-button type="primary" @click="dialogFormVisible = false"> 确定 </el-button>-->
|
|
|
|
<el-button type="primary" @click="callFordelivery('1')"> 确定 </el-button>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
</basic-container>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getList, getDetail, add, update, remove } from "@/api/distribution/distrilbutionBillLading";
|
|
|
|
import { getListOwn } from "@/api/distribution/distributionParcelList";
|
|
|
|
import option from "@/option/distribution/distrilbutionBillLading";
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict';
|
|
|
|
import { getToken } from '@/utils/auth';
|
|
|
|
import { getListStockList } from '@/api/distribution/distributionStockList';
|
|
|
|
import { getListOne} from "@/api/distribution/distributionStockArticle";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
dialogFormVisible: false,
|
|
|
|
height: 0,
|
|
|
|
// 弹框标题
|
|
|
|
title: '',
|
|
|
|
// 是否展示弹框
|
|
|
|
box: false,
|
|
|
|
// 是否显示查询
|
|
|
|
search: true,
|
|
|
|
// 加载中
|
|
|
|
loading: true,
|
|
|
|
// 是否为查看模式
|
|
|
|
view: false,
|
|
|
|
// 查询信息
|
|
|
|
query: {},
|
|
|
|
// 分页信息
|
|
|
|
page: {
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
total: 40
|
|
|
|
},
|
|
|
|
// 分页信息
|
|
|
|
pageStock: {
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
total: 40
|
|
|
|
},
|
|
|
|
// 表单数据
|
|
|
|
form: {},
|
|
|
|
// 选择行
|
|
|
|
selectionList: [],
|
|
|
|
selectionListStock: [],// 库存品选择
|
|
|
|
// 表单配置
|
|
|
|
option: option,
|
|
|
|
// 表单列表
|
|
|
|
data: [],
|
|
|
|
dataList: [],
|
|
|
|
dataOwn: [],
|
|
|
|
clientType: [],
|
|
|
|
costList: [],
|
|
|
|
costListName: [],
|
|
|
|
certificateType: [],
|
|
|
|
fileListLibrary: [],
|
|
|
|
fileListSell: [],
|
|
|
|
fileListClerk: [],
|
|
|
|
fileList:[
|
|
|
|
// {
|
|
|
|
// name: 'food.jpeg',
|
|
|
|
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: 'food2.jpeg',
|
|
|
|
// url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
|
|
|
|
// },
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted () {
|
|
|
|
this.init();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
watch:{
|
|
|
|
'$route.query.id':{
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
// console.log(newVal, oldVal);
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.onLoadOwn(this.page);
|
|
|
|
},
|
|
|
|
deep: true,
|
|
|
|
immediate: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters(["permission",'tagWel','tagList']),
|
|
|
|
ids () {
|
|
|
|
let ids = [];
|
|
|
|
this.selectionList.forEach(ele => {
|
|
|
|
ids.push(ele.id);
|
|
|
|
});
|
|
|
|
return ids.join(",");
|
|
|
|
},
|
|
|
|
stockIds () {
|
|
|
|
let ids = [];
|
|
|
|
this.selectionListStock.forEach(ele => {
|
|
|
|
ids.push(ele.id);
|
|
|
|
});
|
|
|
|
return ids.join(",");
|
|
|
|
},
|
|
|
|
headers() {
|
|
|
|
return {
|
|
|
|
"Blade-Auth":'Bearer ' + getToken()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
action() {
|
|
|
|
return '/api/logpm-basicdata/common/uploadFile'
|
|
|
|
// return '/api/blade-resource/oss/endpoint/put-file-attach'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
//移除数据
|
|
|
|
rowStock (row) {
|
|
|
|
console.log(">>?>?><?",row);
|
|
|
|
this.data.forEach( i =>{
|
|
|
|
if(i.id === row.id){
|
|
|
|
this.data
|
|
|
|
}
|
|
|
|
})
|
|
|
|
let id1 = this.data.findIndex(item => {
|
|
|
|
if (item.id == row.id) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.data.splice(id1, 1)
|
|
|
|
|
|
|
|
},
|
|
|
|
//确定
|
|
|
|
callFordelivery(inde){
|
|
|
|
this.dialogFormVisible = false;
|
|
|
|
this.selectionListStock.some( i =>{
|
|
|
|
// console.log("asdgfasdv",i);
|
|
|
|
let a = this.data.filter((ele) => ele.id == i.id ).length >= 1
|
|
|
|
// console.log("asdgfasdv",a);
|
|
|
|
if(!a){
|
|
|
|
this.data.push(i);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
//数量校验
|
|
|
|
handleNumberRange(e,row) {
|
|
|
|
console.log("执行了2222",e,e.target.value,row);
|
|
|
|
if(e.target.value) {
|
|
|
|
e.target.value = e.target.value.replace(/[^\.\d]/g,'') //替换掉与数字无关的字符(中英文与符号都会被替换掉,只留下数字,此时值类型为字符串)
|
|
|
|
if(e.target.value) { //如果替换后还有值
|
|
|
|
e.target.value = parseInt(e.target.value); //把字符型转成整数型
|
|
|
|
}
|
|
|
|
if((e.target.value > row.quantityStock )) {
|
|
|
|
this.$message.error('数量不能大于订单数')
|
|
|
|
e.target.value = row.quantityStock;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
uploadSuccess(fileList) {
|
|
|
|
console.log('123123123', fileList);
|
|
|
|
// this.form.fileName =
|
|
|
|
// this.$set(row, 'imageCos', fileList);
|
|
|
|
},
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
console.log(file, fileList);
|
|
|
|
},
|
|
|
|
handlePreview(file) {
|
|
|
|
console.log(file);
|
|
|
|
},
|
|
|
|
textbox(e,index) {
|
|
|
|
console.log("e,index",e,index);
|
|
|
|
this.costList[index+1] = e;
|
|
|
|
},
|
|
|
|
handleCheckedCitiesChange(value) {
|
|
|
|
console.log(">>>>>>>",value );
|
|
|
|
if(value.length < 1){
|
|
|
|
this.costList = [];
|
|
|
|
this.costListName = [];
|
|
|
|
}
|
|
|
|
this.clientType.forEach(i =>{
|
|
|
|
if(value.includes(i.dictKey)){
|
|
|
|
console.log(i);
|
|
|
|
i.pitch = true;
|
|
|
|
this.costListName = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
init () {
|
|
|
|
this.height = this.setPx(document.body.clientHeight - 160);
|
|
|
|
//字典
|
|
|
|
getDictionaryBiz('delivery_cost').then(res => {
|
|
|
|
|
|
|
|
this.clientType = res.data.data;
|
|
|
|
}); //字典
|
|
|
|
getDictionaryBiz('certificate_type').then(res => {
|
|
|
|
this.certificateType = res.data.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
searchHide () {
|
|
|
|
this.search = !this.search;
|
|
|
|
},
|
|
|
|
searchChange () {
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
searchReset () {
|
|
|
|
this.query = {};
|
|
|
|
this.page.currentPage = 1;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
bianLier(costListName,clientType,costList,fei){
|
|
|
|
console.log(">>>>>>>>>",costListName,clientType,costList,fei);
|
|
|
|
this.pan = false;
|
|
|
|
for (let i = 0;i< costListName.length;i++){
|
|
|
|
if(!costList){ this.pan = true; return }
|
|
|
|
for(let a = 0;a < clientType.length;a++){
|
|
|
|
// console.log("进来了",clientType[a].dictKey , costListName[i]);
|
|
|
|
if(clientType[a].dictKey == costListName[i]){
|
|
|
|
console.log("进来了",clientType[a].dictKey , costListName[i]);
|
|
|
|
let zhi = costList[costListName[i]];
|
|
|
|
if(!zhi){
|
|
|
|
this.pan = true;
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
//2.添加
|
|
|
|
fei.set(clientType[a].dictKey,zhi);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async handleSubmit () {
|
|
|
|
if (!this.form.id) {
|
|
|
|
let fei = new Map();
|
|
|
|
await this.bianLier(this.costListName,this.clientType,this.costList,fei);
|
|
|
|
this.form.fei = Object.fromEntries(fei);
|
|
|
|
this.form.stockArticleId = this.$route.query.id;
|
|
|
|
this.form.stockDTOList = this.data;
|
|
|
|
let o = [];
|
|
|
|
if(this.fileListClerk.length > 0){
|
|
|
|
this.fileListClerk.forEach( i =>{
|
|
|
|
// console.log("iiii",i);
|
|
|
|
let num = {};
|
|
|
|
num.state = "2";
|
|
|
|
num.name = i.response.data.name;
|
|
|
|
num.url = i.response.data.link;
|
|
|
|
o.push(num);
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(this.fileListLibrary.length > 0){
|
|
|
|
this.fileListLibrary.forEach( i =>{
|
|
|
|
let num = {};
|
|
|
|
num.state = "3";
|
|
|
|
num.name = i.response.data.name;
|
|
|
|
num.url = i.response.data.link;
|
|
|
|
o.push(num);
|
|
|
|
});
|
|
|
|
|
|
|
|
}else if(this.fileListSell.length > 0){
|
|
|
|
this.fileListSell.forEach( i =>{
|
|
|
|
// console.log(",.,.,.,.",i);
|
|
|
|
let num = {};
|
|
|
|
num.state = "1";
|
|
|
|
num.name = i.response.data.name;
|
|
|
|
num.url = i.response.data.link;
|
|
|
|
o.push(num);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
this.form.printList = o.length > 0 ? o : [];
|
|
|
|
|
|
|
|
console.log("this.form",this.form);
|
|
|
|
add(this.form).then(() => {
|
|
|
|
this.box = false;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
this.contextmenuFlag = false;
|
|
|
|
this.$store.commit('DEL_TAG_CURRENT');
|
|
|
|
this.$router.push(this.tagWel);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
update(this.form).then(() => {
|
|
|
|
this.box = false;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
handleAdd () {
|
|
|
|
this.title = '新增'
|
|
|
|
this.form = {}
|
|
|
|
this.box = true
|
|
|
|
},
|
|
|
|
handleEdit (row) {
|
|
|
|
this.title = '编辑'
|
|
|
|
this.box = true
|
|
|
|
getDetail(row.id).then(res => {
|
|
|
|
this.form = res.data.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleView (row) {
|
|
|
|
this.title = '查看'
|
|
|
|
this.view = true;
|
|
|
|
this.box = true;
|
|
|
|
getDetail(row.id).then(res => {
|
|
|
|
this.form = res.data.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
handleAddView (row) {
|
|
|
|
this.dialogFormVisible = true;
|
|
|
|
this.onLoadList(this.pageStock);
|
|
|
|
},
|
|
|
|
handleDelete () {
|
|
|
|
if (this.selectionList.length === 0) {
|
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: "warning"
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
return remove(this.ids);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.selectionClear();
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
rowDel (row) {
|
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: "warning"
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
return remove(row.id);
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.onLoad(this.page);
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
message: "操作成功!"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
beforeClose (done) {
|
|
|
|
done()
|
|
|
|
this.form = {};
|
|
|
|
this.view = false;
|
|
|
|
},
|
|
|
|
selectionChange (list) {
|
|
|
|
this.selectionList = list;
|
|
|
|
},
|
|
|
|
selectionChangeStock (list) {
|
|
|
|
this.selectionListStock = list;
|
|
|
|
},
|
|
|
|
selectionClear () {
|
|
|
|
this.selectionList = [];
|
|
|
|
// this.$refs.table.clearSelection();
|
|
|
|
},
|
|
|
|
currentChangeStock (currentPage) {
|
|
|
|
this.pageStock.currentPage = currentPage;
|
|
|
|
this.onLoadList(this.pageStock);
|
|
|
|
},
|
|
|
|
sizeChangeStock (pageSize) {
|
|
|
|
this.pageStock.pageSize = pageSize;
|
|
|
|
this.onLoadList(this.pageStock);
|
|
|
|
},
|
|
|
|
currentChange (currentPage) {
|
|
|
|
this.page.currentPage = currentPage;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
sizeChange (pageSize) {
|
|
|
|
this.page.pageSize = pageSize;
|
|
|
|
this.onLoad(this.page);
|
|
|
|
},
|
|
|
|
|
|
|
|
onLoad (page, params = {}) {
|
|
|
|
this.loading = true;
|
|
|
|
params.id = this.$route.query.id;
|
|
|
|
getListOne(page.currentPage, page.pageSize, params).then(res => {
|
|
|
|
const data = res.data.data;
|
|
|
|
console.log(">>>>>>>>>===",data);
|
|
|
|
this.loading = false;
|
|
|
|
this.selectionClear();
|
|
|
|
});
|
|
|
|
} ,
|
|
|
|
//库存品
|
|
|
|
onLoadList (page, params = {}) {
|
|
|
|
this.loading = true;
|
|
|
|
getListStockList(page.currentPage, page.pageSize,params ).then(res => {
|
|
|
|
const dataOwn = res.data.data;
|
|
|
|
this.pageStock.total = dataOwn.total;
|
|
|
|
this.dataOwn = dataOwn.records;
|
|
|
|
this.loading = false;
|
|
|
|
this.selectionClear();
|
|
|
|
});
|
|
|
|
} ,
|
|
|
|
//包件信息
|
|
|
|
onLoadOwn (page, params = {}) {
|
|
|
|
this.loading = true;
|
|
|
|
this.query.stockArticleId = this.$route.query.id;
|
|
|
|
getListOwn(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
|
const dataList = res.data.data;
|
|
|
|
this.page.total = dataList.total;
|
|
|
|
this.dataList = dataList.records;
|
|
|
|
this.loading = false;
|
|
|
|
this.selectionClear();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style >
|
|
|
|
.foot {
|
|
|
|
position: fixed;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 999;
|
|
|
|
height: 60px;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
.foot .dialog-footer {
|
|
|
|
margin-bottom: 130px;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
.ca .el-radio__inner {
|
|
|
|
top: -18px;
|
|
|
|
left: -19px;
|
|
|
|
border-radius: 0;
|
|
|
|
border: 0;
|
|
|
|
width: 170px;
|
|
|
|
height: 34px;
|
|
|
|
background-color: transparent;
|
|
|
|
cursor: pointer;
|
|
|
|
box-sizing: border-box;
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ca .el-radio__input.is-checked .el-radio__inner {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
</style>
|