| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003 |
- <template>
- <div>
- <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(0)"
- >返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button
- class="el-button--small-yh"
- type="success"
- size="small"
- v-if="form.whetherShippingNotice == 0 && paymentType == 1"
- @click="notice"
- >微信发货通知
- </el-button>
- <el-button v-if="editButton" class="el-button--small-yh" type="primary" size="small" @click="confirmEditing">编辑 </el-button>
- <el-button v-else class="el-button--small-yh" type="primary" size="small" :disabled="editDisabled" @click="editCustomer">保存数据 </el-button>
- <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'" @click="revoke">撤销出库 </el-button>
- <el-button
- class="el-button--small-yh"
- type="success"
- size="small"
- style="margin-left: 6px;"
- v-if="form.statusName == '待出库' || form.statusName == '撤销出库'"
- @click="complete"
- :disabled="isSave"
- >出库完成
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
- </trade-card>
- <trade-card title="明细信息">
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="出库明细" name="sale_detail">
- <avue-crud
- :option="optionContacts"
- v-model="formContacts"
- ref="formContacts"
- :data="form.shipItemsList"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
- >
- <template slot-scope="scope" slot="menuLeft">
- <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
- </template>
- <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
- <el-popover placement="left" width="500" trigger="hover">
- <el-table
- :row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
- :cell-style="{ padding: '0px', fontSize: '12px' }"
- :data="row.recordList"
- :header-cell-style="tableHeaderCellStyle"
- border
- stripe
- height="300px"
- style="width: 100%"
- >
- <el-table-column property="srcOrd" label="单号">
- <template slot-scope="{ row }">
- <span style="color: #409EFF;cursor: pointer" @click.stop="Jump(row)">{{ row.srcOrd }} </span>
- </template>
- </el-table-column>
- <el-table-column property="num" label="数量"></el-table-column>
- <el-table-column property="amount" label="金额"></el-table-column>
- <el-table-column property="createUserName" label="制单人"></el-table-column>
- <el-table-column property="createTime" label="制单日期"></el-table-column>
- </el-table>
- <el-button
- v-if="row.recordList"
- slot="reference"
- :size="size"
- :disabled="!row.id"
- :type="type"
- icon="el-icon-view"
- style="margin-right: 8px;"
- >
- 查看记录
- </el-button>
- </el-popover>
- <el-button
- v-if="reservoirArea == 1 && row.historyList.length"
- :size="size"
- :disabled="!row.id || editDisabled"
- type="text"
- @click="rowDelArea(row, index)"
- >
- 清空库区
- </el-button>
- <el-button
- v-if="reservoirArea == 1 && row.historyList.length"
- :size="size"
- :disabled="!row.id"
- type="text"
- @click="rowArea(row, index)"
- >
- 查看库区
- </el-button>
- <el-button
- v-if="reservoirArea == 1 && row.historyList.length == 0"
- :size="size"
- :disabled="!row.id || editDisabled"
- type="text"
- @click="rowArea(row, index)"
- >
- 选择库区
- </el-button>
- <el-button
- v-if="reservoirArea != 1"
- :size="size"
- :disabled="editDisabled"
- :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="rowEdit(row, index)"
- >
- {{ row.$cellEdit ? "保存" : "编辑" }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="editDisabled" :type="type" @click="rowDelBox(row, index)">删除 </el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="订单信息" name="payment_details">
- <avue-crud
- :option="optionPaymentDetails"
- v-model="formContacts"
- ref="payment_details"
- :data="form.shipVOList"
- :key="key"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
- @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
- >
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="历史记录" name="outbound_records">
- <avue-crud
- :option="optionOutboundRecords"
- v-model="formContacts"
- ref="outbound_records"
- :data="form.historyList"
- :key="key"
- @row-save="rowSave"
- @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)"
- >
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload
- v-loading="loadingBtn"
- typeUpload="LT"
- :disabled="editDisabled"
- deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
- :data="filesList"
- display
- :enumerationValue="35.1"
- ></c-upload>
- <report-dialog :switchDialog="switchDialog" :reportId="form.id" @onClose="onClose()"></report-dialog>
- </div>
- </div>
- </template>
- <script>
- import {
- getDetails,
- tradingBox,
- submit,
- warehousingComplete,
- revokeOutboundCompleted,
- shippingNotice,
- itemRemove
- } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
- import { dateFormat } from "@/util/date";
- import reportDialog from "@/components/report-dialog/main";
- import { dotList } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import { getParamservice } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import { isProcurement } from "@/api/basicData/configuration";
- import viewArea from "./components/viewArea.vue";
- export default {
- name: "detailsPage",
- data() {
- return {
- reservoirArea: 0,
- // 上传附件的需要参数
- loadingBtn: false,
- filesList: [],
- itemAreaList: [],
- switchDialog: false,
- activeName: "sale_detail",
- editButton: false,
- editDisabled: false,
- form: {
- shipItemsList: [],
- shipVOList: [],
- historyList: []
- },
- key: 0,
- optionForm: {
- disabled: false,
- menuBtn: false,
- span: 8,
- column: [
- {
- label: "业务对象",
- disabled: true,
- prop: "customerId",
- type: "select",
- props: {
- label: "cname",
- value: "id"
- },
- dicUrl: "/api/blade-sales-part/corpsDesc/listAll?corpType=KH&enableOrNot=1",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "仓库",
- prop: "storageId",
- disabled: false,
- type: "select",
- props: {
- label: "cname",
- value: "id"
- },
- dicUrl: "/api/blade-sales-part/storageDesc/listAll",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "库管",
- prop: "stockClerkId",
- type: "select",
- disabled: false,
- props: {
- label: "realName",
- value: "id"
- },
- dicUrl: "/api/blade-user/stockClerkList",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "业务日期",
- prop: "businesDate",
- searchProp: "businesDateList",
- disabled: true,
- 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"
- }
- ]
- },
- {
- label: "出库单号",
- disabled: true,
- prop: "billno",
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "来源单号",
- prop: "ordNo",
- disabled: true
- },
- {
- label: "配送方式",
- prop: "shipType",
- type: "select",
- disabled: false,
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod"
- },
- {
- label: "货运公司",
- prop: "logisticsCorpName",
- type: "select",
- disabled: false,
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company"
- },
- {
- label: "货运单号",
- prop: "expressNo",
- disabled: false
- },
- {
- label: "订单数量",
- prop: "goodsTotalNum",
- disabled: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- },
- {
- label: "出库数量",
- prop: "sendTotalNum",
- disabled: true
- },
- {
- label: "备注",
- prop: "remarks",
- type: "textarea",
- disabled: false,
- span: 16,
- minRows: 1
- }
- ]
- },
- formContacts: {},
- optionContacts: {},
- optionContactsBack: {
- align: "center",
- index: true,
- updateBtnText: "保存",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 300,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 250,
- dialogTop: 25,
- dialogWidth: "80%",
- showSummary: true,
- saveBtn: false, // 表格弹窗保存按钮
- cellBtn: false, // 行编辑
- sumColumnList: [
- {
- name: "goodsNum",
- type: "sum"
- },
- {
- name: "sendNum",
- type: "sum"
- }
- ],
- column: [
- // {
- // label: '商品名称',
- // prop: 'goodsId',
- // disabled: true,
- // width: 200,
- // overHidden: true,
- // hide: true,
- // type: 'select',
- // remote: true,
- // props: {
- // label: 'cname',
- // value: 'id'
- // },
- // dicUrl: '/api/blade-sales-part/goodsDesc/list?current=1&size=10&cname={{key}}&enableOrNot=1'
- // },
- {
- label: "商品名称",
- prop: "goodsName",
- width: 200,
- overHidden: true
- },
- {
- label: "商品编码",
- prop: "goodsNo",
- width: 100,
- overHidden: true
- },
- {
- label: "品牌",
- prop: "brandId",
- width: 100,
- overHidden: true,
- type: "select",
- props: {
- label: "cname",
- value: "id"
- },
- dicUrl: "/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1"
- },
- {
- label: "规格型号",
- prop: "propertyName",
- width: 100,
- overHidden: true
- },
- {
- label: "花纹",
- prop: "pattern",
- width: 100,
- overHidden: true
- },
- {
- label: "商品描述",
- prop: "goodsDescription",
- overHidden: true
- },
- {
- label: "批次号",
- prop: "dot",
- cell: true,
- type: "select",
- overHidden: true,
- dicData: [],
- props: {
- label: "dot",
- value: "dot"
- },
- dicUrl: "/api/blade-sales-part/stockDesc/dotList"
- },
- {
- label: "单位",
- prop: "units",
- type: "select",
- overHidden: true,
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit"
- },
- {
- label: "库存",
- prop: "inventory",
- overHidden: true
- },
- {
- label: "出库数量",
- prop: "goodsNum",
- overHidden: true
- },
- {
- label: "发货数量",
- prop: "sendNum",
- cell: true,
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true
- },
- {
- label: "自有数",
- prop: "sendNumHave",
- overHidden: true
- },
- {
- label: "代采数",
- prop: "sendNumFinancing",
- overHidden: true
- }
- ]
- },
- optionPaymentDetails: {},
- optionPaymentDetailsBack: {
- align: "center",
- index: true,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- menu: false,
- column: [
- {
- label: "出库单号",
- prop: "billno",
- overHidden: true
- },
- {
- label: "来源单号",
- prop: "ordNo",
- overHidden: true
- },
- {
- label: "业务来源",
- prop: "bsType",
- overHidden: true
- },
- {
- label: "地址",
- prop: "recAddress",
- overHidden: true
- },
- {
- label: "联系人",
- prop: "contacts",
- overHidden: true
- },
- {
- label: "电话",
- prop: "phone",
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true
- }
- ]
- },
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- align: "center",
- index: true,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- menu: false,
- column: [
- {
- label: "操作人",
- prop: "operatorName",
- overHidden: true
- },
- {
- label: "状态",
- prop: "operateStatus",
- overHidden: true
- },
- {
- label: "时间",
- prop: "operateTime",
- overHidden: true
- }
- ]
- },
- paymentType: null,
- whetherFinancing: 0
- };
- },
- components: {
- reportDialog,
- viewArea
- },
- props: {
- onLoad: Object,
- detailData: Object
- },
- async created() {
- this.optionContacts = await this.getColumnData(this.getColumnName(270.1), this.optionContactsBack);
- isProcurement({ param: "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
- }
- });
- this.optionPaymentDetails = await this.getColumnData(this.getColumnName(270.2), this.optionPaymentDetailsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(270.3), this.optionOutboundRecordsBack);
- this.key++;
- if (this.onLoad.id) {
- this.editButton = true;
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.refresh(this.onLoad.id, true);
- }
- if (this.detailData.id) {
- this.editButton = true;
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.refresh();
- }
- if (this.$route.query.srcId) {
- this.editButton = true;
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.refresh(this.$route.query.srcId);
- }
- this.$store.commit("DOMIO_IN_DETAIL");
- getParamservice(1, 10, { paramKey: "WeChat.shipping.notification" }).then(res => {
- if (res.data.data.records.length > 0) {
- this.paymentType = res.data.data.records[0].paramValue;
- }
- });
- isProcurement({ param: "whether.financing" }).then(res => {
- if (res.data.data == 1) {
- this.whetherFinancing = res.data.data;
- }
- });
- isProcurement({ param: "reservoir.area" }).then(res => {
- this.reservoirArea = res.data.data;
- });
- },
- activated() {
- if (this.detailData.id) {
- this.refresh();
- }
- this.$store.commit("DOMIO_IN_DETAIL");
- },
- methods: {
- rowDelArea(row, index) {
- if (row.historyList.filter(item => item.id).length) {
- this.$confirm("是否撤销库区?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let ids = [];
- for (let item of row.historyList) {
- ids.push(item.id);
- }
- itemRemove({ ids: ids.join(",") }).then(res => {
- row.historyList = [];
- row.dot = null;
- row.sendNum = 0;
- row.inventory = 0;
- });
- });
- } else {
- row.historyList = [];
- row.dot = null;
- row.sendNum = 0;
- row.inventory = 0;
- }
- },
- rowArea(row, index) {
- // let obj = {
- // shipId: this.form.id,
- // shipItemId: row.id,
- // goodsId: row.goodsId,
- // storageId: this.form.storageId,
- // dot: row.dot
- // };
- this.$refs.viewArea.openDialog(this.form, row, index);
- },
- areaData(row, index) {
- console.log(row, index);
- this.form.shipItemsList[index].dot = row.dot;
- this.form.shipItemsList[index].inventory = row.inventory;
- this.form.shipItemsList[index].sendNum = row.sendNum;
- this.form.shipItemsList[index].historyList = row.historyList;
- },
- notice() {
- this.$confirm("是否微信发货通知?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- shippingNotice(this.form)
- .then(res => {
- this.$message.success("操作成功");
- this.refresh(res.data.data.id);
- loading.close();
- })
- .finally(() => {
- loading.close();
- });
- });
- },
- // 撤销出库
- revoke() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- revokeOutboundCompleted({
- ...this.form,
- bizTypeName: "FHGD"
- })
- .then(res => {
- if (res.data.code === 601) {
- this.$message({
- type: "error",
- message: res.data.msg
- });
- this.refresh(this.form.id);
- } else {
- this.$message.success("撤销成功");
- this.refresh(this.form.id, true);
- }
- })
- .finally(() => {
- loading.close();
- });
- }
- });
- },
- rowEdit(row, index) {
- if (this.form.statusName == "待出库") {
- this.optionContacts.column.forEach(its => {
- if (its.prop == "dot") {
- this.$set(its, "disabled", false);
- }
- });
- }
- dotList({
- storageId: this.form.storageId,
- goodsId: row.goodsId
- }).then(res => {
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
- // 增加监听数据改变更改库存数量
- this.findObject(this.optionContacts.column, "dot").change = data => {
- for (let item of data.column.dicData) {
- if (item.dot == data.value) {
- this.$set(row, "inventory", item.balanceQuantity);
- }
- }
- };
- });
- if (row.$cellEdit) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- // this.$refs.formContacts.rowEdit(row, index)
- },
- complete() {
- console.log(this.form.id);
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- if (this.whetherFinancing == 1) {
- for (let item of this.form.shipItemsList) {
- if (item.historyList.length == 0) {
- return this.$message.error("请维护出库明细的库区");
- }
- }
- }
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- this.form.shipItemsList.forEach(item => {
- item.goodsName = item.$goodsId;
- });
- submit({
- ...this.form,
- bizTypeName: "FHGD"
- })
- .then(res => {
- if (res.data.code === 601) {
- loading.close();
- this.$message({
- type: "error",
- message: res.data.msg
- });
- this.refresh(this.form.id);
- } else {
- warehousingComplete({
- ...this.form,
- bizTypeName: "FHGD"
- })
- .then(res => {
- this.$message.success("出库完成");
- this.refresh(res.data.data.id);
- })
- .finally(() => {
- loading.close();
- });
- }
- })
- .catch(() => {
- loading.close();
- });
- } else {
- this.$message.error("请选择库管");
- }
- });
- },
- Jump(row) {
- if (this.$store.getters.financingStatus) {
- this.$alert("融资采购(L)已存在,请关闭融资采购(L)再进行操作", "温馨提示", {
- confirmButtonText: "确定",
- type: "warning"
- });
- } else {
- this.$router.$avueRouter.closeTag("/tirePartsMall/purchasingManagement/financingProcurement/index");
- this.$router.push({
- path: "/tirePartsMall/purchasingManagement/financingProcurement/index",
- query: {
- srcId: row.srcId
- }
- });
- }
- },
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- submit({
- ...this.form,
- bizTypeName: "FHGD",
- filesList: this.filesList
- })
- .then(res => {
- if (res.data.code === 601) {
- this.$message({
- type: "error",
- message: res.data.msg
- });
- this.refresh(this.form.id);
- } else {
- this.$message.success("保存成功");
- this.refresh(res.data.data.id);
- }
- })
- .finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- refresh(id, type) {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- getDetails({ id: id })
- .then(res => {
- if (res.data.data.statusName == "已出库") {
- this.editDisabled = true;
- this.optionForm.disabled = true;
- }
- if (type && !this.editButton) {
- this.editDisabled = false;
- this.optionForm.disabled = false;
- }
- this.form = res.data.data;
- this.filesList = res.data.data.filesList;
- })
- .finally(() => {
- loading.close();
- });
- },
- rowDelBox(row, index) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBox(row.id).then(res => {
- this.form.shipItemsList.splice(index, 1);
- this.$message.success("操作成功!");
- });
- } else {
- this.form.shipItemsList.splice(index, 1);
- this.$message.success("操作成功!");
- }
- });
- },
- rowSave(form, done, loading) {
- done(form);
- },
- rowUpdate(form, index, done, loading) {
- done(form);
- },
- //打印
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //编辑
- confirmEditing() {
- this.editButton = false;
- if (this.form.statusName == "待出库" || this.form.statusName == "撤销出库") {
- this.editDisabled = false;
- this.optionForm.disabled = false;
- }
- if (this.form.statusName == "已出库") {
- this.editDisabled = true;
- this.optionForm.disabled = true;
- }
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- isProcurement({ param: "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
- }
- });
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- isProcurement({ param: "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
- }
- });
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- backToList(type) {
- this.$emit("backToList", type);
- // this.$store.commit("DOMIO_OUT_DETAIL");
- },
- // 表头样式
- tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
- return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;textAlign:center";
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|