|
@@ -20,12 +20,7 @@
|
|
|
>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <ws-form
|
|
|
- ref="deptBudgetList"
|
|
|
- :rules="mainReportAdd"
|
|
|
- :model="deptBudgetList"
|
|
|
- >
|
|
|
+ <ws-form ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
|
|
|
<div class="remark">
|
|
|
<h3>基本信息</h3>
|
|
|
<p style="color: #8890b1">
|
|
@@ -39,13 +34,13 @@
|
|
|
span="1"
|
|
|
prop="contractNo"
|
|
|
class="readonly"
|
|
|
+ required
|
|
|
>
|
|
|
<ws-input
|
|
|
v-model="deptBudgetList.contractNo"
|
|
|
placeholder="请输入合同编号"
|
|
|
maxlength="20"
|
|
|
size="small"
|
|
|
- :rules="ruleDeptBudget"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
|
|
@@ -58,7 +53,6 @@
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
<!--买方-->
|
|
|
<ws-form-item label="买方" span="1" prop="buyer" class="readonly">
|
|
|
<ws-input
|
|
@@ -88,17 +82,14 @@
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
- <!--货源地-->
|
|
|
- <ws-form-item label="货源地" span="1" prop="sourceGoods">
|
|
|
- <ws-input
|
|
|
- v-model="deptBudgetList.sourceGoods"
|
|
|
- placeholder="请输入货源地"
|
|
|
- maxlength="100"
|
|
|
- size="small"
|
|
|
- />
|
|
|
+ <ws-form-item label="交货方式" span="1" prop="seller" class="readonly">
|
|
|
+ <el-radio v-model="deptBudgetList.deliverType" label="1"
|
|
|
+ >我方自提</el-radio
|
|
|
+ >
|
|
|
+ <el-radio v-model="deptBudgetList.deliverType" label="2"
|
|
|
+ >对方送货</el-radio
|
|
|
+ >
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
<!--买方电话-->
|
|
|
<ws-form-item label="买方电话" span="1" prop="contractNo">
|
|
|
<ws-input
|
|
@@ -108,27 +99,6 @@
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
- <!--交货地-->
|
|
|
- <ws-form-item label="交货地" span="1" prop="placeDelivery">
|
|
|
- <ws-input
|
|
|
- v-model="deptBudgetList.placeDelivery"
|
|
|
- placeholder="请输入交货地"
|
|
|
- maxlength="100"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- </ws-form-item>
|
|
|
-
|
|
|
- <!--卖方电话-->
|
|
|
- <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
|
|
|
- <ws-input
|
|
|
- v-model="deptBudgetList.sellerPhone"
|
|
|
- placeholder="请输入卖方电话"
|
|
|
- maxlength="100"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- </ws-form-item>
|
|
|
-
|
|
|
<!--包装方式-->
|
|
|
<ws-form-item label="包装方式" span="1" prop="packingMethod">
|
|
|
<ws-select
|
|
@@ -146,17 +116,15 @@
|
|
|
/>
|
|
|
</ws-select>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
- <!--重量(吨)-->
|
|
|
- <ws-form-item label="重量(吨)" span="1" prop="weight">
|
|
|
+ <!--卖方电话-->
|
|
|
+ <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.weight"
|
|
|
- placeholder="请输入重量(吨)"
|
|
|
+ v-model="deptBudgetList.sellerPhone"
|
|
|
+ placeholder="请输入卖方电话"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
<!--验收方式-->
|
|
|
<ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
|
|
|
<el-select
|
|
@@ -227,12 +195,12 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
- <!--溢短装(%)-->
|
|
|
- <ws-form-item label="溢短装(%)" span="1" prop="overShort">
|
|
|
+ <!--重量(吨)-->
|
|
|
+ <ws-form-item label="重量(吨)" span="1" prop="weight">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.overShort"
|
|
|
- placeholder="请输入溢短装比例(%)"
|
|
|
+ @input="weightchange"
|
|
|
+ v-model="deptBudgetList.weight"
|
|
|
+ placeholder="请输入重量(吨)"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
|
/>
|
|
@@ -246,22 +214,15 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
- <!--合同单价(元/吨)-->
|
|
|
- <ws-form-item
|
|
|
- class="readonly"
|
|
|
- label="合同单价(元/吨)"
|
|
|
- span="1"
|
|
|
- prop="unitContractPrice"
|
|
|
- >
|
|
|
+ <!--溢短装(%)-->
|
|
|
+ <ws-form-item label="溢短装(%)" span="1" prop="overShort">
|
|
|
<ws-input
|
|
|
- v-model="deptBudgetList.unitContractPrice"
|
|
|
- placeholder="请输入合同单价"
|
|
|
+ v-model="deptBudgetList.overShort"
|
|
|
+ placeholder="请输入溢短装比例(%)"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
<!--交货日期(止)-->
|
|
|
<ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
|
|
|
<ws-date-picker
|
|
@@ -271,6 +232,20 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
+ <!--合同单价(元/吨)-->
|
|
|
+ <ws-form-item
|
|
|
+ class="readonly"
|
|
|
+ label="合同单价(元/吨)"
|
|
|
+ span="1"
|
|
|
+ prop="unitContractPrice"
|
|
|
+ >
|
|
|
+ <ws-input
|
|
|
+ v-model="deptBudgetList.unitContractPrice"
|
|
|
+ placeholder="请输入合同单价"
|
|
|
+ maxlength="100"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
|
|
|
<!--合同总价-->
|
|
|
<ws-form-item label="合同总价" span="1" prop="totalContractPrice">
|
|
@@ -281,7 +256,44 @@
|
|
|
size="small"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
-
|
|
|
+ <ws-form-item label="货源所在地区" span="1" prop="sourceGoods">
|
|
|
+ <el-cascader
|
|
|
+ :options="options_"
|
|
|
+ v-model="selectedOptions"
|
|
|
+ clearable
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择货源所在地区"
|
|
|
+ style="width: 200%"
|
|
|
+ @change="handleChange"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
+ <ws-form-item label="货源详细地址" span="1" prop="sourceGoods">
|
|
|
+ <ws-input
|
|
|
+ v-model="deptBudgetList.sourceGoods"
|
|
|
+ placeholder="请输入货源详细地址"
|
|
|
+ maxlength="20"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
+ <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
|
|
|
+ <el-cascader
|
|
|
+ :options="options_"
|
|
|
+ v-model="selectedOptions1"
|
|
|
+ clearable
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择交货所在地区"
|
|
|
+ style="width: 200%"
|
|
|
+ @change="handleChange1"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
+ <ws-form-item label="交货详细地址" span="1" prop="placeDelivery">
|
|
|
+ <ws-input
|
|
|
+ v-model="deptBudgetList.placeDelivery"
|
|
|
+ placeholder="请输入交货详细地址"
|
|
|
+ maxlength="20"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
<!--签订日期-->
|
|
|
<ws-form-item label="签订日期" span="1" prop="signingDate">
|
|
|
<ws-date-picker
|
|
@@ -291,16 +303,38 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
+ <ws-form-item
|
|
|
+ label="最终实际成交量(吨)"
|
|
|
+ span="1"
|
|
|
+ prop="finalTradingVolume"
|
|
|
+ >
|
|
|
+ <ws-input
|
|
|
+ v-model="deptBudgetList.finalTradingVolume"
|
|
|
+ placeholder="请输入最终实际成交量"
|
|
|
+ maxlength="100"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </ws-form-item>
|
|
|
+ <ws-form-item label="临时库负责人" span="1" prop="packingMethod">
|
|
|
+ <ws-select
|
|
|
+ v-model="deptBudgetList.packingMethod"
|
|
|
+ placeholder="请选择临时库负责人"
|
|
|
+ class="typeselect"
|
|
|
+ :value="value1"
|
|
|
+ @change="selectpackingMethod"
|
|
|
+ >
|
|
|
+ <ws-option
|
|
|
+ v-for="item in packtypeList"
|
|
|
+ :key="item.constKey"
|
|
|
+ :label="item.constValue"
|
|
|
+ :value="item.constValue"
|
|
|
+ />
|
|
|
+ </ws-select>
|
|
|
+ </ws-form-item>
|
|
|
</ws-info-table>
|
|
|
- </ws-form>
|
|
|
- <div class="wenzi">
|
|
|
- <h3>货物信息</h3>
|
|
|
- </div>
|
|
|
- <ws-form
|
|
|
- ref="deptBudgetList"
|
|
|
- :rules="ruleDeptBudget"
|
|
|
- :model="deptBudgetList"
|
|
|
- >
|
|
|
+ <div class="wenzi">
|
|
|
+ <h3>货物信息</h3>
|
|
|
+ </div>
|
|
|
<!--货物信息-->
|
|
|
|
|
|
<ws-info-table>
|
|
@@ -397,16 +431,10 @@
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
- </ws-form>
|
|
|
|
|
|
- <div class="wenzi">
|
|
|
- <h3>流程信息</h3>
|
|
|
- </div>
|
|
|
- <ws-form
|
|
|
- ref="deptBudgetList"
|
|
|
- :rules="ruleDeptBudget"
|
|
|
- :model="deptBudgetList"
|
|
|
- >
|
|
|
+ <div class="wenzi">
|
|
|
+ <h3>流程信息</h3>
|
|
|
+ </div>
|
|
|
<!--流程信息-->
|
|
|
|
|
|
<ws-info-table>
|
|
@@ -475,16 +503,10 @@
|
|
|
</ws-select>
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
- </ws-form>
|
|
|
|
|
|
- <div class="wenzi">
|
|
|
- <h3>备注信息</h3>
|
|
|
- </div>
|
|
|
- <ws-form
|
|
|
- ref="deptBudgetList"
|
|
|
- :rules="ruleDeptBudget"
|
|
|
- :model="deptBudgetList"
|
|
|
- >
|
|
|
+ <div class="wenzi">
|
|
|
+ <h3>备注信息</h3>
|
|
|
+ </div>
|
|
|
<!--备注信息-->
|
|
|
<ws-input
|
|
|
v-model="deptBudgetList.remarks"
|
|
@@ -528,6 +550,8 @@ import {
|
|
|
editxiala,
|
|
|
delxiala,
|
|
|
} from '@/model/contarct/index'
|
|
|
+import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
|
|
|
+import { dayjs, fmoney, EventBus } from 'base-core-lib'
|
|
|
import WsUpload from '@/components/WsUpload'
|
|
|
|
|
|
export default {
|
|
@@ -556,13 +580,21 @@ export default {
|
|
|
showType: true,
|
|
|
// 年
|
|
|
year: '',
|
|
|
+ options_: regionData,
|
|
|
+ selectedOptions: [],
|
|
|
+ selectedOptions1: [],
|
|
|
// 提交类型
|
|
|
submitType: true,
|
|
|
tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
|
|
|
|
|
|
packtypeList: [],
|
|
|
compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
- mainReportAdd: {},
|
|
|
+ rules: {
|
|
|
+ // contractNo: [
|
|
|
+ // { required: true, message: '请输入合同编号', trigger: 'blur' },
|
|
|
+ // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
|
|
|
+ // ],
|
|
|
+ },
|
|
|
appendixIdsAdd: '',
|
|
|
size: 10,
|
|
|
// uploadSuccess: {},
|
|
@@ -575,6 +607,8 @@ export default {
|
|
|
ChapterTwoList: [],
|
|
|
|
|
|
deptBudgetList: {
|
|
|
+ deliverType: '1',
|
|
|
+ finalTradingVolume: 0,
|
|
|
contractGoodsInfo: {
|
|
|
goodsName: '',
|
|
|
},
|
|
@@ -630,6 +664,15 @@ export default {
|
|
|
handleClose() {
|
|
|
this.dialogViewSpareMoney = false
|
|
|
},
|
|
|
+ handleChange(value) {
|
|
|
+ this.selectedOptions = value
|
|
|
+ },
|
|
|
+ handleChange1(value) {
|
|
|
+ this.selectedOptions1 = value
|
|
|
+ },
|
|
|
+ weightchange(e) {
|
|
|
+ this.deptBudgetList.finalTradingVolume = e
|
|
|
+ },
|
|
|
returnsales() {
|
|
|
this.$router.push({ path: 'purchaseContract' })
|
|
|
},
|
|
@@ -701,7 +744,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
submit() {
|
|
|
- console.log(this.deptBudgetList)
|
|
|
if (!this.deptBudgetList.contractNo) {
|
|
|
this.$message({
|
|
|
message: '请输入合同编号',
|
|
@@ -709,7 +751,6 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- console.log(this.deptBudgetList.contractNo.length)
|
|
|
if (
|
|
|
this.deptBudgetList.contractNo.length < 6 ||
|
|
|
this.deptBudgetList.contractNo.length > 20
|
|
@@ -823,14 +864,14 @@ export default {
|
|
|
|
|
|
if (!this.deptBudgetList.sourceGoods) {
|
|
|
this.$message({
|
|
|
- message: '请输入货源地!',
|
|
|
+ message: '请输入货源详细地址!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
if (!this.deptBudgetList.placeDelivery) {
|
|
|
this.$message({
|
|
|
- message: '请输入交货地!',
|
|
|
+ message: '请输入交货详细地址!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
@@ -1125,18 +1166,44 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ var that = this
|
|
|
this.$refs.deptBudgetList.validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.deptBudgetList.sourceProvince =
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
+ this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
|
|
|
+ this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
|
|
|
+ this.deptBudgetList.deliveryProvince =
|
|
|
+ CodeToText[this.selectedOptions1[0]]
|
|
|
+ this.deptBudgetList.deliveryCity =
|
|
|
+ CodeToText[this.selectedOptions1[1]]
|
|
|
+ this.deptBudgetList.deliveryArea =
|
|
|
+ CodeToText[this.selectedOptions1[2]]
|
|
|
this.deptBudgetList.compId = this.compId
|
|
|
this.deptBudgetList.contractType = 2
|
|
|
addList(this.deptBudgetList)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.$message.success('添加成功')
|
|
|
+ this.deptBudgetList = {
|
|
|
+ deliverType: '1',
|
|
|
+ finalTradingVolume: 0,
|
|
|
+ contractGoodsInfo: {
|
|
|
+ goodsName: '',
|
|
|
+ },
|
|
|
+ contractProcessInfo: {},
|
|
|
+ }
|
|
|
this.$router.push({ path: 'purchaseContract' })
|
|
|
})
|
|
|
+ .catch((req) => {
|
|
|
+ EventBus.$emit('error', req.message)
|
|
|
+ })
|
|
|
} else {
|
|
|
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
+ // for (let key in that.rules) {
|
|
|
+ // EventBus.$emit('error', that.rules[key][0].message)
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
@@ -1393,10 +1460,6 @@ export default {
|
|
|
.bg-bottom {
|
|
|
margin: 15px 0px;
|
|
|
}
|
|
|
-.wenzi {
|
|
|
- width: 70%;
|
|
|
- margin: 0 auto;
|
|
|
-}
|
|
|
.wenzi h3 {
|
|
|
display: inline-block;
|
|
|
left: 10px;
|