123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879 |
- <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" @click="editCustomer" :loading="subLoading" v-if="!(form.status > 2)"
- 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">
- <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>
- </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" :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>
- </div>
- </template>
- <script>
- import {
- detail,
- submit,
- checkWarehousing,
- getStoragetree,
- getStorage,
- getAllgoods,
- delItem,
- revokeWarehousing,
- withdraw
- } 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";
- export default {
- name: "detailsPageEdit",
- data() {
- return {
- checkData: {},
- checkDialog: false,
- subLoading: false,
- form: {},
- 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: {},
- option: {
- disabled: false,
- menuBtn: false,
- labelWidth: 100,
- column: [
- {
- label: "货权人",
- prop: "purchaserId",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 6
- },
- {
- label: "入库日期",
- prop: "stockTime",
- type: "datetime",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 6
- },
- {
- label: "仓库",
- prop: "storageId",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 6
- },
- {
- label: "提单号",
- prop: "billNo",
- span: 6
- },
- {
- label: "业务类型",
- prop: "businessType",
- type: "select",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dicData: [],
- span: 6
- },
- {
- label: "车船号",
- prop: "vehicleShipNumber",
- 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: "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.required = false
- } else {
- this.findObject(this.tableOption.column, "price").label = "*入库单价"
- this.findObject(this.tableOption.column, "price").rules.required = true
- }
- },
- span: 6
- },
- {
- label: "备注",
- prop: "orderRemark",
- type: "textarea",
- minRows: 1,
- span: 12
- },
- ]
- },
- 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("approval_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: {
- 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.getWorkDicts("unit").then(res => {
- this.findObject(this.tableOption.column, "unit").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'});
- 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}).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.itemsVOList.splice(row.$index, 1);
- });
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- 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}`);
- },
- //提交撤销
- withdraw(type) {
- if (type == 0) {
- this.$confirm("是否确认提交?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (this.itemsVOList.length == 0){
- return this.$message({
- type: "warning",
- message: "无明细不允许提交!"
- });
- }
- this.subLoading = true;
- 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 {
- this.$confirm("是否确认撤销?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.subLoading = true;
- 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 (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 (status == "goBack") {
- this.$emit("goBack");
- }
- })
- .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(() => {
- const data = {
- id: this.form.id,
- checkType: 'RK',
- url: '/purchasingManagement/inStock/index',
- pageStatus: "this.$store.getters.entranceXsStatus",
- pageLabel: "入库管理",
- checkFlag: 1,
- }
- this.subLoading = true
- checkWarehousing(data).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!")
- }
- }).finally(() => {
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- })
- })
- } else {
- this.$confirm("确定审核此订单?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.subLoading = true
- const data = {
- id: this.form.id,
- checkType: 'RK',
- url: '/purchasingManagement/inStock/index',
- pageStatus: "this.$store.getters.entranceXsStatus",
- pageLabel: "入库管理",
- checkFlag: 1,
- }
- checkWarehousing(data).then(res => {
- if (res.data.success) {
- this.$message.success("操作成功!")
- }
- }).finally(() => {
- this.subLoading = false
- this.getDetail(this.form.id)
- })
- }).finally(() => {
- })
- }
- },
- 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,
- $cellEdit: true
- }))
- 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.$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>
|