|
@@ -27,17 +27,178 @@
|
|
|
<span v-else-if="item.prop == 'tranPrice'">
|
|
<span v-else-if="item.prop == 'tranPrice'">
|
|
|
{{ formatPrice(row.tranPrice) }}
|
|
{{ formatPrice(row.tranPrice) }}
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'purchaseCost'">
|
|
|
|
|
+ {{ formatPrice(row.purchaseCost) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'devCost'">
|
|
|
|
|
+ {{ formatPrice(row.devCost) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'maintainCost'">
|
|
|
|
|
+ {{ formatPrice(row.maintainCost) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop == 'directCost'">
|
|
|
|
|
+ {{ formatPrice(row.directCost) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'prodClass'">
|
|
|
|
|
+ {{ selectDictLabel(productLineOptions, row.prodClass) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'acceptTime'">
|
|
|
|
|
+ {{ parseTime(row.acceptTime, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'maintainStartTime'">
|
|
|
|
|
+ {{ parseTime(row.maintainStartTime, '{y}-{m}-{d}') }}
|
|
|
|
|
+ </span>
|
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column align="center" fixed="right" label="操作" width="120px">
|
|
|
|
|
+ <!-- approStatus 审核状态 10 待提交审核 20 待审核 30 审核已同意 40 审核已拒绝 50 审核已撤销 -->
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-permissions="['contract:detail:product:maintain']"
|
|
|
|
|
+ :disabled="details.approStatus != '30'"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="maintainOpen(scope.row)">
|
|
|
|
|
+ 维保
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-permissions="['contract:detail:product:cost']"
|
|
|
|
|
+ :disabled="details.approStatus != '30'"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click="costOpen(scope.row)">
|
|
|
|
|
+ 成本
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="更新维保信息" :visible.sync="maintainVisible" @close="maintainClose">
|
|
|
|
|
+ <el-form :model="maintainForm">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="合同编号">
|
|
|
|
|
+ <el-input v-model="detailsNoMutation.contractCode" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="产品名称">
|
|
|
|
|
+ <el-input v-model="maintainForm.prodName" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="质保期(天)">
|
|
|
|
|
+ <el-input v-model.number="maintainForm.maintainPeriod" placeholder="请输入质保期" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="运维期(天)">
|
|
|
|
|
+ <el-input v-model.number="maintainForm.warrantPeriod" placeholder="请输入运维期" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="运维开始时间">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="maintainForm.maintainStartTime"
|
|
|
|
|
+ placeholder="选择运维开始时间"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="验收时间">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="maintainForm.acceptTime"
|
|
|
|
|
+ placeholder="选择验收时间"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-form-item label="运维约定条款">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="maintainForm.maintainRemark"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ maxlength="500"
|
|
|
|
|
+ placeholder="请输入运维约定条款"
|
|
|
|
|
+ :rows="5"
|
|
|
|
|
+ show-word-limit
|
|
|
|
|
+ type="textarea" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer">
|
|
|
|
|
+ <el-button type="primary" @click="maintainEdit">保存</el-button>
|
|
|
|
|
+ <el-button @click="maintainClose">取消</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="更新成本信息" :visible.sync="costVisible" @close="costClose">
|
|
|
|
|
+ <el-form :model="costForm">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="合同编号">
|
|
|
|
|
+ <el-input v-model="detailsNoMutation.contractCode" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="产品名称">
|
|
|
|
|
+ <el-input v-model="costForm.prodName" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="采购成本">
|
|
|
|
|
+ <amount-input v-model="costForm.purchaseCost" placeholder="请输入采购成本" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="二次开发成本">
|
|
|
|
|
+ <amount-input v-model="costForm.devCost" placeholder="请输入二次开发成本" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="产品维保成本">
|
|
|
|
|
+ <amount-input v-model="costForm.maintainCost" placeholder="请输入产品维保成本" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="直接成本">
|
|
|
|
|
+ <amount-input v-model="costForm.directCost" placeholder="请输入直接成本" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer">
|
|
|
|
|
+ <el-button type="primary" @click="costEdit">保存</el-button>
|
|
|
|
|
+ <el-button @click="costClose">取消</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import to from 'await-to-js'
|
|
|
|
|
+ import contractApi from '@/api/contract'
|
|
|
|
|
+ import AmountInput from '@/components/currency'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'DetailsProduct',
|
|
name: 'DetailsProduct',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ AmountInput,
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
|
|
+ details: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: () => {},
|
|
|
|
|
+ },
|
|
|
product: {
|
|
product: {
|
|
|
type: Array,
|
|
type: Array,
|
|
|
default: () => [],
|
|
default: () => [],
|
|
@@ -46,6 +207,16 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '合同编号',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'contractCode',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '产品类别',
|
|
|
|
|
+ width: '100px',
|
|
|
|
|
+ prop: 'prodClass',
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
label: '产品名称',
|
|
label: '产品名称',
|
|
|
width: '120px',
|
|
width: '120px',
|
|
@@ -70,13 +241,91 @@
|
|
|
label: '合计',
|
|
label: '合计',
|
|
|
width: '100px',
|
|
width: '100px',
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '采购成本',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'purchaseCost',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '二次开发成本',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'devCost',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '产品维保成本',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'maintainCost',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '直接成本',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'directCost',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '验收时间',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'acceptTime',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '质保期(天)',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'maintainPeriod',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '运维开始时间',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'maintainStartTime',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '运维期(天)',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'warrantPeriod',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '运维约定条款',
|
|
|
|
|
+ width: '120px',
|
|
|
|
|
+ prop: 'maintainRemark',
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
|
|
+ productLineOptions: [],
|
|
|
|
|
+ maintainVisible: false,
|
|
|
|
|
+ maintainForm: {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ prodName: '',
|
|
|
|
|
+ maintainPeriod: 0,
|
|
|
|
|
+ warrantPeriod: 0,
|
|
|
|
|
+ maintainStartTime: null,
|
|
|
|
|
+ maintainRemark: '',
|
|
|
|
|
+ acceptTime: null,
|
|
|
|
|
+ },
|
|
|
|
|
+ costVisible: false,
|
|
|
|
|
+ costForm: {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ prodName: '',
|
|
|
|
|
+ purchaseCost: 0,
|
|
|
|
|
+ devCost: 0,
|
|
|
|
|
+ maintainCost: 0,
|
|
|
|
|
+ directCost: 0,
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- mounted() {},
|
|
|
|
|
-
|
|
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ detailsNoMutation() {
|
|
|
|
|
+ let obj = Object.assign({}, this.details)
|
|
|
|
|
+ return obj
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.getOptions()
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getOptions() {
|
|
|
|
|
+ Promise.all([this.getDicts('sys_product_line')])
|
|
|
|
|
+ .then(([productLine]) => {
|
|
|
|
|
+ this.productLineOptions = productLine.data.values || []
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => console.log(err))
|
|
|
|
|
+ },
|
|
|
// 计算总价
|
|
// 计算总价
|
|
|
calculatedDiscount(price, count) {
|
|
calculatedDiscount(price, count) {
|
|
|
let intPrice = null
|
|
let intPrice = null
|
|
@@ -84,6 +333,80 @@
|
|
|
else intPrice = price * 100
|
|
else intPrice = price * 100
|
|
|
return this.formatPrice((intPrice * count) / 100)
|
|
return this.formatPrice((intPrice * count) / 100)
|
|
|
},
|
|
},
|
|
|
|
|
+ maintainOpen(data) {
|
|
|
|
|
+ this.maintainForm.id = data.id
|
|
|
|
|
+ this.maintainForm.prodName = data.prodName
|
|
|
|
|
+ this.maintainForm.maintainPeriod = data.maintainPeriod
|
|
|
|
|
+ this.maintainForm.warrantPeriod = data.warrantPeriod
|
|
|
|
|
+ this.maintainForm.maintainStartTime = data.maintainStartTime
|
|
|
|
|
+ this.maintainForm.maintainRemark = data.maintainRemark
|
|
|
|
|
+ this.maintainForm.acceptTime = data.acceptTime
|
|
|
|
|
+ this.maintainVisible = true
|
|
|
|
|
+ },
|
|
|
|
|
+ maintainClose() {
|
|
|
|
|
+ this.maintainForm.id = 0
|
|
|
|
|
+ this.maintainForm.prodName = ''
|
|
|
|
|
+ this.maintainForm.maintainPeriod = 0
|
|
|
|
|
+ this.maintainForm.warrantPeriod = 0
|
|
|
|
|
+ this.maintainForm.maintainStartTime = null
|
|
|
|
|
+ this.maintainForm.maintainRemark = ''
|
|
|
|
|
+ this.maintainForm.acceptTime = null
|
|
|
|
|
+ this.maintainVisible = false
|
|
|
|
|
+ },
|
|
|
|
|
+ async maintainEdit() {
|
|
|
|
|
+ let params = { ...this.maintainForm }
|
|
|
|
|
+ params.maintainPeriod = params.maintainPeriod ? params.maintainPeriod : 0
|
|
|
|
|
+ params.warrantPeriod = params.warrantPeriod ? params.warrantPeriod : 0
|
|
|
|
|
+ const [err, res] = await to(contractApi.updateProduct(params))
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success('操作成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error(res)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.maintainVisible = false
|
|
|
|
|
+ this.$emit('productUpdate')
|
|
|
|
|
+ },
|
|
|
|
|
+ costOpen(data) {
|
|
|
|
|
+ this.costForm.id = data.id
|
|
|
|
|
+ this.costForm.prodName = data.prodName
|
|
|
|
|
+ this.costForm.purchaseCost = data.purchaseCost
|
|
|
|
|
+ this.costForm.devCost = data.devCost
|
|
|
|
|
+ this.costForm.maintainCost = data.maintainCost
|
|
|
|
|
+ this.costForm.directCost = data.directCost
|
|
|
|
|
+ this.costVisible = true
|
|
|
|
|
+ },
|
|
|
|
|
+ costClose() {
|
|
|
|
|
+ this.costForm.id = 0
|
|
|
|
|
+ this.costForm.prodName = ''
|
|
|
|
|
+ this.costForm.purchaseCost = 0
|
|
|
|
|
+ this.costForm.devCost = 0
|
|
|
|
|
+ this.costForm.maintainCost = 0
|
|
|
|
|
+ this.costForm.directCost = 0
|
|
|
|
|
+ this.costVisible = false
|
|
|
|
|
+ },
|
|
|
|
|
+ async costEdit() {
|
|
|
|
|
+ let params = { ...this.costForm }
|
|
|
|
|
+ params.purchaseCost = params.purchaseCost ? params.purchaseCost : 0
|
|
|
|
|
+ params.devCost = params.devCost ? params.devCost : 0
|
|
|
|
|
+ params.maintainCost = params.maintainCost ? params.maintainCost : 0
|
|
|
|
|
+ params.directCost = params.directCost ? params.directCost : 0
|
|
|
|
|
+ const [err, res] = await to(contractApi.updateProduct(params))
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.error(err)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.$message.success('操作成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error(res)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.costVisible = false
|
|
|
|
|
+ this.$emit('productUpdate')
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|