|
|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<ele-modal :visible.sync="visible" :title="title" width="80vw" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="create-form">
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="90px"
|
|
|
+ class="create-form"
|
|
|
+ >
|
|
|
<el-row :gutter="15">
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="销售订单号:">
|
|
|
@@ -9,43 +15,72 @@
|
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="交付要求:">
|
|
|
- <DictSelection dictName="紧急程度" clearable v-model="form.deliveryRequirements">
|
|
|
+ <DictSelection
|
|
|
+ dictName="紧急程度"
|
|
|
+ clearable
|
|
|
+ v-model="form.deliveryRequirements"
|
|
|
+ >
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="订单类型:">
|
|
|
- <el-select v-model="form.orderType" placeholder="请选择" @change="chooseType" style="width: 100%">
|
|
|
- <el-option v-for="item in typeList" :key="item.id" :label="item.label" :value="item.id">
|
|
|
+ <el-select
|
|
|
+ v-model="form.orderType"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="chooseType"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="按单按库:">
|
|
|
- <DictSelection dictName="按单按库" clearable v-model="form.orderLibraryType">
|
|
|
+ <DictSelection
|
|
|
+ dictName="按单按库"
|
|
|
+ clearable
|
|
|
+ v-model="form.orderLibraryType"
|
|
|
+ >
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="客户名称:">
|
|
|
- <el-input clearable v-model="form.customerName" :disabled="form.orderType == 3" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.customerName"
|
|
|
+ :disabled="form.orderType == 3"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="客户简称:">
|
|
|
- <el-input clearable v-model="form.simpleName" :disabled="form.orderType == 3" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.simpleName"
|
|
|
+ :disabled="form.orderType == 3"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
+ <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="客户代号:">
|
|
|
- <el-input clearable v-model="form.serialNo" :disabled="form.orderType == 3" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.serialNo"
|
|
|
+ :disabled="form.orderType == 3"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
-
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="业务员:">
|
|
|
<el-input clearable v-model="form.salesman" />
|
|
|
@@ -53,8 +88,14 @@
|
|
|
</el-col>
|
|
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
|
|
<el-form-item label="交付日期:" prop="deliveryTime">
|
|
|
- <el-date-picker :picker-options="pickerOptions" style="width: 100%" v-model="form.deliveryTime" type="date"
|
|
|
- placeholder="选择日期" value-format="yyyy-MM-dd">
|
|
|
+ <el-date-picker
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.deliveryTime"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -85,20 +126,37 @@
|
|
|
<el-table-column label="单重" align="center" prop="productUnitWeight">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="重量单位" align="center" prop="weightUnit">
|
|
|
-
|
|
|
</el-table-column>
|
|
|
<el-table-column label="交付数量" align="center" prop="contractNum">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item label-width="0px" :prop="'productInfoList.' + scope.$index + '.contractNum'" :rules="{
|
|
|
- required: true,
|
|
|
- message: '请输入交付数量',
|
|
|
- trigger: 'blur'
|
|
|
- }">
|
|
|
- <el-input v-model.number="scope.row.contractNum" size="small" oninput="value=value.replace(/[^\d]/g,'')"
|
|
|
- style="width: 100%" placeholder="输入数量" @input="inputNumber(scope.row, scope.$index)"></el-input>
|
|
|
+ <el-form-item
|
|
|
+ label-width="0px"
|
|
|
+ :prop="'productInfoList.' + scope.$index + '.contractNum'"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请输入交付数量',
|
|
|
+ trigger: 'blur'
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model.number="scope.row.contractNum"
|
|
|
+ size="small"
|
|
|
+ oninput="value=value.replace(/[^\d]/g,'')"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="输入数量"
|
|
|
+ @input="inputNumber(scope.row, scope.$index)"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="单位" align="center" prop="productName">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span v-if="clientEnvironmentId == 4">
|
|
|
+ {{ row.productName.includes('板材') ? '块' : '模' }}
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="交付重量" align="center" prop="productWeight">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span>{{ row.productWeight ? row.productWeight : '-' }}</span>
|
|
|
@@ -106,7 +164,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="70">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="handleDeleteItem(scope.$index)" v-if="!scope.row.id">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="handleDeleteItem(scope.$index)"
|
|
|
+ v-if="!scope.row.id"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -122,10 +185,15 @@
|
|
|
</template>
|
|
|
|
|
|
<!-- 选择产品 -->
|
|
|
- <EquipmentDialog ref="equipmentRefs" @choose="confirmChoose" :selectList="form.productInfoList.filter(
|
|
|
- (i) => !disabledList.find((p) => p.productCode === i.productCode)
|
|
|
- )
|
|
|
- ">
|
|
|
+ <EquipmentDialog
|
|
|
+ ref="equipmentRefs"
|
|
|
+ @choose="confirmChoose"
|
|
|
+ :selectList="
|
|
|
+ form.productInfoList.filter(
|
|
|
+ (i) => !disabledList.find((p) => p.productCode === i.productCode)
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
</EquipmentDialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
@@ -186,9 +254,12 @@ export default {
|
|
|
// 是否开启响应式布局
|
|
|
styleResponsive() {
|
|
|
return this.$store.state.theme.styleResponsive;
|
|
|
+ },
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
}
|
|
|
},
|
|
|
- created() { },
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
open(row) {
|
|
|
this.visible = true;
|
|
|
@@ -268,7 +339,7 @@ export default {
|
|
|
},
|
|
|
// 确定选择
|
|
|
confirmChoose(list) {
|
|
|
- console.log('444',list)
|
|
|
+ console.log('444', list);
|
|
|
console.log(
|
|
|
'this.form.productInfoList',
|
|
|
deepClone(this.form.productInfoList)
|
|
|
@@ -288,8 +359,8 @@ export default {
|
|
|
categoryId: item.id,
|
|
|
productCode: item.code,
|
|
|
productName: item.name,
|
|
|
- productUnitWeight: item.netWeight,
|
|
|
- weightUnit: item.weightUnit,
|
|
|
+ productUnitWeight: item.netWeight,
|
|
|
+ weightUnit: item.weightUnit,
|
|
|
model: item.modelType,
|
|
|
specification: item.specification,
|
|
|
brandNo: item.brandNum
|
|
|
@@ -317,9 +388,7 @@ export default {
|
|
|
this.form.productInfoList[i].productCode,
|
|
|
del[j].productCode
|
|
|
);
|
|
|
- if (
|
|
|
- this.form.productInfoList[i].productCode === del[j].productCode
|
|
|
- ) {
|
|
|
+ if (this.form.productInfoList[i].productCode === del[j].productCode) {
|
|
|
this.form.productInfoList.splice(i, 1);
|
|
|
break;
|
|
|
}
|
|
|
@@ -337,19 +406,11 @@ export default {
|
|
|
},
|
|
|
|
|
|
inputNumber(row, index) {
|
|
|
-
|
|
|
const pos = this.form.productInfoList;
|
|
|
if (pos[index].productUnitWeight) {
|
|
|
- const number = multiply(
|
|
|
- row.contractNum,
|
|
|
- row.productUnitWeight
|
|
|
- )
|
|
|
+ const number = multiply(row.contractNum, row.productUnitWeight);
|
|
|
|
|
|
- this.$set(
|
|
|
- pos[index],
|
|
|
- 'productWeight',
|
|
|
- number
|
|
|
- );
|
|
|
+ this.$set(pos[index], 'productWeight', number);
|
|
|
}
|
|
|
}
|
|
|
}
|