|
@@ -303,6 +303,137 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog :title="'合同上传'" v-model="uploadDialog" width="700px" destroy-on-close>
|
|
|
+ <byForm :formConfig="uploadFormConfig" :formOption="formOption" v-model="uploadFormData.data" :rules="uploadRules" ref="uploadFormDom"
|
|
|
+ v-loading="formLoading">
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="uploadDialog =false" size="default" v-debounce>取 消</el-button>
|
|
|
+ <el-button @click="submitUpload" type="primary" size="default" v-debounce>提 交</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="'销售出库'" v-model="salesOutBoundDialog" width="80%" destroy-on-close>
|
|
|
+ <el-tabs v-model="activeName" type="card" class="demo-tabs">
|
|
|
+ <el-tab-pane label="销售出库" name="1">
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="出库记录" name="2">
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <byForm :formConfig="salesOutBoundFormConfig" :formOption="formOption" v-model="salesOutBoundFormData.data" :rules="salesOutBoundRules"
|
|
|
+ ref="salesOutBoundFormDom" v-loading="formLoading">
|
|
|
+ <template #commodity>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-button @click="submitSalesOutBoundOne(true)" type="primary" size="default" plain v-debounce>申请特批</el-button>
|
|
|
+ <el-table :data="salesOutBoundFormData.data.outboundRecordList" style="width: 100%; ">
|
|
|
+ <el-table-column label="商品图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="productName" label="商品信息" min-width="250">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%;line-height:22px">
|
|
|
+ <div>
|
|
|
+ 分类:{{row.productClassifyName}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 编码:{{row.productCode}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 名称:{{row.productName}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 颜色:{{row.productColor}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 净重: {{row.productNetWeight}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 单位:{{row.productUnit}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="productName" label="商品名称" min-width="150" />
|
|
|
+ <el-table-column prop="productCode" label="商品编码" width="200" />
|
|
|
+ <el-table-column label="规格尺寸 (cm)" width="130">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productColor" label="颜色" width="150" />
|
|
|
+ <el-table-column prop="productFrontalTexture" label="纹路" width="130"
|
|
|
+ :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" />
|
|
|
+ <el-table-column prop="productNetWeight" label="净重" width="100" />
|
|
|
+ <el-table-column prop="productUnit" label="单位" width="100" />
|
|
|
+ <el-table-column label="订单数量" width="100" prop="orderQuantity" />
|
|
|
+ <el-table-column label="单价" width="100" prop="price" />
|
|
|
+ <el-table-column label="已出库数量" width="100" prop="saleOutboundQuantity" fixed="right" />
|
|
|
+ <el-table-column prop="quantity" label="出库数量" width="140" fixed="right">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item :prop="'outboundRecordList.' + $index + '.quantity'" :rules="salesOutBoundRules.quantity" :inline-message="true"
|
|
|
+ class="margin-b-0">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
+ :controls="false" :min="0" @change="totalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="小计" width="100" prop="amount" fixed="right" />
|
|
|
+ <el-table-column label="备注" min-width="200" prop="remark" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #commodityOne>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-table :data="salesOutBoundFormData.data.recordList" style="width: 100%; " :span-method="objectSpanMethod">
|
|
|
+ <el-table-column label="出库时间" width="160" prop="createTime" fixed="left" />
|
|
|
+ <el-table-column label="商品图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="openImg(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productName" label="商品名称" min-width="150" />
|
|
|
+ <el-table-column prop="productCode" label="商品编码" width="200" />
|
|
|
+ <el-table-column label="规格尺寸 (cm)" width="130">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productColor" label="颜色" width="150" />
|
|
|
+ <el-table-column prop="productFrontalTexture" label="纹路" width="130"
|
|
|
+ :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" />
|
|
|
+ <el-table-column prop="productNetWeight" label="净重" width="100" />
|
|
|
+ <el-table-column prop="productUnit" label="单位" width="100" />
|
|
|
+ <el-table-column label="出库数量" width="100" prop="quantity" fixed="right" />
|
|
|
+ <el-table-column label="备注" min-width="200" prop="remark" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer v-if="activeName=='1'">
|
|
|
+ <el-button @click="salesOutBoundDialog =false" size="default" v-debounce>取 消</el-button>
|
|
|
+ <el-button @click="submitSalesOutBound(false)" type="primary" size="default" v-debounce>提 交</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -317,11 +448,15 @@ import ContractPDFOne from "@/components/PDF/contractPDFOne.vue";
|
|
|
import ContractPDFOneNew from "@/components/PDF/contractPDFOneNew.vue";
|
|
|
import $bus from "@/bus/index.js";
|
|
|
import moment from "moment";
|
|
|
+import { reactiveComputed } from "@vueuse/core";
|
|
|
const route = useRoute();
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const frontLinesData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["front_lines"]
|
|
|
+);
|
|
|
const contractTag = computed(
|
|
|
() => proxy.useUserStore().allDict["contract_prod_tag"]
|
|
|
);
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
const accountCurrency = ref([]);
|
|
|
const tradeMethods = ref([]);
|
|
|
const corporationList = ref([]);
|
|
@@ -473,17 +608,17 @@ const selectConfig = computed(() => {
|
|
|
prop: "status",
|
|
|
data: status.value,
|
|
|
},
|
|
|
- {
|
|
|
- label: "工厂",
|
|
|
- prop: "companyId",
|
|
|
- data: companyData.value,
|
|
|
- },
|
|
|
// {
|
|
|
- // label: "生产状态",
|
|
|
- // prop: "produceStatus",
|
|
|
- // data: produceStatusData.value,
|
|
|
+ // label: "工厂",
|
|
|
+ // prop: "companyId",
|
|
|
+ // data: companyData.value,
|
|
|
// },
|
|
|
{
|
|
|
+ label: "生产状态",
|
|
|
+ prop: "produceStatus",
|
|
|
+ data: produceStatusData.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "业务员",
|
|
|
prop: "userId",
|
|
|
data: userList.value,
|
|
@@ -587,13 +722,13 @@ const config = computed(() => {
|
|
|
width: 140,
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "工厂",
|
|
|
- prop: "companyName",
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // label: "工厂",
|
|
|
+ // prop: "companyName",
|
|
|
+ // width: 120,
|
|
|
+ // },
|
|
|
+ // },
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "订单归属",
|
|
@@ -881,33 +1016,20 @@ const config = computed(() => {
|
|
|
},
|
|
|
}
|
|
|
: {},
|
|
|
- // row.status == 30 &&
|
|
|
- // row.outboundStatus == 0 &&
|
|
|
- // row.produceStatus == 2
|
|
|
- // ? {
|
|
|
- // attrs: {
|
|
|
- // label: "销售出库",
|
|
|
- // type: "primary",
|
|
|
- // text: true,
|
|
|
- // },
|
|
|
- // el: "button",
|
|
|
- // click() {
|
|
|
- // proxy
|
|
|
- // .msgConfirm()
|
|
|
- // .then((res) => {
|
|
|
- // proxy
|
|
|
- // .post("/contract/saleOutbound", {
|
|
|
- // id: row.id,
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // proxy.msgTip("操作成功", 1);
|
|
|
- // getList();
|
|
|
- // });
|
|
|
- // })
|
|
|
- // .catch((err) => {});
|
|
|
- // },
|
|
|
- // }
|
|
|
- // : {},
|
|
|
+ // && row.outboundStatus == 0 && row.produceStatus == 2
|
|
|
+ row.status == 30 && 10 > row.produceStatus && row.produceStatus >= 2
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "销售出库",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ handleSalesOutBound(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
row.status == 0
|
|
|
? {
|
|
|
attrs: {
|
|
@@ -1058,6 +1180,20 @@ const config = computed(() => {
|
|
|
},
|
|
|
}
|
|
|
: {},
|
|
|
+
|
|
|
+ row.status == 30
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "合同上传",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickUpload(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
];
|
|
|
},
|
|
|
},
|
|
@@ -1618,14 +1754,14 @@ const formSearchConfig = computed(() => {
|
|
|
data: status.value,
|
|
|
clearable: true,
|
|
|
},
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- label: "工厂",
|
|
|
- prop: "companyId",
|
|
|
- itemWidth: 50,
|
|
|
- data: companyData.value,
|
|
|
- clearable: true,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // label: "工厂",
|
|
|
+ // prop: "companyId",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // data: companyData.value,
|
|
|
+ // clearable: true,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "select",
|
|
|
label: "业务员",
|
|
@@ -1677,16 +1813,16 @@ const moreSearchReset = () => {
|
|
|
const productionFormDom = ref(null);
|
|
|
const productionDialog = ref(false);
|
|
|
const productionFormConfig = computed(() => [
|
|
|
- {
|
|
|
- type: "treeSelect",
|
|
|
- prop: "produceCompanyId",
|
|
|
- label: "工厂",
|
|
|
- data: companyData.value,
|
|
|
- propsTreeLabel: "deptName",
|
|
|
- propsTreeValue: "deptId",
|
|
|
- itemWidth: 100,
|
|
|
- disabled: true,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "treeSelect",
|
|
|
+ // prop: "produceCompanyId",
|
|
|
+ // label: "工厂",
|
|
|
+ // data: companyData.value,
|
|
|
+ // propsTreeLabel: "deptName",
|
|
|
+ // propsTreeValue: "deptId",
|
|
|
+ // itemWidth: 100,
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "input",
|
|
|
itemType: "textarea",
|
|
@@ -1722,7 +1858,7 @@ const clickDistributeProduction = (row) => {
|
|
|
formData.data = {
|
|
|
contractId: row.id,
|
|
|
deliveryPeriod: "",
|
|
|
- produceCompanyId: row.companyId,
|
|
|
+ // produceCompanyId: row.companyId,
|
|
|
rejectRemark: row.rejectRemark,
|
|
|
orderDistributeStatus: row.orderDistributeStatus,
|
|
|
};
|
|
@@ -1879,6 +2015,323 @@ const submitTermination = () => {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const uploadFormData = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const clickUpload = (row) => {
|
|
|
+ let businessId = row.id;
|
|
|
+ uploadFormData.data = {
|
|
|
+ id: row.id,
|
|
|
+ contractFileList: [],
|
|
|
+ };
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [businessId] })
|
|
|
+ .then((fileObj) => {
|
|
|
+ if (fileObj[businessId] && fileObj[businessId].length > 0) {
|
|
|
+ uploadFormData.data.contractFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "10")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uploadFormData.data.contractFileList = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ uploadDialog.value = true;
|
|
|
+};
|
|
|
+const uploadFormDom = ref(null);
|
|
|
+const uploadDialog = ref(false);
|
|
|
+const uploadFormConfig = computed(() => [
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ prop: "contractFileList",
|
|
|
+ label: "合同上传",
|
|
|
+ },
|
|
|
+]);
|
|
|
+const uploadRules = ref({
|
|
|
+ contractFileList: [
|
|
|
+ { required: true, message: "请上传附件", trigger: "blur" },
|
|
|
+ ],
|
|
|
+});
|
|
|
+const submitUpload = () => {
|
|
|
+ uploadFormDom.value.handleSubmit(() => {
|
|
|
+ // if (
|
|
|
+ // !(uploadFormData.data.contractFileList && uploadFormData.data.contractFileList.length > 0)
|
|
|
+ // ) {
|
|
|
+ // return proxy.msgTip("请上传附件", 2);
|
|
|
+ // }
|
|
|
+ formLoading.value = true;
|
|
|
+ proxy.post("/contract/contractAttach", uploadFormData.data).then((res) => {
|
|
|
+ proxy.msgTip("操作成功");
|
|
|
+ formLoading.value = false;
|
|
|
+ uploadDialog.value = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const activeName = ref("1");
|
|
|
+const salesOutBoundFormData = reactive({
|
|
|
+ data: {},
|
|
|
+});
|
|
|
+const salesOutBoundFormDom = ref(null);
|
|
|
+const salesOutBoundDialog = ref(false);
|
|
|
+const salesOutBoundFormConfig = computed(() => [
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "商品信息",
|
|
|
+ haveLine: true,
|
|
|
+ isShow: activeName.value == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "commodity",
|
|
|
+ label: "",
|
|
|
+ isShow: activeName.value == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "出库总金额",
|
|
|
+ haveLine: true,
|
|
|
+ isShow: activeName.value == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ label: "出库总金额",
|
|
|
+ prop: "amount",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ isShow: activeName.value == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "出库记录",
|
|
|
+ haveLine: false,
|
|
|
+ isShow: activeName.value == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "commodityOne",
|
|
|
+ label: "",
|
|
|
+ isShow: activeName.value == "2",
|
|
|
+ },
|
|
|
+]);
|
|
|
+const salesOutBoundRules = ref({
|
|
|
+ fileList: [{ required: true, message: "请上传附件", trigger: "blur" }],
|
|
|
+});
|
|
|
+const handleSalesOutBound = (row) => {
|
|
|
+ activeName.value = "1";
|
|
|
+ proxy.post("/contract/detail", { id: row.id }).then((res) => {
|
|
|
+ salesOutBoundDialog.value = true;
|
|
|
+ salesOutBoundFormData.data = {
|
|
|
+ contractId: row.id,
|
|
|
+ outboundRecordList: res.contractProductList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ contractProductId: x.id,
|
|
|
+ orderQuantity: x.quantity,
|
|
|
+ quantity: null,
|
|
|
+ amount: "",
|
|
|
+ })),
|
|
|
+ amount: "",
|
|
|
+ };
|
|
|
+ let productIds;
|
|
|
+ if (
|
|
|
+ salesOutBoundFormData.data.outboundRecordList &&
|
|
|
+ salesOutBoundFormData.data.outboundRecordList.length > 0
|
|
|
+ ) {
|
|
|
+ productIds = salesOutBoundFormData.data.outboundRecordList.map(
|
|
|
+ (x) => x.productId
|
|
|
+ );
|
|
|
+ proxy.getFileData({
|
|
|
+ businessIdList: productIds,
|
|
|
+ data: salesOutBoundFormData.data.outboundRecordList,
|
|
|
+ att: "productId",
|
|
|
+ businessType: "0",
|
|
|
+ fileAtt: "fileList",
|
|
|
+ filePathAtt: "fileUrl",
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/contractOutboundRecords/page", {
|
|
|
+ contractId: row.id,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ })
|
|
|
+ .then((sonRes) => {
|
|
|
+ salesOutBoundFormData.data.recordList = sonRes.rows;
|
|
|
+ setTimeout(() => {
|
|
|
+ if (
|
|
|
+ salesOutBoundFormData.data.recordList &&
|
|
|
+ salesOutBoundFormData.data.recordList.length > 0
|
|
|
+ ) {
|
|
|
+ proxy.getFileData({
|
|
|
+ businessIdList: productIds,
|
|
|
+ data: salesOutBoundFormData.data.recordList,
|
|
|
+ att: "productId",
|
|
|
+ businessType: "0",
|
|
|
+ fileAtt: "fileList",
|
|
|
+ filePathAtt: "fileUrl",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const totalAmount = () => {
|
|
|
+ let money = 0;
|
|
|
+ if (
|
|
|
+ salesOutBoundFormData.data.outboundRecordList &&
|
|
|
+ salesOutBoundFormData.data.outboundRecordList.length > 0
|
|
|
+ ) {
|
|
|
+ for (
|
|
|
+ let i = 0;
|
|
|
+ i < salesOutBoundFormData.data.outboundRecordList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ salesOutBoundFormData.data.outboundRecordList[i].amount = parseFloat(
|
|
|
+ Number(salesOutBoundFormData.data.outboundRecordList[i].quantity) *
|
|
|
+ Number(salesOutBoundFormData.data.outboundRecordList[i].price)
|
|
|
+ ).toFixed(2);
|
|
|
+ money = parseFloat(
|
|
|
+ Number(money) +
|
|
|
+ Number(salesOutBoundFormData.data.outboundRecordList[i].amount)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ salesOutBoundFormData.data.amount = money;
|
|
|
+};
|
|
|
+
|
|
|
+const submitSalesOutBound = (flag) => {
|
|
|
+ salesOutBoundFormDom.value.handleSubmit(() => {
|
|
|
+ if (
|
|
|
+ salesOutBoundFormData.data.outboundRecordList &&
|
|
|
+ salesOutBoundFormData.data.outboundRecordList.length > 0
|
|
|
+ ) {
|
|
|
+ let total = 0;
|
|
|
+ for (
|
|
|
+ let i = 0;
|
|
|
+ i < salesOutBoundFormData.data.outboundRecordList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ const ele = salesOutBoundFormData.data.outboundRecordList[i];
|
|
|
+ total += Number(ele.quantity);
|
|
|
+ if (
|
|
|
+ Number(ele.quantity) + Number(ele.saleOutboundQuantity) >
|
|
|
+ Number(ele.orderQuantity)
|
|
|
+ ) {
|
|
|
+ return proxy.msgTip("出库数量加已出库数量不能大于订单数量", 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!(total > 0)) {
|
|
|
+ return proxy.msgTip("出库数量不能为0", 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const data = {
|
|
|
+ contractId: salesOutBoundFormData.data.contractId,
|
|
|
+ outboundRecordList: salesOutBoundFormData.data.outboundRecordList.map(
|
|
|
+ (x) => ({
|
|
|
+ contractProductId: x.contractProductId,
|
|
|
+ quantity: x.quantity,
|
|
|
+ })
|
|
|
+ ),
|
|
|
+ };
|
|
|
+ formLoading.value = true;
|
|
|
+ if (flag) {
|
|
|
+ proxy
|
|
|
+ .msgConfirm()
|
|
|
+ .then((res) => {
|
|
|
+ proxy
|
|
|
+ .post("/flowProcess/initiate", {
|
|
|
+ flowKey: "sales_outbound_approved_flow",
|
|
|
+ data,
|
|
|
+ skipSetData: true,
|
|
|
+ })
|
|
|
+ .then(
|
|
|
+ (res) => {
|
|
|
+ proxy.msgTip("操作成功");
|
|
|
+ formLoading.value = false;
|
|
|
+ salesOutBoundDialog.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ formLoading.value = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ proxy.post("/contract/saleOutbound", data).then(
|
|
|
+ (res) => {
|
|
|
+ proxy.msgTip("操作成功");
|
|
|
+ formLoading.value = false;
|
|
|
+ salesOutBoundDialog.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const submitSalesOutBoundOne = (row) => {
|
|
|
+ proxy.$router.replace({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "sales_outbound_approved_flow",
|
|
|
+ flowName: "销售出库特批申请",
|
|
|
+ businessId: salesOutBoundFormData.data.contractId,
|
|
|
+ random: proxy.random(),
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const flitterData = (arr) => {
|
|
|
+ let spanOneArr = [];
|
|
|
+ let concatOne = 0;
|
|
|
+ arr.forEach((item, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ spanOneArr.push(1);
|
|
|
+ } else {
|
|
|
+ //注意这里的quarterly是表格绑定的字段,根据自己的需求来改
|
|
|
+ if (item.recordId === arr[index - 1].recordId) {
|
|
|
+ //第一列需合并相同内容的判断条件
|
|
|
+ spanOneArr[concatOne] += 1;
|
|
|
+ spanOneArr.push(0);
|
|
|
+ } else {
|
|
|
+ spanOneArr.push(1);
|
|
|
+ concatOne = index;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ one: spanOneArr,
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
+const objectSpanMethod = ({ rowIndex, columnIndex }) => {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ const _row = flitterData(salesOutBoundFormData.data.recordList).one[
|
|
|
+ rowIndex
|
|
|
+ ];
|
|
|
+ const _col = _row > 0 ? 1 : 0;
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: _col,
|
|
|
+ };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|