|
@@ -292,6 +292,181 @@
|
|
|
</template>
|
|
|
<template #commodity>
|
|
|
<div
|
|
|
+ style="width: 100%; padding: 15px; border: 1px solid #eee"
|
|
|
+ v-if="
|
|
|
+ formData.data.purchaseProductList &&
|
|
|
+ formData.data.purchaseProductList.length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-row
|
|
|
+ style="
|
|
|
+ margin-bottom: 15px;
|
|
|
+ background: #eeeeee;
|
|
|
+ font-weight: 700;
|
|
|
+ padding: 10px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-col :span="14">货品信息</el-col>
|
|
|
+ <el-col :span="4"
|
|
|
+ >订单总数:{{ formData.data.purchaseProductList.length }}</el-col
|
|
|
+ >
|
|
|
+ <el-col :span="6">订单总金额:{{ getTotalAmount() }}</el-col>
|
|
|
+ </el-row>
|
|
|
+ <template
|
|
|
+ v-for="(item, index) in formData.data.purchaseProductList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-table
|
|
|
+ :data="item.purchaseProductMountingsList"
|
|
|
+ :style="
|
|
|
+ index !== formData.data.purchaseProductList.length - 1
|
|
|
+ ? 'margin-bottom: 15px'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- :span-method=" ({ rowIndex, columnIndex }) =>
|
|
|
+ objectSpanMethod(rowIndex, columnIndex, item) " -->
|
|
|
+ <el-table-column label="货品信息" align="left">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <div style="width: 50px; height: 50px">
|
|
|
+ <img
|
|
|
+ v-if="row.fileUrl"
|
|
|
+ :src="row.fileUrl"
|
|
|
+ class="pic"
|
|
|
+ @click="onPicture(row.fileUrl)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div style="margin-left: 20px">
|
|
|
+ <div>{{ row.productName }}</div>
|
|
|
+ <div style="display: flex; color: #999999">
|
|
|
+ <span
|
|
|
+ >类型:
|
|
|
+ {{
|
|
|
+ dictValueLabel(row.productType, productType)
|
|
|
+ }}</span
|
|
|
+ ><span style="margin-left: 20px"
|
|
|
+ >尺寸:{{ row.productModel }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="数量"
|
|
|
+ align="left"
|
|
|
+ prop="quantity"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%" class="removePadding">
|
|
|
+ <el-form-item
|
|
|
+ :prop="
|
|
|
+ 'purchaseProductList.' +
|
|
|
+ index +
|
|
|
+ '.purchaseProductMountingsList.' +
|
|
|
+ $index +
|
|
|
+ '.quantity'
|
|
|
+ "
|
|
|
+ :rules="rules.quantity"
|
|
|
+ :inline-message="true"
|
|
|
+ @change="
|
|
|
+ () => {
|
|
|
+ return changeProductMaterial(index, $index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
+ v-model="row.quantity"
|
|
|
+ placeholder="请输入数量"
|
|
|
+ :precision="0"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="单价"
|
|
|
+ align="left"
|
|
|
+ prop="price"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%" class="removePadding">
|
|
|
+ <el-form-item
|
|
|
+ :prop="
|
|
|
+ 'purchaseProductList.' +
|
|
|
+ index +
|
|
|
+ '.purchaseProductMountingsList.' +
|
|
|
+ $index +
|
|
|
+ '.price'
|
|
|
+ "
|
|
|
+ :rules="rules.price"
|
|
|
+ :inline-message="true"
|
|
|
+ @change="
|
|
|
+ () => {
|
|
|
+ return changeProductMaterial(index, $index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
+ v-model="row.price"
|
|
|
+ placeholder="请输入单价"
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="金额小计"
|
|
|
+ align="left"
|
|
|
+ width="140"
|
|
|
+ prop="amount"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作" align="center" width="100">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div v-if="$index === 0">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ text
|
|
|
+ @click="handleHandover(item, index)"
|
|
|
+ >备注</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ text
|
|
|
+ @click="handleMaterial(index)"
|
|
|
+ >添加配件</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ @click="handleRemove(index, $index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <!-- <div
|
|
|
style="width: 100%"
|
|
|
v-if="
|
|
|
formData.data.purchaseProductList &&
|
|
@@ -511,7 +686,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</template>
|
|
|
<template #otherCharge>
|
|
|
<div style="width: 100%">
|
|
@@ -1899,6 +2074,36 @@ const remoteMethod = (keyword) => {
|
|
|
}
|
|
|
return;
|
|
|
};
|
|
|
+
|
|
|
+const objectSpanMethod = (rowIndex, columnIndex, item) => {
|
|
|
+ if (columnIndex === 3) {
|
|
|
+ if (rowIndex === 0) {
|
|
|
+ return {
|
|
|
+ rowspan: item.purchaseProductMountingsList.length,
|
|
|
+ colspan: 1,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 1,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getTotalAmount = () => {
|
|
|
+ const total = formData.data.purchaseProjectList.reduce(
|
|
|
+ (val, x) => (val += Number(x.amount)),
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ if (total) {
|
|
|
+ return parseFloat(formData.data.amount - total).toFixed(2);
|
|
|
+ } else {
|
|
|
+ if (formData.data.amount) {
|
|
|
+ return parseFloat(formData.data.amount).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|