12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004 |
- <template>
- <div class="tenant">
- <!-- <Banner /> -->
- <div class="content">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- highlight-current-row
- :selectConfig="selectConfig"
- :table-events="{
- //element talbe事件都能传
- select: selectRow,
- 'select-all': selectRow,
- }"
- :action-list="[
- {
- text: '出货',
- disabled: selectData.length === 0,
- action: () => openModalOne(),
- },
- {
- text: '产品装箱',
- action: () => openModal(),
- },
- ]"
- @get-list="getList"
- >
- <template #code="{ item }">
- <div>
- <div
- v-for="(item, index) in getData(item.codeAPName, 'code')"
- :key="index"
- >
- {{ item }}
- </div>
- </div>
- </template>
- <template #productName="{ item }">
- <div>
- <div
- v-for="(item, index) in getData(item.codeAPName, 'productName')"
- :key="index"
- >
- {{ item }}
- </div>
- </div>
- </template>
- </byTable>
- </div>
- <el-dialog
- title="产品装箱"
- v-model="dialogVisible"
- width="800"
- v-loading="loading"
- >
- <el-form
- :model="formData.data"
- :rules="rules"
- ref="formDom"
- label-position="top"
- >
- <el-row :gutter="10">
- <el-col :span="8">
- <el-form-item label="客户名称" prop="customerId">
- <el-select
- v-model="formData.data.customerId"
- placeholder="请选择"
- @change="handleChangeCustomer"
- filterable
- style="width: 100%"
- >
- <el-option
- v-for="item in customerList"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="选择合同" prop="contractIds">
- <el-select
- v-model="formData.data.contractIds"
- placeholder="请选择"
- @change="handleChangeContract"
- filterable
- style="width: 100%"
- multiple
- >
- <el-option
- v-for="item in contractData"
- :label="item.code"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="合同明细" prop="contractProductData">
- <el-table
- :data="formData.data.contractProductData"
- @select="handleSelectProduct"
- @select-all="handleSelectProduct"
- >
- <el-table-column type="selection" label="" width="50" />
- <el-table-column prop="contractCode" label="合同编码" />
- <el-table-column prop="productName" label="产品名称" />
- <el-table-column prop="cpQuantity" label="合同数量" />
- <el-table-column prop="waitQuantity" label="待装箱数量" />
- <el-table-column prop="quantity" label="装箱数量" min-width="150">
- <template #default="{ row, $index }">
- <el-form-item
- :prop="'contractProductData.' + $index + '.quantity'"
- :inline-message="true"
- >
- <el-input-number
- v-model="row.quantity"
- :precision="4"
- :controls="false"
- :min="0"
- />
- </el-form-item>
- </template>
- </el-table-column>
- </el-table>
- <el-button
- type="primary"
- style="margin-top: 10px; width: 100%"
- @click="handleClickPacking"
- >
- 装箱
- </el-button>
- </el-form-item>
- <el-form-item label="装箱明细" prop="packDetailList">
- <div
- class="box"
- v-for="(item, index) in formData.data.packDetailList"
- :key="index"
- >
- <div ref="">箱规</div>
- <el-row :gutter="10">
- <el-col :span="5">
- <el-form-item
- label="箱数"
- :prop="'packDetailList.' + index + '.packQuantity'"
- :rules="rules.packQuantity"
- >
- <el-input-number
- v-model="item.packQuantity"
- :precision="0"
- :controls="false"
- :min="1"
- placeholder="请输入"
- onmousewheel="return false;"
- @change="(val) => handleChangePackQuantity(val, index)"
- />
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item
- label="净重(kg)"
- :prop="'packDetailList.' + index + '.netWeight'"
- :rules="rules.netWeight"
- >
- <el-input-number
- v-model="item.netWeight"
- :precision="2"
- :controls="false"
- :min="0"
- placeholder="请输入"
- onmousewheel="return false;"
- />
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item
- label="毛重(kg)"
- :prop="'packDetailList.' + index + '.roughWeight'"
- :rules="rules.roughWeight"
- >
- <el-input-number
- v-model="item.roughWeight"
- :precision="2"
- :controls="false"
- :min="0"
- placeholder="请输入"
- onmousewheel="return false;"
- />
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-row>
- <el-form-item label="尺寸(cm³)" required>
- <el-col :span="1"></el-col>
- <el-col :span="7">
- <el-form-item
- label=""
- :prop="'packDetailList.' + index + '.boxLong'"
- :rules="rules.boxLong"
- >
- <el-input-number
- v-model="item.boxLong"
- placeholder="长"
- :precision="2"
- :controls="false"
- :min="0"
- onmousewheel="return false;"
- ></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="1" style="text-align: center"> * </el-col>
- <el-col :span="7">
- <el-form-item
- label=""
- :prop="'packDetailList.' + index + '.boxWide'"
- :rules="rules.boxWide"
- >
- <el-input-number
- v-model="item.boxWide"
- placeholder="宽"
- :precision="2"
- :controls="false"
- :min="0"
- onmousewheel="return false;"
- ></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="1" style="text-align: center"> * </el-col>
- <el-col :span="7">
- <el-form-item
- label=""
- :prop="'packDetailList.' + index + '.boxHigh'"
- :rules="rules.boxHigh"
- >
- <el-input-number
- v-model="item.boxHigh"
- placeholder="高"
- :precision="2"
- :controls="false"
- :min="0"
- onmousewheel="return false;"
- ></el-input-number>
- </el-form-item>
- </el-col>
- </el-form-item>
- </el-row>
- </el-col>
- </el-row>
- <div class="line"></div>
- <el-form-item label="关联合同产品">
- <div class="flex-box">
- <div
- class="item"
- v-for="(product, j) in item.packDetailProductList"
- :key="j"
- >
- <div>合同编码:{{ product.contractCode }}</div>
- <div>产品名称:{{ product.productName }}</div>
- <div>每箱数量:{{ product.quantity }}</div>
- </div>
- </div>
- </el-form-item>
- <div
- class="bottom-arrow"
- v-show="!item.isShow"
- @click="item.isShow = !item.isShow"
- >
- <span style="margin-right: 5px"> 自定义装箱明细</span>
- <el-icon><ArrowDownBold /></el-icon>
- </div>
- <div
- class="bottom-arrow"
- v-show="item.isShow"
- @click="item.isShow = !item.isShow"
- >
- <span style="margin-right: 5px"> 收起</span>
- <el-icon><ArrowUpBold /></el-icon>
- </div>
- <el-form-item prop="packDetailGoodsList" v-show="item.isShow">
- <el-button
- type="primary"
- style="margin-bottom: 10px"
- @click="handleCustomPush(index)"
- >
- 添加行
- </el-button>
- <el-table :data="item.packDetailGoodsList">
- <el-table-column label="货物描述">
- <template #default="{ row, $index }">
- <el-form-item
- :prop="[
- 'packDetailList',
- index,
- 'packDetailGoodsList',
- $index,
- 'remark',
- ]"
- :rules="rules.remark"
- :inline-message="true"
- >
- <el-input v-model="row.remark" placeholder="请输入" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="单位" width="150">
- <template #default="{ row, $index }">
- <el-form-item
- :prop="[
- 'packDetailList',
- index,
- 'packDetailGoodsList',
- $index,
- 'unit',
- ]"
- :rules="rules.unit"
- :inline-message="true"
- >
- <el-input v-model="row.unit" placeholder="请输入" />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="数量" width="150">
- <template #default="{ row, $index }">
- <el-form-item
- :prop="[
- 'packDetailList',
- index,
- 'packDetailGoodsList',
- $index,
- 'quantity',
- ]"
- :rules="rules.quantityOne"
- :inline-message="true"
- >
- <el-input-number
- v-model="row.quantity"
- :precision="4"
- :controls="false"
- :min="0"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="zip" label="操作" width="100">
- <template #default="{ $index }">
- <el-button
- type="primary"
- link
- @click="handleCustomRemove(index, $index)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-form-item>
- </div>
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="handleClose" size="large">取 消</el-button>
- <el-button
- type="primary"
- @click="submitForm()"
- size="large"
- :loading="submitLoading"
- >
- 确 定
- </el-button>
- </template>
- </el-dialog>
- <el-dialog
- title="合并出货"
- v-model="dialogVisibleOne"
- width="400"
- v-loading="loadingOne"
- >
- <byForm
- :formConfig="formConfig"
- :formOption="formOption"
- v-model="formData.dataOne"
- :rules="rules"
- ref="byform"
- >
- </byForm>
- <template #footer>
- <el-button @click="dialogVisibleOne = false" size="large"
- >取 消</el-button
- >
- <el-button
- type="primary"
- @click="submitFormOne()"
- size="large"
- :loading="submitLoading"
- >
- 确 定
- </el-button>
- </template>
- </el-dialog>
- </div>
- </template>
-
- <script setup>
- /* eslint-disable vue/no-unused-components */
- import { ElMessage, ElMessageBox } from "element-plus";
- import byTable from "@/components/byTable/index";
- import byForm from "@/components/byForm/index";
- import FileUpload from "@/components/FileUpload/index";
- import { computed, defineComponent, ref } from "vue";
- import { getToken } from "@/utils/auth";
- const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
- const headers = ref({ Authorization: "Bearer " + getToken() });
- const uploadData = ref({});
- const loading = ref(false);
- const loadingOne = ref(false);
- const submitLoading = ref(false);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 3,
- pageNum: 1,
- pageSize: 10,
- status: "",
- },
- });
- let dialogVisible = ref(false);
- let dialogVisibleOne = ref(false);
- let modalType = ref("add");
- let fileList = ref([]);
- let rules = ref({
- contractIds: [{ required: true, message: "请选择合同", trigger: "change" }],
- packQuantity: [{ required: true, message: "请输入箱数", trigger: "blur" }],
- netWeight: [{ required: true, message: "请输入净重", trigger: "blur" }],
- roughWeight: [{ required: true, message: "请输入毛重", trigger: "blur" }],
- boxLong: [{ required: true, message: "请输入长", trigger: "blur" }],
- boxWide: [{ required: true, message: "请输入宽", trigger: "blur" }],
- boxHigh: [{ required: true, message: "请输入高", trigger: "blur" }],
- quantity: [{ required: true, message: "请输入装箱数量", trigger: "blur" }],
- quantityOne: [{ required: true, message: "请输入数量", trigger: "blur" }],
- unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
- remark: [{ required: true, message: "请输入货物描述", trigger: "blur" }],
- contractId: [{ required: true, message: "请选择主合同", trigger: "change" }],
- });
- const { proxy } = getCurrentInstance();
- const selectConfig = reactive([
- {
- label: "出货状态",
- prop: "shipmentStatus",
- data: [
- {
- label: "未出货",
- value: "0",
- },
- {
- label: "已出货",
- value: "1",
- },
- ],
- },
- ]);
- const config = computed(() => {
- return [
- {
- type: "selection",
- attrs: {
- checkAtt: "isCheck",
- },
- },
- {
- attrs: {
- label: "合同号",
- prop: "codeAPName",
- slot: "code",
- },
- },
- {
- attrs: {
- label: "产品名称",
- prop: "codeAPName",
- slot: "productName",
- },
- },
- {
- attrs: {
- label: "总箱数",
- prop: "packQuantity",
- width: 90,
- },
- },
- {
- attrs: {
- label: "净重",
- prop: "netWeight",
- width: 90,
- },
- render(netWeight) {
- return netWeight + "kg";
- },
- },
- {
- attrs: {
- label: "毛重",
- prop: "roughWeight",
- width: 90,
- },
- render(roughWeight) {
- return roughWeight + "kg";
- },
- },
- {
- attrs: {
- label: "长",
- prop: "boxLong",
- width: 90,
- },
- render(boxLong) {
- return boxLong + "cm";
- },
- },
- {
- attrs: {
- label: "宽",
- prop: "boxWide",
- width: 90,
- },
- render(boxWide) {
- return boxWide + "cm";
- },
- },
- {
- attrs: {
- label: "高",
- prop: "boxHigh",
- width: 90,
- },
- render(boxHigh) {
- return boxHigh + "cm";
- },
- },
- {
- attrs: {
- label: "总体积",
- prop: "bomVolume",
- width: 120,
- },
- render(bomVolume) {
- return bomVolume + "m³";
- },
- },
- {
- attrs: {
- label: "出货状态",
- prop: "shipmentStatus",
- width: 90,
- },
- render(status) {
- return status == 1 ? "已出货" : status == 0 ? "未出货" : "";
- },
- },
- {
- attrs: {
- label: "出货时间",
- prop: "shipmentTime",
- width: 155,
- },
- },
- {
- attrs: {
- label: "操作",
- width: "90",
- align: "center",
- },
- // 渲染 el-button,一般用在最后一列。
- renderHTML(row) {
- return [
- // {
- // attrs: {
- // label: "打印",
- // type: "primary",
- // text: true,
- // },
- // el: "button",
- // click() {
- // getDtl(row);
- // },
- // },
- // {
- // attrs: {
- // label: "删除",
- // type: "primary",
- // text: true,
- // disabled: row.status != 30,
- // },
- // el: "button",
- // click() {
- // ElMessageBox.confirm(
- // "此操作将永久作废该数据, 是否继续?",
- // "提示",
- // {
- // confirmButtonText: "确定",
- // cancelButtonText: "取消",
- // type: "warning",
- // }
- // ).then(() => {
- // // 删除
- // proxy
- // .post("/subscribeDetail/edit", {
- // ...row,
- // status: 99,
- // })
- // .then((res) => {
- // ElMessage({
- // message: "作废成功",
- // type: "success",
- // });
- // getList();
- // });
- // });
- // },
- // },
- ];
- },
- },
- ];
- });
- const formDom = ref(null);
- let formData = reactive({
- data: {},
- dataOne: {},
- });
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- rules: [],
- });
- const byform = ref(null);
- const treeData = ref([]);
- const formConfig = reactive([
- {
- type: "select",
- prop: "contractId",
- label: "主合同",
- required: true,
- data: [],
- },
- ]);
- const getList = async (req) => {
- selectData.value = [];
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/packDetail/page", sourceList.value.pagination)
- .then((message) => {
- sourceList.value.data = message.rows.map((x) => ({
- ...x,
- isCheck: x.shipmentStatus == 1 ? false : true,
- }));
- sourceList.value.pagination.total = message.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- const openModal = () => {
- modalType.value = "add";
- formData.data = {
- packDetailList: [],
- contractIds: [],
- };
- dialogVisible.value = true;
- handleChangeCustomer("");
- };
- const openModalOne = () => {
- formData.dataOne = {
- ids: [],
- contractId: "",
- };
- let ids = []; //合同id
- let idsOne = []; //包装id
- const list = selectData.value;
- for (let i = 0; i < list.length; i++) {
- const e = list[i];
- ids = [...ids, ...e.contractIds.split(",")];
- idsOne.push(e.id);
- }
- formData.dataOne.ids = idsOne;
- proxy.post(`/contract/getByIds`, ids).then((res) => {
- formConfig[0].data = res.map((x) => ({
- label: x.code,
- value: x.id,
- }));
- dialogVisibleOne.value = true;
- });
- };
- const submitForm = () => {
- formDom.value.validate((vaild) => {
- if (vaild) {
- if (!formData.data.packDetailList.length > 0) {
- return ElMessage({
- message: "请添加装箱明细!",
- type: "info",
- });
- }
- submitLoading.value = true;
- loadingOne.value = true;
- for (let i = 0; i < formData.data.packDetailList.length; i++) {
- const e = formData.data.packDetailList[i];
- e.bomVolume = (e.boxLong * e.boxWide * e.boxHigh) / 1000000;
- }
- formData.data.contractIds = formData.data.contractIds.join(",");
- proxy.post("/pack/" + modalType.value, formData.data).then(
- (res) => {
- ElMessage({
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
- type: "success",
- });
- dialogVisible.value = false;
- submitLoading.value = false;
- loadingOne.value = false;
- getList();
- },
- (err) => {
- submitLoading.value = false;
- loading.value = false;
- }
- );
- }
- });
- };
- const submitFormOne = () => {
- byform.value.handleSubmit((valid) => {
- loading.value = true;
- submitLoading.value = true;
- proxy.post("/packDetail/shipment", formData.dataOne).then(
- (res) => {
- ElMessage({
- message: "出货成功",
- type: "success",
- });
- dialogVisibleOne.value = false;
- submitLoading.value = false;
- loading.value = false;
- getList();
- selectData.value = [];
- },
- (err) => {
- submitLoading.value = false;
- loading.value = false;
- }
- );
- });
- };
- const selectData = ref([]);
- const selectRow = (data) => {
- selectData.value = data;
- };
- const selectProductData = ref([]);
- const handleSelectProduct = (data) => {
- selectProductData.value = data;
- };
- const handleClickPacking = () => {
- if (selectProductData.value.length > 0) {
- const list = selectProductData.value;
- for (let i = 0; i < list.length; i++) {
- const e = list[i];
- if (!e.quantity) {
- return ElMessage({
- message: "请输入装箱数量",
- type: "info",
- });
- }
- }
- for (let i = 0; i < list.length; i++) {
- const e = list[i];
- for (let j = 0; j < formData.data.contractProductData.length; j++) {
- const jele = formData.data.contractProductData[j];
- if (e.id === jele.id && e.quantity > Number(jele.waitQuantity)) {
- return ElMessage({
- message: "装箱数量不可大于袋装箱数量",
- type: "info",
- });
- }
- }
- }
- const packDetailProductList = list.map((x) => ({
- contractCode: x.contractCode,
- contractId: x.contractId,
- contractProductId: x.id,
- quantity: x.quantity,
- productId: x.productId,
- productName: x.productName,
- }));
- const customerId = formData.data.customerId ? formData.data.customerId : "";
- const contractIds = formData.data.contractIds
- ? formData.data.contractIds.join(",")
- : "";
- let item = {
- customerId: customerId,
- contractIds: contractIds,
- packQuantity: 1,
- netWeight: null,
- roughWeight: null,
- boxLong: null,
- boxWide: null,
- boxHigh: null,
- bomVolume: "",
- remark: "",
- packDetailGoodsList: [],
- packDetailProductList: packDetailProductList,
- isShow: false,
- };
- formData.data.packDetailList.push(item);
- handleChangePackQuantity(
- item.packQuantity,
- formData.data.packDetailList.length - 1
- );
- selectProductData.value = [];
- } else {
- return ElMessage({
- message: "请选择产品 !",
- type: "info",
- });
- }
- };
- const handleChangePackQuantity = (val, index) => {
- const obj = {};
- for (let i = 0; i < formData.data.contractProductData.length; i++) {
- const e = formData.data.contractProductData[i];
- obj[e.contractId + "_" + e.productId + ""] =
- Number(e.cpQuantity) - Number(e.sumPackQuantity);
- }
- // 计算数量 即装箱数量 * 箱数 新增字段放在最外层
- for (let i = 0; i < formData.data.packDetailList.length; i++) {
- const ele = formData.data.packDetailList[i];
- for (let j = 0; j < ele.packDetailProductList.length; j++) {
- const jele = ele.packDetailProductList[j];
- ele[jele.contractId + "_" + jele.productId + ""] =
- Number(ele.packQuantity) * jele.quantity;
- }
- }
- // 计算新的待装箱数量
- for (let i = 0; i < formData.data.packDetailList.length; i++) {
- const e = formData.data.packDetailList[i];
- for (const key in obj) {
- if (e.hasOwnProperty(key)) {
- obj[key] = obj[key] - e[key];
- if (obj[key] < 0) {
- e.packQuantity = null;
- handleChangePackQuantity(null, index);
- return ElMessage({
- message: "装箱数量 * 箱数不可大于待装箱数量",
- type: "info",
- });
- }
- }
- }
- }
- // 赋值
- for (let i = 0; i < formData.data.contractProductData.length; i++) {
- const e = formData.data.contractProductData[i];
- for (const key in obj) {
- if (e.contractId + "_" + e.productId + "" === key) {
- e.waitQuantity = obj[key];
- }
- }
- }
- // }
- };
- const handleCustomPush = (index) => {
- formData.data.packDetailList[index].packDetailGoodsList.push({
- unit: "",
- quantity: "",
- remark: "",
- });
- };
- const handleCustomRemove = (index, sonIndex) => {
- formData.data.packDetailList[index].packDetailGoodsList.splice(sonIndex, 1);
- };
- const customerList = ref([]);
- const getSelectData = () => {
- proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- customerList.value = res.rows.map((item) => {
- return {
- ...item,
- label: item.name,
- value: item.id,
- };
- });
- });
- };
- const contractData = ref([]);
- const handleChangeCustomer = (val) => {
- proxy
- .get(`/contract/getNoPackContractByCustomerId?customerId=${val}`)
- .then((res) => {
- contractData.value = res.data;
- formData.data.contractIds = [];
- });
- };
- const handleChangeContract = (val) => {
- const customerId = formData.data.customerId ? formData.data.customerId : "";
- proxy
- .get(
- `/contractProduct/getNoPackContractProductById?customerId=${customerId}&contractIds=${val}`
- )
- .then((res) => {
- formData.data.contractProductData = res.data.map((x) => ({
- ...x,
- waitQuantity: Number(x.cpQuantity) - Number(x.sumPackQuantity),
- quantity: null,
- }));
- handleChangePackQuantity();
- });
- };
- const getData = (data, type) => {
- if (!data) return [];
- const arr = data.split(",");
- if (arr && arr.length > 0) {
- const arrOne = [];
- for (let i = 0; i < arr.length; i++) {
- const e = arr[i];
- if (type === "code") {
- arrOne.push(e.split("_")[0]);
- } else if (type === "productName") {
- arrOne.push(e.split("_")[1]);
- }
- }
- return arrOne;
- }
- return [];
- };
- const handleClose = () => {
- dialogVisible.value = false;
- selectProductData.value = [];
- };
- getSelectData();
- getList();
- </script>
-
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- :deep(.el-collapse-item__header) {
- background-color: #fde6c8;
- border: none;
- }
- :deep(.el-collapse-item__wrap) {
- background-color: #fde6c8;
- border: none;
- }
- .box {
- padding: 15px;
- background: #fde6c8;
- border: 1px solid #7fb5e3;
- margin-bottom: 10px;
- .flex-box {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- .item {
- width: 50%;
- div {
- line-height: 22px;
- }
- }
- }
- .line {
- width: 100%;
- height: 1px;
- background: #7fb5e3;
- margin: 20px 0;
- }
- .bottom-arrow {
- text-align: center;
- cursor: pointer;
- color: #0084ff;
- }
- }
- </style>
|