| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372 |
- <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="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
- <el-button v-else class="el-button--small-yh" type="primary" :disabled="editDisabled" size="small" @click="editCustomer">保存数据 </el-button>
- <el-button
- class="el-button--small-yh"
- type="success"
- size="small"
- v-if="form.statusName == '待入库' || form.statusName == '已撤销'"
- @click="complete"
- :disabled="editDisabled"
- >入库完成
- </el-button>
- <el-button class="el-button--small-yh" type="success" size="small" v-if="form.statusName == '已入库'" @click="revoke">撤销入库 </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"
- @selection-change="selectionContacts"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 274.1)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 274.1)"
- >
- <template slot-scope="{ row }" slot="reservoirAreaName">
- <dic-select
- v-if="row.$cellEdit"
- :key="form.storageId"
- v-model="row.reservoirAreaName"
- placeholder="库区"
- label="cname"
- res="records"
- :url="'/blade-sales-part/reservoirarea/list?current=1&size=5&storageId=' + form.storageId"
- :filterable="true"
- :remote="true"
- dataName="cname"
- @selectChange="rowDicChange('reservoirAreaName', $event, row)"
- :slotRight="true"
- rightLabel="balanceQuantity"
- ></dic-select>
- <span v-else>{{ row.reservoirAreaName }}</span>
- </template>
- <template slot="sendNum" slot-scope="{ row }">
- <el-input-number
- v-if="row.$cellEdit"
- size="small"
- v-model="row.sendNum"
- :controls="false"
- :precision="numberDecimal"
- :min="0"
- style="width: 100%"
- ></el-input-number>
- <span v-else>{{ row.sendNum }}</span>
- </template>
- <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
- <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>
- <template slot-scope="{ scope, row }" slot="menuLeft">
- <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
- :disabled="isrowAdd">添加商品</el-button>
- <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入库区
- </el-button> -->
- <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
- <el-button type="danger" plain size="small" :disabled="editDisabled" @click="batchDelete">一键删除</el-button>
- <el-button
- v-if="reservoirArea == 1"
- type="success"
- size="small"
- @click="allClick('修改库区')"
- :disabled="editDisabled || selectionMultilist.length == 0"
- >修改库区</el-button
- >
- <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="editDisabled"
- >导入库区</el-button
- >
- <el-button
- v-if="reservoirArea == 1"
- type="success"
- size="small"
- @click="allClick('一键清空库区')"
- :disabled="editDisabled || selectionMultilist.length == 0"
- >一键清空库区</el-button
- >
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="采购信息" name="payment_details">
- <avue-crud
- :option="optionPaymentDetails"
- ref="payment_details"
- :data="form.shipVOList"
- :key="key"
- @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)"
- @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 274.2)"
- >
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="历史记录" name="outbound_records">
- <avue-crud
- :option="optionOutboundRecords"
- ref="outbound_records"
- :data="form.historyList"
- :key="key"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 274.3)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 274.3)"
- >
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="入库工单" @onClose="onClose()"></report-dialog>
- <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>
- </div>
- <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation"> 点击下载<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="批量修改库区" append-to-body :visible.sync="diaVisible" width="300px" :close-on-click-modal="false" v-dialog-drag>
- <span>
- <dic-select
- v-if="diaVisible"
- :key="form.storageId"
- v-model="fixForm.reservoirAreaName"
- placeholder="库区"
- label="cname"
- res="records"
- :url="'/blade-sales-part/reservoirarea/list?current=1&size=5&storageId=' + form.storageId"
- :filterable="true"
- :remote="true"
- dataName="cname"
- @selectChange="dicChange('reservoirAreaName', $event)"
- :slotRight="true"
- rightLabel="balanceQuantity"
- ></dic-select>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="diaVisible = false" size="mini">取 消</el-button>
- <el-button type="primary" @click="allClick('修改')" size="mini">修 改</el-button>
- </span>
- </el-dialog>
- <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
- <el-dialog title="导入明细" append-to-body :visible.sync="excelBox2" width="555px" :close-on-click-modal="false" v-dialog-drag>
- <avue-form
- v-if="excelBox2"
- :option="excelOption2"
- v-model="excelForm2"
- table-loading="excelLoading"
- :upload-before="uploadBefore2"
- :upload-after="uploadAfter2"
- >
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation2"> 点击下载<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 dicSelect from "@/components/dicSelect/main";
- import {
- getDetails,
- tradingBox,
- submit,
- warehousingComplete,
- revoke,
- goodsDetail,
- dotList,
- getWarehouseKeeper,
- dotListAll,
- removeItem,
- submitList
- } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import { itemRemove } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
- import { dateFormat } from "@/util/date";
- import { getToken } from "@/util/auth";
- import { getMenu } from "@/api/system/menu";
- import reportDialog from "@/components/report-dialog/main";
- import { corpsDescListAll } from "@/api/tirePartsMall/salesManagement/saleOrder";
- import { isProcurement } from "@/api/basicData/configuration";
- import viewArea from "./components/viewArea.vue";
- export default {
- name: "detailsPage",
- data() {
- return {
- reservoirArea: 0,
- diaVisible: false,
- fixForm: {
- reservoirAreaId: null,
- reservoirAreaName: null,
- balanceQuantity: 0
- },
- numberDecimal: 0,
- // 上传附件的需要参数
- loadingBtn: false,
- filesList: [],
- switchDialog: false,
- values: "",
- editButton: false,
- editDisabled: false,
- activeName: "sale_detail",
- isrowAdd: true,
- excelBox: false,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "导入明细",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "上传中,请稍等",
- accept: ".xls,.xlsx",
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-sales-part/ship/import-item"
- }
- ]
- },
- excelForm: {},
- excelBox2: false,
- excelOption2: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "导入明细",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "上传中,请稍等",
- accept: ".xls,.xlsx",
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-sales-part/ship/importReservoirArea"
- }
- ]
- },
- excelForm2: {},
- form: {
- shipItemsList: [],
- shipVOList: [],
- historyList: []
- },
- key: 0,
- optionForm: {
- disabled: false,
- menuBtn: false,
- labelWidth: 100,
- columnBtn: false,
- span: 8,
- column: [
- {
- label: "业务对象",
- prop: "customerId",
- disabled: true,
- type: "select",
- props: {
- label: "cname",
- value: "id"
- },
- dicData: [],
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ],
- change: ({ value, column }) => {
- if (this.form.billno.indexOf("TK") != -1) {
- this.corpsDescListAllfun("KH");
- } else {
- this.corpsDescListAllfun("GYS");
- }
- }
- },
- {
- label: "仓库",
- prop: "storageId",
- overHidden: true,
- type: "select",
- dicUrl: "/api/blade-sales-part/storageDesc/listAll",
- disabled: true,
- props: {
- label: "cname",
- value: "id"
- },
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- }
- ]
- // change:(data)=>{
- // // console.log(this.$refs);
- // getWarehouseKeeper({salesCompanyId:this.form.storageId}).then((res)=>{
- // console.log(res.data.data);
- // this.form.stockClerkId = res.data.data[0].id
- // })
- // }
- },
- {
- 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: "goodsTotalNum",
- search: false,
- overHidden: true,
- disabled: true
- // width: 120,
- // rules: [
- // {
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }
- // ]
- },
- {
- label: "入库数量",
- prop: "sendTotalNum",
- overHidden: true,
- disabled: true
- },
- {
- label: "业务日期",
- prop: "createTime",
- disabled: false,
- 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: "入库单号",
- prop: "billno",
- disabled: true
- },
- {
- label: "来源单号",
- prop: "ordNo",
- disabled: true
- },
- {
- label: "备注",
- disabled: false,
- prop: "remarks",
- type: "textarea",
- span: 16,
- minRows: 1
- }
- ]
- },
- formContacts: {},
- optionContacts: {},
- optionContactsBack: {
- dialogDrag: true,
- cancelBtn: false,
- disabled: false,
- align: "center",
- index: true,
- addBtn: false, // 新增按钮
- refreshBtn: false,
- editBtn: false, // 修改按钮
- delBtn: false, //删除按钮
- border: true,
- menuWidth: 250,
- stripe: true,
- span: 8,
- addRowBtn: false,
- menu: true, // 是否员操作栏
- dialogTop: 25,
- dialogWidth: "80%",
- showSummary: true,
- saveBtn: false, // 表格弹窗保存按钮
- cellBtn: false, // 行编辑
- selection: true,
- sumColumnList: [
- {
- name: "sendNum",
- type: "sum"
- },
- {
- name: "goodsNum",
- type: "sum"
- }
- ],
- column: [
- {
- label: "商品名称",
- prop: "goodsId",
- width: 200,
- overHidden: true,
- hide: true,
- showColumn: false
- // disabled: false,
- // filterable: true,
- // remote: true,
- // type: 'select',
- // 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,
- disabled: false,
- filterable: true
- },
- // {
- // label: "价格",
- // prop: "price",
- // disabled: false,
- // ovrHidden: true,
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }, {
- // validator: (rule, value, callback) => {
- // if (value < 0) {
- // callback(new Error("单价不能小于0"));
- // } else {
- // callback();
- // }
- // },
- // trigger: "blur"
- // }]
- // },
- {
- label: "到货数量",
- prop: "sendNum",
- width: 100,
- // cell: true,
- disabled: false,
- overHidden: true,
- rules: [
- {
- required: true,
- message: " ",
- trigger: "blur"
- },
- {
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback(new Error("实际数量不能小于0"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }
- ]
- },
- {
- label: "批次号",
- cell: true,
- width: 120,
- prop: "dot",
- type: "select",
- disabled: false,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: "dot",
- value: "dot"
- },
- overHidden: true
- },
- {
- label: "商品编码",
- prop: "goodsNo",
- overHidden: true,
- disabled: false,
- width: 140
- // }, {
- // label: "品牌",
- // prop: 'brandId',
- // width: 100,
- // overHidden: true,
- // disabled: false,
- // type: 'select',
- // props: {
- // label: 'cname',
- // value: 'id'
- // },
- // dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP'
- // }, {
- },
- {
- label: "品牌",
- prop: "brandName",
- disabled: false,
- overHidden: true
- },
- {
- label: "规格型号",
- prop: "propertyName",
- overHidden: true,
- disabled: false
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }]
- },
- {
- label: "花纹",
- prop: "pattern",
- disabled: false,
- overHidden: true
- },
- {
- label: "商品描述",
- prop: "goodsDescription",
- disabled: false,
- overHidden: true
- },
- {
- label: "单位",
- prop: "units",
- type: "select",
- disabled: false,
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit"
- },
- {
- label: "入库数量",
- prop: "goodsNum",
- disabled: true,
- ovrHidden: true
- },
- {
- label: "备注",
- cell: true,
- prop: "remarks",
- width: 150,
- span: 16,
- disabled: false,
- overHidde: true
- }
- ]
- },
- selectionMultilist: [], // 多选数据
- optionPaymentDetails: {},
- optionPaymentDetailsBack: {
- align: "center",
- addBtn: false,
- refreshBtn: false,
- editBtn: false,
- delBtn: false,
- border: true,
- menuWidth: 120,
- stripe: true,
- index: true,
- menu: false,
- column: [
- {
- label: "入库单号",
- prop: "billno",
- disabled: true
- },
- {
- label: "来源单号",
- prop: "ordNo",
- disabled: true
- },
- // {
- // label: "业务来源",
- // prop: "stockTime",
- // type: "date",
- // searchRange: true,
- // searchDefaultTime: [
- // "00:00:00",
- // "23:59:59"
- // ],
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
- // overHidden: true
- // },
- {
- label: "地址",
- prop: "recAddress",
- overHidden: true
- },
- {
- prop: "contacts",
- label: "联系人",
- overHidden: true
- },
- {
- prop: "phone",
- label: "电话",
- overHidden: true
- },
- {
- prop: "remarks",
- label: "备注",
- disabled: false,
- overHidden: true
- }
- ]
- },
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- align: "center",
- addBtn: false,
- refreshBtn: false,
- editBtn: false,
- delBtn: false,
- border: true,
- menuWidth: 120,
- index: true,
- stripe: true,
- menu: false,
- column: [
- {
- prop: "operatorName",
- label: "操作人",
- overHidden: true,
- showColumn: false,
- width: 120
- },
- {
- prop: "operateStatus",
- label: "状态",
- overHidden: true
- },
- {
- prop: "operateTime",
- label: "时间",
- overHidden: true,
- searchDefaultTime: ["00:00:00", "23:59:59"],
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }
- ]
- }
- };
- },
- props: {
- detailData: Object
- },
- async created() {
- this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
- console.log(value);
- this.values = value;
- console.log("this.formContacts.goodsId", this.formContacts.goodsId);
- if (this.formContacts.goodsId !== value) {
- dotListAll({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- (this.formContacts.price = res.data.data[0].inventoryCostPrice), console.log(res);
- });
- goodsDetail({ id: value, stock: this.form.storageId ? this.form.storageId : "" }).then(res => {
- console.log(this.form.storageId);
- this.formContacts.goodsNo = res.data.data.code;
- this.formContacts.brandId = res.data.data.brandId;
- this.formContacts.brandName = res.data.data.brandName;
- this.formContacts.propertyName = res.data.data.specificationAndModel;
- this.formContacts.pattern = res.data.data.brandItem;
- this.formContacts.goodsDescription = res.data.data.goodsDescription;
- this.formContacts.units = res.data.data.unit;
- this.findObject(this.optionContacts.column, "goodsNum").disabled = true;
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContacts.column, "dot").disabled = true;
- } else {
- this.findObject(this.optionContacts.column, "dot").disabled = false;
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- console.log("dot", res);
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
- });
- }
- });
- }
- };
- this.optionContacts = await this.getColumnData(this.getColumnName(274.1), this.optionContactsBack);
- isProcurement({ param: "whether.model" }).then(res => {
- if (res.data.data == 1) {
- this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
- }
- });
- isProcurement({ param: "reservoir.area" }).then(res => {
- this.reservoirArea = res.data.data;
- });
- this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
- console.log(value);
- console.log(this.form.storageId);
- this.values = value;
- if (this.formContacts.goodsId !== value) {
- dotListAll({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.formContacts.price = res.data.data[0].inventoryCostPrice;
- });
- goodsDetail({ id: value, stock: this.form.storageId ? this.form.storageId : "" }).then(res => {
- this.formContacts.goodsNo = res.data.data.code;
- this.formContacts.brandId = res.data.data.brandId;
- this.formContacts.brandName = res.data.data.brandName;
- this.formContacts.propertyName = res.data.data.specificationAndModel;
- this.formContacts.pattern = res.data.data.brandItem;
- this.formContacts.goodsDescription = res.data.data.goodsDescription;
- this.formContacts.units = res.data.data.unit;
- this.findObject(this.optionContacts.column, "goodsNum").disabled = true;
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContacts.column, "dot").disabled = true;
- } else {
- this.findObject(this.optionContacts.column, "dot").disabled = false;
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- console.log("567");
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
- });
- }
- });
- }
- };
- this.optionPaymentDetails = await this.getColumnData(this.getColumnName(274.2), this.optionPaymentDetailsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(274.3), this.optionOutboundRecordsBack);
- this.key++;
- if (this.detailData.id) {
- this.editButton = true;
- this.editDisabled = true;
- this.optionForm.disabled = true;
- this.refresh(this.detailData.id, true);
- }
- 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");
- isProcurement({ param: "number.decimal" }).then(res => {
- this.numberDecimal = res.data.data ? Number(res.data.data) : 0;
- });
- },
- components: {
- reportDialog,
- dicSelect,
- viewArea
- },
- 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;
- });
- });
- } else {
- row.historyList = [];
- // row.dot = null;
- row.sendNum = 0;
- }
- },
- rowArea(row, index) {
- this.$refs.viewArea.openDialog(this.form, row, index);
- },
- areaData(row, index) {
- this.form.shipItemsList[index].reservoirAreaId = row.reservoirAreaId;
- this.form.shipItemsList[index].reservoirAreaName = row.reservoirAreaName;
- this.form.shipItemsList[index].dot = row.dot;
- this.form.shipItemsList[index].sendNum = row.sendNum;
- this.form.shipItemsList[index].historyList = row.historyList;
- if (row.historyList.filter(item => !item.id).length) {
- submitList(this.form.shipItemsList).then(res => {
- this.form.shipItemsList = res.data.data;
- });
- }
- },
- allClick(name) {
- if (name == "修改库区") {
- for (let item of this.selectionMultilist) {
- if (item.historyList.length > 0) {
- return this.$message.error("请选择没有选择库区的数据");
- }
- }
- this.fixForm = {
- reservoirAreaId: null,
- reservoirAreaName: null,
- balanceQuantity: 0
- };
- this.diaVisible = true;
- }
- if (name == "修改") {
- for (let item of this.selectionMultilist) {
- this.form.shipItemsList.forEach(row => {
- if (item.id == row.id) {
- row.historyList.push({
- reservoirAreaId: this.fixForm.reservoirAreaId,
- reservoirAreaName: this.fixForm.reservoirAreaName,
- balanceQuantity: this.fixForm.balanceQuantity,
- quantity: row.goodsNum
- });
- row.sendNum = row.goodsNum;
- }
- });
- }
- submitList(this.form.shipItemsList).then(res => {
- this.form.shipItemsList = res.data.data;
- });
- this.diaVisible = false;
- }
- if (name == "导入库区") {
- for (let item of this.form.shipItemsList) {
- if (item.historyList.length) {
- return this.$message.error("请清空库区");
- }
- }
- this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
- this.excelBox2 = true;
- }
- if (name == "一键清空库区") {
- this.$confirm("是否一键清空库区?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let ids = [];
- for (let row of this.selectionMultilist) {
- if (row.historyList.filter(item => item.id).length) {
- for (let item of row.historyList) {
- ids.push(item.id);
- }
- } else {
- row.historyList = [];
- // row.dot = null;
- row.sendNum = 0;
- }
- }
- if (ids.length) {
- itemRemove({ ids: ids.join(",") }).then(res => {
- for (let row of this.selectionMultilist) {
- if (row.historyList.filter(item => item.id).length) {
- row.historyList = [];
- // row.dot = null;
- row.sendNum = 0;
- }
- }
- this.$message.success("操作成功");
- });
- }
- });
- }
- },
- dicChange(name, row) {
- if (name == "reservoirAreaName") {
- if (row) {
- this.fixForm.reservoirAreaId = row.id;
- this.fixForm.balanceQuantity = row.balanceQuantity;
- } else {
- this.fixForm.reservoirAreaId = null;
- this.fixForm.reservoirAreaName = null;
- this.fixForm.balanceQuantity = row.balanceQuantity;
- }
- }
- },
- rowDicChange(name, row, el) {
- if (name == "reservoirAreaName") {
- if (row) {
- el.reservoirAreaId = row.id;
- } else {
- el.reservoirAreaId = null;
- el.reservoirAreaName = null;
- }
- }
- },
- rowAdd(row, score) {
- console.log(123214);
- this.optionContactsBack.column.forEach(its => {
- if (
- its.prop == "goodsNum" ||
- its.prop == "goodsNo" ||
- its.prop == "brandId" ||
- its.prop == "propertyName" ||
- its.prop == "pattern" ||
- its.prop == "goodsDescription" ||
- its.prop == "units"
- ) {
- this.$set(its, "disabled", true);
- } else {
- this.$set(its, "disabled", false);
- }
- });
- this.$refs.formContacts.rowAdd();
- },
- derivation() {
- window.open(`/api/blade-sales-part/ship/export-item?${this.website.tokenHeader}=${getToken()}`);
- },
- uploadAfter(res, done, loading, column) {
- if (res instanceof Array) {
- this.form.shipItemsList = this.form.shipItemsList.concat(res);
- }
- this.excelBox = false;
- loading = false;
- done();
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- derivation2() {
- window.open(`/api/blade-sales-part/ship/exportReservoirArea?id=${this.form.id}&${this.website.tokenHeader}=${getToken()}`);
- },
- uploadAfter2(res, done, loading, column) {
- this.refresh(this.form.id);
- this.excelBox2 = false;
- loading = false;
- done();
- },
- uploadBefore2(file, done, loading) {
- done();
- loading = true;
- },
- //撤销
- revoke() {
- this.$refs["form"].validate((valid, done) => {
- console.log(valid, "valid");
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: "加载中",
- spinner: "el-icon-loading",
- background: "rgba(255,255,255,0.7)"
- });
- revoke({
- ...this.form,
- bizTypeName: this.form.id ? this.form.bizTypeName : "SHGD"
- })
- .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();
- });
- }
- });
- },
- //编辑
- 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;
- }
- goodsDetail({ id: this.form.shipItemsList[0].goodsId, stock: this.form.storageId ? this.form.storageId : "" }).then(res => {
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContacts.column, "dot").disabled = true;
- } else {
- this.findObject(this.optionContacts.column, "dot").disabled = false;
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
- });
- }
- });
- },
- complete() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- if (this.reservoirArea == 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.customerName = this.form.$customerId;
- submit({
- ...this.form,
- bizTypeName: this.form.id ? this.form.bizTypeName : "SHGD"
- })
- .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: this.form.id ? this.form.bizTypeName : "SHGD"
- })
- .then(res => {
- this.refresh(res.data.data.id);
- this.$message.success("入库完成");
- })
- .finally(() => {
- loading.close();
- });
- }
- })
- .catch(() => {
- loading.close();
- });
- }
- });
- },
- //修改提交触发
- editCustomer() {
- if (this.form.shipItemsList.length == 0) {
- return this.$message.warning("请明细不能为空");
- }
- 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)"
- });
- this.form.customerName = this.form.$customerId;
- this.form.shipItemsList.map(item => {
- item.$cellEdit = false;
- });
- submit({
- ...this.form,
- bizTypeName: this.form.id ? this.form.bizTypeName : "SHGD",
- 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();
- });
- },
- // 获取业务对象
- corpsDescListAllfun(corpType) {
- corpsDescListAll({ corpType: corpType, enableOrNot: 1 }).then(res => {
- this.optionForm.column[0].dicData = res.data.data;
- });
- },
- //编辑
- rowEdit(row, index) {
- if (row.$cellEdit) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- // this.confirmEditing()
- dotList({
- storageId: this.form.storageId,
- goodsId: row.goodsId
- }).then(res => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data;
- // console.log(this.dicData)
- });
- console.log(this.optionContacts, 802);
- // this.$refs.formContacts.rowEdit(row, index)
- },
- 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("操作成功!");
- }
- });
- },
- // 明细信息多选
- selectionContacts(list) {
- this.selectionMultilist = list;
- },
- // 一键删除
- batchDelete() {
- if (this.selectionMultilist.length == 0) {
- return this.$message.warning("请选择要删除的数据");
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let multiList = this.selectionMultilist;
- let arr = this.form.shipItemsList;
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
- let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
- // 把选中的删除掉
- multiList.forEach(item => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1);
- }
- }
- });
- // 有id 的处理
- if (itemsWithId.length != 0) {
- removeItem(arrIds.join(",")).then(res => {
- this.$message.success("操作成功!");
- });
- }
- });
- },
- rowSave(form, done, loading) {
- console.log(form);
- done(form);
- },
- // 更新数据后确定触发该事件
- rowUpdate(form, index, done, loading) {
- console.log(form);
- done(form);
- },
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //自定义列保存
- 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("保存成功");
- //关闭窗口b
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- 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;
- }
- },
- backToList(type) {
- this.$emit("backToList", type);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|