| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <view class="">123</view>
- </template>
- <script>
- import { getBusinessOpportunityDetailAPI, businessOpportunityUpdateAPI } from '@/api/wt/index.js'
- export default {
- props: {
- businessId: {
- default: ''
- },
- taskDefinitionKey: {
- default: ''
- }
- },
- data() {
- return {
- form: {},
- calendarShow: false,
- tableField: [
- {
- label: '名称',
- field: 'productName'
- },
- {
- label: '编码',
- field: 'productCode'
- },
- {
- label: '类型',
- field: 'productCategoryName'
- },
- {
- label: '单价',
- field: 'singlePrice'
- },
- {
- label: '数量',
- field: 'totalCount'
- },
- {
- label: '合计',
- field: 'totalPrice'
- },
- {
- label: '生产交付交期',
- field: 'produceDeliveryDeadline',
- type: 'date',
- disabled: !['productionSupervisorApprove1', 'productionSupervisorApprove2'].includes(this.taskDefinitionKey)
- }
- ],
- list: ['基本信息', '产品清单'],
- totalPrice: 0,
- curNow: 0,
- curIndex: null,
- rules: {
- produceDeliveryDeadline: {
- type: 'string',
- required: true,
- message: '请选择生产交付日期',
- trigger: ['blur', 'change']
- }
- }
- }
- },
- methods: {
- sectionChange(index) {
- this.curNow = index
- },
- async getDetailData(id) {
- const data = await getBusinessOpportunityDetailAPI(id)
- if (data) {
- this.form = data
- console.log(this.form.productList)
- this.totalPrice = this.form.productList.reduce((num, row) => (num += row.totalPrice), 0)
- }
- },
- openCalendar(e, index) {
- this.calendarShow = true
- this.curIndex = index
- },
- confirm(e) {
- this.$set(this.form.productList[this.curIndex], 'produceDeliveryDeadline', ...e)
- this.calendarShow = false
- },
- //
- getTableValue() {
- let validField = ['produceDeliveryDeadline']
- let valid = false
- for (var i = 0; i < validField.length; i++) {
- valid = this.form.productList.some(item => !!item[validField[i]] == false)
- if (valid) break
- }
- return new Promise(async (resolve, reject) => {
- valid ? reject(uni.$u.toast('请完善产品清单信息')) : resolve(this.form)
- })
- }
- }
- }
- </script>
- <style></style>
|