| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339 |
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button type="primary" size="small" :disabled="form.status>0" v-if="form.status < 1"
- class="el-button--small-yh " @click.stop="openEdit">编辑
- </el-button>
- <el-button type="info" @click="getData" size="small">刷新资料
- </el-button>
- <el-button type="primary" size="small" v-if="form.status == 0"
- class="el-button--small-yh " @click.stop="withdraw(0)">提交
- </el-button>
- <el-button type="primary" size="small" v-if="form.status == 1"
- class="el-button--small-yh " @click.stop="withdraw(1)">撤销
- </el-button>
- <el-button type="primary" size="small" v-if="form.status == 1"
- class="el-button--small-yh " @click.stop="withdraw(2)">入库确认
- </el-button>
- <el-button type="primary" size="small" v-if="form.status == 2"
- class="el-button--small-yh " @click.stop="withdraw(3)">入库撤销
- </el-button>
- <el-button type="primary" @click="editCustomer" :loading="subLoading"
- size="small">保存数据
- </el-button>
- <el-dropdown style="padding: 0 6px;line-height: 0">
- <el-button type="primary" size="small" :loading="subLoading" :disabled="!form.id">
- 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item :disabled="form.status != 2" @click.native="auditCheck">提交审核</el-dropdown-item>
- <el-dropdown-item v-if="roleName=='admin'" :disabled="form.status != 5" @click.native="revokeCheck">
- 撤销审核
- </el-dropdown-item>
- <el-dropdown-item :disabled="form.status < 3" @click.native="checkScheduleDialog = true">审核进度
- </el-dropdown-item>
- <el-dropdown-item v-if="$route.query.check" :disabled="!(form.status > 2 && form.status < 5)"
- @click.native="check">审批数据
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- <div class="customer-main" v-loading="subLoading">
- <trade-card title="基础信息">
- <avue-form ref="form" class="trading-form" v-model="form" :option="option">
- <template slot="purchaserId">
- <crop-select ref="purchaser" v-model="form.purchaserId" corpType="KH" :refresh="false"
- @getCorpData="getKHData" :disabled="detailData.status == 1"></crop-select>
- </template>
- <template slot="corpId">
- <crop-select ref="corpId" v-model="form.corpId" corpType="GYS" :refresh="false" @getCorpData="getGYSData"
- :disabled="detailData.status == 1"></crop-select>
- </template>
- <template slot="storageId">
- <el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false"
- :disabled="detailData.status == 1"
- :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
- clearable @change="storagetreeChange">
- </el-cascader>
- </template>
- <template slot-scope="{column}" slot="purchaserIdLabel">
- <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
- </template>
- <template slot-scope="{column}" slot="corpIdLabel">
- <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
- </template>
- <template slot-scope="{column}" slot="storageIdLabel">
- <span style="color: #409EFF;cursor: pointer" @click.stop="addData('storage')">{{ column.label }}</span>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="入库明细">
- <avue-crud ref="crud" :data="itemsVOList" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
- @resetColumn="resetColumn" :cell-style="cellStyle" @row-save="rowSave" @row-update="addUpdate" @selection-change="selectionChange">
- <template slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" :disabled="detailData.status == 1"
- @click.stop="addRow">录入明细
- </el-button>
- <!-- <el-button type="success" icon="el-icon-bottom" size="small" @click.stop="getTemplate">下载模板</el-button>-->
- <el-button type="info" icon="el-icon-top" size="small" :disabled="detailData.status == 1&&form.id"
- @click.stop="excelBox = true">导入
- </el-button>
- <el-button
- type="success"
- icon="el-icon-printer"
- size="small"
- :disabled="batchPrinting"
- @click.stop="printStackCard()">批量打印
- </el-button>
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="small"
- :disabled="batchDeletion"
- @click.stop="batchDeleteDetails()">批量删除
- </el-button>
- <el-button
- type="warning"
- icon="el-icon-printer"
- size="small"
- :disabled="!form.id"
- @click.stop="receiptDoc()">入库单
- </el-button>
- </template>
- <template slot="headerSerial">
- <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
- :disabled="detailData.status == 1" circle></el-button>
- </template>
- <template slot="storageIdHeader" slot-scope="{column}">
- <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
- </template>
- <template slot="itemIdHeader" slot-scope="{column}">
- <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
- </template>
- <template slot="oneCode" slot-scope="{ row, index }">
- <el-popover placement="right" width="160" trigger="click">
- <el-image style="width: 160px; height: 80px" :src="row.oneCode" :fit="fit"></el-image>
- <el-button v-if="row.oneCode" type="text" slot="reference">查看</el-button>
- </el-popover>
- </template>
- <template slot="qrCode" slot-scope="{ row, index }">
- <el-popover placement="right" width="300" trigger="click">
- <el-image style="width: 300px; height: 300px" :src="row.qrCode" :fit="fit"></el-image>
- <el-button v-if="row.qrCode" type="text" slot="reference">查看</el-button>
- </el-popover>
- </template>
- <template slot="storageInQuantityForm" slot-scope="{ row }">
- <el-input-number size="small" v-model="row.storageInQuantity" @change="calculateChange(row)"
- :controls="false" style="width:100%" placeholder="请输入"></el-input-number>
- </template>
- <template slot="priceForm" slot-scope="{ row }">
- <el-input-number size="small" v-model="row.price" @change="calculateChange(row)" :controls="false"
- style="width:100%" placeholder="请输入"></el-input-number>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <div style="display:flex;justify-content: center;">
- <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
- :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "编辑" }}
- </el-button>
- <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
- :disabled="detailData.status == 1">删除
- </el-button>
- <el-button size="small" icon="el-icon-printer" type="text" @click="rowPrint(row, index)"
- :disabled="!row.id">
- 打印
- </el-button>
- <div style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
- <el-tooltip effect="dark" content="向上移动" placement="top">
- <i v-if="index != 0&&detailData.status != 1" :disabled="disabled || detailData.status == 1"
- class="el-icon-arrow-up" @click="moveUp(row, index)" style="color:#409EFF;"></i>
- </el-tooltip>
- <el-tooltip effect="dark" content="向下移动" placement="bottom"><i
- v-if="index != (itemsVOList.length - 1)&&detailData.status != 1" class="el-icon-arrow-down"
- @click="moveDown(row, index)" style="color:#409EFF;"></i></el-tooltip>
- </div>
- </div>
- </template>
- </avue-crud>
- </trade-card>
- <fee-info ref="feeInfo" :orderFeesList="orderFeesList" typeName="wood" :corpId="form.purchaserId" :disabled="!(form.status < 3)"
- feeUrl="/blade-purchase-sales/entranceOrder/removeOrderFees" :optionType="'CMY'" :itemType="'C'"
- :inCropId="true" @beforeFinance="beforeFinance" :delType="2" :billingShow="false" />
- <!-- <upload-file ref="uploadFile" title="合同附件" :disabled="detailData.status == 1" :orderFilesList="orderFilesList"
- delUrl="" /> -->
- <containerTitle title="上传附件"></containerTitle>
- <c-upload typeUpload="CD" deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
- :data="orderFilesList" display :enumerationValue="85.6" :disabled="!(form.status < 3)"></c-upload>
- <el-dialog append-to-body title="审核进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check-schedule :checkId="form.id" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
- </check-schedule>
- </el-dialog>
- <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
- </check>
- </el-dialog>
- </div>
- <el-dialog title="导入" append-to-body :close-on-click-modal="false" :visible.sync="excelBox" width="555px">
- <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter" :upload-error="uploadError">
- <template slot="excelTemplate">
- <el-button type="primary" @click="getTemplate">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- <el-dialog
- title="打印"
- :visible.sync="dialogVisible"
- fullscreen
- append-to-body
- width="70%">
- <div id="printAll">
- <div v-for="(item,index) in printList" :key="index" style="page-break-after:always">
- <table align="center" style="color: #000000;text-align: center">
- <tr>
- <th colspan="5">垛卡</th>
- </tr>
- <tr>
- <td>品名:</td>
- <td>{{ item.cname }}</td>
- <td>等级:</td>
- <td>{{ item.grade }}</td>
- <td rowspan="3">
- <img style="width: 120px;height: 120px;" :src="item.qrCode" alt="">
- </td>
- </tr>
- <tr>
- <td>厚度:</td>
- <td>{{ item.thickness }}</td>
- <td>长度:</td>
- <td>{{item.length}}</td>
- </tr>
- <tr>
- <td>备注:</td>
- <td colspan="3">{{ item.remarks }}</td>
- </tr>
- <tr>
- <th colspan="6" style="font-size: 28px;">{{item.billNo}}</th>
- </tr>
- <tr>
- <td colspan="5">
- <img style="width: 100%;height: 40px;margin: 0 auto" :src="item.oneCode" alt="">
- </td>
- </tr>
- </table>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" v-print="'#printAll'">打 印</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- detail,
- submit,
- checkWarehousing,
- getStoragetree,
- getStorage,
- getAllgoods,
- delItem,
- revokeWarehousing,
- withdraw,
- receiptItemPrint, removeBatch
- } from "@/api/purchasingManagement/inStock";
- import tableOption from "./config/customerContact.json";
- import feeInfo from "@/components/fee-info/main";
- import checkSchedule from "../../../components/check/checkSchedule";
- import uploadFile from "@/components/upload-file/main";
- import {getToken} from "@/util/auth";
- import {contrastObj, contrastList, contrastList2} from "@/util/contrastData";
- import {validatenull} from '@/util/validate'
- import check from "@/components/check/check";
- import {dateFormat} from "@/util/date";
- export default {
- name: "detailsPageEdit",
- data() {
- return {
- checkData: {},
- checkDialog: false,
- dialogVisible: false,
- subLoading: false,
- batchPrinting:true,
- batchDeletion:true,
- form: {},
- printList:[],
- excelBox: false,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: '模板下载',
- prop: 'excelTemplate',
- formslot: true,
- span: 24,
- }, {
- label: '模板上传',
- prop: 'excelFile',
- type: 'upload',
- drag: true,
- loadText: '模板上传中,请稍等',
- span: 24,
- propsHttp: {
- res: 'data'
- },
- tip: '请上传 .xls,.xlsx 标准格式文件',
- action: "/api/trade-purchase/woodHarvestingCloud/import"
- }
- ]
- },
- excelForm: {},
- checkScheduleDialog: false,
- tableOption: {},
- selectionList:[],
- option: {
- disabled: false,
- menuBtn: false,
- labelWidth: 100,
- column: [
- {
- label: "货权人",
- prop: "purchaserId",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 6
- },
- {
- label: "入库日期",
- prop: "stockTime",
- type: "datetime",
- value: dateFormat(new Date(),'yyyy-MM-dd hh:mm:ss'),
- format: "yyyy-MM-dd HH:mm",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 6
- },
- {
- label: "箱号",
- prop: "caseNo",
- span: 6,
- blur: (data) => {
- for (let item of this.itemsVOList){
- item.containerNo = data.value
- }
- }
- },
- {
- label: "提单号",
- prop: "billNo",
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }],
- span: 6
- },
- {
- label: "仓库",
- prop: "storageId",
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }],
- span: 6
- },
- {
- label: "业务类型",
- prop: "businessType",
- type: "select",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dicData: [],
- span: 6
- },
- {
- label: "车船号",
- prop: "vehicleShipNumber",
- rules: [{
- required: false,
- message: "",
- trigger: "blur"
- }],
- span: 6
- },
- {
- label: "审核状态",
- prop: "status",
- type: "select",
- dataType: 'number',
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dicData: [],
- disabled: true,
- span: 6
- },
- {
- label: "供应商",
- prop: "corpId",
- span: 6
- },
- {
- label: "入库单号",
- prop: "sysNo",
- disabled: true,
- span: 6
- },
- {
- label: "库管员",
- prop: "stockUser",
- span: 6,
- dataType: "number",
- type: 'select',
- dicUrl: "/api/blade-user/MCSelectList",
- props: {
- label: "realName",
- value: "id"
- }
- },
- {
- label: "是否融资",
- prop: "arrival",
- type: "select",
- dataType: 'number',
- value: 0,
- dicData: [
- {
- label: "是",
- value: 1
- }, {
- label: "否",
- value: 0
- }
- ],
- change: (data) => {
- if (data.value == 0) {
- this.findObject(this.tableOption.column, "price").label = "入库单价"
- this.findObject(this.tableOption.column, "price").rules[0].required = false
- } else {
- this.findObject(this.tableOption.column, "price").label = "*入库单价"
- this.findObject(this.tableOption.column, "price").rules[0].required = true
- }
- },
- span: 6
- }, {
- label: "备注",
- prop: "orderRemark",
- type: "textarea",
- minRows: 1,
- span: 24
- },
- ]
- },
- itemsVOList: [],
- orderFeesList: [],
- orderFilesList: [],
- pageLoading: false,
- batchNo: '',
- storagetreeList: [],
- oldform: {},
- olditemsVOList: [],
- oldorderFeesList: [],
- oldorderFilesList: [],
- roleName: localStorage.getItem("roleName")
- };
- },
- props: {
- detailData: {
- type: Object
- }
- },
- components: {
- feeInfo,
- checkSchedule,
- uploadFile,
- check
- },
- async created() {
- if (this.detailData.status == 1) {
- this.option.disabled = true;
- }
- if (this.detailData.id) {
- this.getDetail(this.detailData.id);
- }
- this.tableOption = await this.getColumnData(
- this.getColumnName(189),
- tableOption
- );
- getStoragetree().then(res => {
- this.storagetreeList = res.data.data;
- })
- this.getWorkDicts("financing_status").then(res => {
- this.findObject(this.option.column, "status").dicData =
- res.data.data;
- });
- this.getWorkDicts("CMY_business_type").then(res => {
- this.findObject(this.option.column, "businessType").dicData =
- res.data.data;
- });
- this.getAllWorkDicts()
- },
- methods: {
- batchDeleteDetails(){
- let data = []
- for (let item of this.selectionList){
- data.push(item.id)
- }
- removeBatch({ids:data.join(",")}).then(res=>{
- for(let item of data){
- for (let i in this.itemsVOList){
- if (item === this.itemsVOList[i].id){
- this.itemsVOList.splice(i, 1);
- }
- }
- }
- })
- },
- printStackCard(){
- let data = []
- for (let item of this.selectionList){
- data.push(item.id)
- }
- receiptItemPrint({ids:data.join(",")}).then(res=>{
- this.printList = res.data.data
- this.dialogVisible = true
- })
- },
- selectionChange(list){
- this.selectionList = list
- if (this.selectionList.length === 0){
- this.batchPrinting = true
- this.batchDeletion = true
- }
- for(let item of this.selectionList){
- if (item.isIssue == 0 || !item.isIssue) {
- this.batchPrinting = true
- break
- }else {
- this.batchPrinting = false
- }
- }
- for(let item of this.selectionList){
- if (item.isIssue > 0 || !item.id) {
- this.batchDeletion = true
- break
- }else {
- this.batchDeletion = false
- }
- }
- },
- check() {
- this.checkData = this.$route.query.check
- this.checkDialog = true
- },
- //关闭审核
- choceCheckFun() {
- this.checkDialog = false;
- },
- getData() {
- getAllgoods().then(res => {
- this.findObject(this.tableOption.column, "itemId").dicData =
- res.data.data;
- })
- getStoragetree().then(res => {
- this.storagetreeList = res.data.data;
- })
- this.getStorage()
- this.$refs.purchaser.refreshData()
- this.$refs.corpId.refreshData()
- },
- getAllWorkDicts() {
- getAllgoods().then(res => {
- this.findObject(this.tableOption.column, "itemId").dicData = res.data.data;
- })
- this.findObject(this.tableOption.column, "itemId").change = (data)=>{
- for (let item of this.findObject(this.tableOption.column, "itemId").dicData){
- if (data.value == item.id){
- this.itemsVOList[data.index].cname = item.cname
- }
- }
- }
- this.getWorkDicts("unit").then(res => {
- this.findObject(this.tableOption.column, "unit").dicData =
- res.data.data;
- });
- this.getWorkDicts("goods_grade").then(res => {
- this.findObject(this.tableOption.column, "grade").dicData =
- res.data.data;
- });
- this.getWorkDicts("brand").then(res => {
- this.findObject(this.tableOption.column, "itemType").dicData =
- res.data.data;
- });
- },
- cellStyle() {
- return "padding:0;height:40px;";
- },
- getStorage() {
- getStorage({storageTypeId: this.form.storageId}).then(res => {
- this.findObject(this.tableOption.column, "storageId").dicData = res.data;
- })
- },
- storagetreeChange(row) {
- if (row) {
- if (this.itemsVOList.length > 0) {
- this.getStorage()
- this.itemsVOList.forEach(e => {
- e.storageId = null
- })
- this.$message.warning("请重新选择库区!")
- }
- } else {
- if (this.itemsVOList.length > 0) {
- this.findObject(this.tableOption.column, "storageId").dicData = []
- this.itemsVOList.forEach(e => {
- e.storageId = null
- })
- this.$message.warning("请重新选择库区!")
- }
- }
- },
- getKHData(row) {
- this.form.purchaser = row.cname
- },
- getGYSData(row) {
- console.log(row)
- this.form.corpName = row.cname
- },
- choceScheduleFun() {
- this.checkScheduleDialog = false
- },
- addRow() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- this.itemsVOList.push({$cellEdit: true, unit: '1',containerNo:this.form.caseNo});
- this.getStorage()
- } else {
- return false;
- }
- });
- },
- rowCell(row, index) {
- this.$refs.crud.rowCell(row, index)
- },
- rowSave(form, done) {
- done()
- },
- addUpdate(form, index, done, loading) {
- done()
- },
- rowDel(row) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- delItem({itemId: row.id,type:"RK"}).then(res => {
- this.$message.success("删除成功!");
- this.itemsVOList.splice(row.$index, 1);
- });
- } else {
- this.$message.success("删除成功!");
- this.itemsVOList.splice(row.$index, 1);
- }
- });
- },
- getDetail(id) {
- this.pageLoading = true;
- detail(id)
- .then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.getStorage()
- })
- .finally(() => {
- this.pageLoading = false;
- });
- },
- rowPrint(row) {
- this.$router.push(`/myiframe/urlPath?name=preview-木材管理-入库垛卡.ureport.xml&src=${this.website.reportUrl}/preview?_u=blade-木材管理-入库垛卡.ureport.xml&id=${row.id}`);
- },
- receiptDoc(){
- this.$router.push(`/myiframe/urlPath?name=preview-木材库-入库单.ureport.xml&src=${this.website.reportUrl}/preview%3F_u%3Dblade-木材库-入库单.ureport.xml&id=${this.form.id}`);
- },
- //提交撤销
- withdraw(type) {
- if (type == 0) {
- this.$confirm("是否确认提交?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- for (let i = 0; i < this.itemsVOList.length; i++) {
- // if (validatenull(this.itemsVOList[i].storageId)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的库区')
- // }
- if (validatenull(this.itemsVOList[i].itemId)) {
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
- }
- // if (validatenull(this.itemsVOList[i].itemType)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
- // }
- // if (validatenull(this.itemsVOList[i].grade)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的等级')
- // }
- if (validatenull(this.itemsVOList[i].billNo)) {
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
- }
- // if (validatenull(this.itemsVOList[i].sliceNumber)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的片数')
- // }
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
- }
- // if (validatenull(this.itemsVOList[i].unit)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
- // }
- if (this.form.arrival == 1) {
- if (validatenull(this.itemsVOList[i].price)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
- }
- }
- }
- this.itemsVOList.forEach((e, index) => {
- e.sort = Number(index) + 1
- })
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- submit(data).then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- if (!this.detailData.id){
- this.detailData.id = res.data.data.id
- }
- if (this.itemsVOList.length == 0) {
- this.subLoading = false
- return this.$message({
- type: "warning",
- message: "无明细不允许提交!"
- });
- }
- withdraw({
- id: this.form.id,
- type: "RK",
- status: 1,
- isIssue: 1
- }).then(res => {
- this.$message({
- type: "success",
- message: "提交成功!"
- });
- this.getDetail(this.form.id);
- this.subLoading = false;
- })
- })
- })
- } else if(type == 2){
- this.$confirm("是否确认入库?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- withdraw({
- id: this.form.id,
- type: "RK",
- status: 2,
- isIssue: 3,
- toolType: 'app'
- }).then(res => {
- this.$message({
- type: "success",
- message: "入库成功!"
- });
- this.getDetail(this.form.id);
- this.subLoading = false;
- })
- })
- } else if(type == 3){
- this.$confirm("是否确认撤销?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- withdraw({
- id: this.form.id,
- type: "RK",
- status: 1,
- isIssue: 1,
- toolType: 'app'
- }).then(res => {
- this.$message({
- type: "success",
- message: "撤销成功!"
- });
- this.getDetail(this.form.id);
- this.subLoading = false;
- })
- })
- }else {
- this.$confirm("是否确认撤销?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- for (let i = 0; i < this.itemsVOList.length; i++) {
- // if (validatenull(this.itemsVOList[i].storageId)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的库区')
- // }
- if (validatenull(this.itemsVOList[i].itemId)) {
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
- }
- // if (validatenull(this.itemsVOList[i].itemType)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
- // }
- // if (validatenull(this.itemsVOList[i].grade)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的等级')
- // }
- if (validatenull(this.itemsVOList[i].billNo)) {
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
- }
- // if (validatenull(this.itemsVOList[i].sliceNumber)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的片数')
- // }
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
- }
- // if (validatenull(this.itemsVOList[i].unit)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
- // }
- if (this.form.arrival == 1) {
- if (validatenull(this.itemsVOList[i].price)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
- }
- }
- }
- this.itemsVOList.forEach((e, index) => {
- e.sort = Number(index) + 1
- })
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- submit(data).then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- if (!this.detailData.id){
- this.detailData.id = res.data.data.id
- }
- withdraw({
- id: this.form.id,
- type: "RK",
- status: 0,
- isIssue: 0
- }).then(res => {
- this.$message({
- type: "success",
- message: "撤销成功!"
- });
- this.getDetail(this.form.id);
- this.subLoading = false;
- })
- })
- })
- }
- },
- //修改提交触发
- editCustomer(status) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- for (let i = 0; i < this.itemsVOList.length; i++) {
- // if (validatenull(this.itemsVOList[i].storageId)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的库区')
- // }
- if (validatenull(this.itemsVOList[i].itemId)) {
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
- }
- // if (validatenull(this.itemsVOList[i].itemType)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
- // }
- // if (validatenull(this.itemsVOList[i].grade)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的等级')
- // }
- if (validatenull(this.itemsVOList[i].billNo)) {
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
- }
- // if (validatenull(this.itemsVOList[i].sliceNumber)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的片数')
- // }
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
- }
- // if (validatenull(this.itemsVOList[i].unit)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
- // }
- if (this.form.arrival == 1) {
- if (validatenull(this.itemsVOList[i].price)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
- }
- }
- }
- this.itemsVOList.forEach((e, index) => {
- e.sort = Number(index) + 1
- })
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- submit(data).then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- if (!this.detailData.id){
- this.detailData.id = res.data.data.id
- }
- this.getDetail(res.data.data.id)
- }).finally(() => {
- this.subLoading = false;
- });
- } else {
- return false;
- }
- });
- },
- //请核
- auditCheck() {
- let orderFeesList = this.$refs.feeInfo.submitData();
- if (orderFeesList.length == 0) {
- this.$confirm("没有应付费用,是否继续提交?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$confirm("确定审核此订单?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- for (let i = 0; i < this.itemsVOList.length; i++) {
- // if (validatenull(this.itemsVOList[i].storageId)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的库区')
- // }
- if (validatenull(this.itemsVOList[i].itemId)) {
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
- }
- // if (validatenull(this.itemsVOList[i].itemType)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
- // }
- // if (validatenull(this.itemsVOList[i].grade)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的等级')
- // }
- if (validatenull(this.itemsVOList[i].billNo)) {
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
- }
- // if (validatenull(this.itemsVOList[i].sliceNumber)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的片数')
- // }
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
- }
- // if (validatenull(this.itemsVOList[i].unit)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
- // }
- if (this.form.arrival == 1) {
- if (validatenull(this.itemsVOList[i].price)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
- }
- }
- }
- this.itemsVOList.forEach((e, index) => {
- e.sort = Number(index) + 1
- })
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- submit(data).then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- if (!this.detailData.id){
- this.detailData.id = res.data.data.id
- }
- const datat = {
- id: this.form.id,
- checkType: 'RK',
- url: '/purchasingManagement/inStock/index',
- pageStatus: "this.$store.getters.entranceXsStatus",
- pageLabel: "入库管理",
- checkFlag: 1,
- }
- checkWarehousing(datat).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!")
- }
- }).finally(() => {
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- })
- }).catch(()=>{
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- })
- } else {
- this.$confirm("确定审核此订单?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- for (let i = 0; i < this.itemsVOList.length; i++) {
- // if (validatenull(this.itemsVOList[i].storageId)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的库区')
- // }
- if (validatenull(this.itemsVOList[i].itemId)) {
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
- }
- // if (validatenull(this.itemsVOList[i].itemType)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
- // }
- // if (validatenull(this.itemsVOList[i].grade)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的等级')
- // }
- if (validatenull(this.itemsVOList[i].billNo)) {
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
- }
- // if (validatenull(this.itemsVOList[i].sliceNumber)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的片数')
- // }
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
- }
- // if (validatenull(this.itemsVOList[i].unit)) {
- // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
- // }
- if (this.form.arrival == 1) {
- if (validatenull(this.itemsVOList[i].price)) {
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
- }
- }
- }
- this.itemsVOList.forEach((e, index) => {
- e.sort = Number(index) + 1
- })
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- submit(data).then(res => {
- this.form = res.data.data;
- this.itemsVOList = res.data.data.itemsVOList;
- this.orderFeesList = res.data.data.orderFeesList;
- this.orderFilesList = res.data.data.orderFilesList;
- this.oldform = this.deepClone(res.data.data);
- this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
- this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
- this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- if (!this.detailData.id){
- this.detailData.id = res.data.data.id
- }
- const dataT = {
- id: this.form.id,
- checkType: 'RK',
- url: '/purchasingManagement/inStock/index',
- pageStatus: "this.$store.getters.entranceXsStatus",
- pageLabel: "入库管理",
- checkFlag: 1,
- }
- checkWarehousing(dataT).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!")
- }
- }).finally(() => {
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- })
- }).catch(()=>{
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- }
- },
- revokeCheck() {
- this.$confirm("确定撤销审核此订单?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let orderFeesList = this.$refs.feeInfo.submitData();
- this.subLoading = true;
- let data = {
- ...this.form,
- billType: 'RK',
- itemsVOList: this.itemsVOList,
- orderFeesList: orderFeesList,
- orderFilesList: this.orderFilesList
- };
- revokeWarehousing(data).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!")
- }
- }).finally(() => {
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- })
- },
- calculateChange(row) {
- row.storageAmount = Number((row.storageInQuantity ? row.storageInQuantity : 0) * (row.price ? row.price : 0)).toFixed(2)
- },
- beforeFinance(feesData, callback) {
- let params = {}
- //暂时默认通过 之后优化
- params.valid = true
- params.parentId = this.form.id
- callback(params)
- },
- getTemplate() {
- window.open(`/api/trade-purchase/woodHarvestingCloud/export-template?${this.website.tokenHeader}=${getToken()}`)
- },
- uploadAfter(res, done, loading, column) {
- if (!res.message) {
- res.forEach(item => {
- this.itemsVOList.push({
- ...item,
- containerNo:this.form.caseNo,
- $cellEdit: false
- })
- })
- this.excelBox = false
- done();
- } else {
- loading()
- }
- },
- addData(row) {
- if (row == 'purchaserId') {
- this.$router.push(`/basicData/customerInformation/index`);
- } else if (row == 'corpId') {
- this.$router.push(`/basicData/customerManagement/supplierMaterial/index`);
- } else if (row == 'storage') {
- this.$router.push(`/basicData/basicStorageType/index`);
- } else if (row == 'storageId') {
- this.$router.push(`/basicData/basicStorageDesc/index`);
- } else if (row == 'itemId') {
- this.$router.push(`/basicData/commodityType/index`);
- }
- },
- //返回列表
- backToList() {
- let orderFeesList = this.$refs.feeInfo.submitData();
- if (
- contrastObj(this.form, this.oldform) ||
- contrastList(this.itemsVOList, this.olditemsVOList) ||
- contrastList2(orderFeesList, this.oldorderFeesList) ||
- contrastList(this.orderFilesList, this.oldorderFilesList)
- ) {
- this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.editCustomer("goBack");
- })
- .catch(() => {
- this.$emit("goBack");
- });
- } else {
- this.$emit("goBack");
- }
- },
- openEdit() {
- this.detailData.status = 2;
- this.option.disabled = false;
- this.$refs.crud.refreshTable();
- },
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(189),
- this.tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- moveUp(row, index) {
- this.itemsVOList[index] = this.itemsVOList.splice(index - 1, 1, row)[0]
- },
- moveDown(row, index) {
- this.itemsVOList[index] = this.itemsVOList.splice(index + 1, 1, row)[0]
- },
- async resetColumn() {
- this.tableOption = tableOption;
- const inSave = await this.delColumnData(
- this.getColumnName(189),
- tableOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.tableOption.selectable = (row,index)=>{
- return row.status == 0
- }
- this.$message.success("重置成功");
- this.getAllWorkDicts()
- this.getStorage()
- //关闭窗口
- setTimeout(() => {
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }, 1000);
- }
- }
- },
- watch: {}
- };
- </script>
- <style lang="scss" scoped>
- .trading-form ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .select-component {
- display: flex !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- </style>
|