Browse Source

质检增加成本字段

master
liujiangyong 2 years ago
parent
commit
fd83a96c06
  1. 9
      api/app/lib/models/patrol_record_issue_handle.js
  2. 4
      script/1.0.5/schema/3.update_patrol_record_issue_handle.sql
  3. 15
      weapp/package/troubleshooting/shootingForm/index.js
  4. 1
      weapp/package/troubleshooting/shootingForm/index.wxml
  5. 7
      web/client/src/sections/issueHandle/components/isuue-handle-mdal.js

9
api/app/lib/models/patrol_record_issue_handle.js

@ -204,6 +204,15 @@ module.exports = dc => {
field: "isgaojing", field: "isgaojing",
autoIncrement: false autoIncrement: false
}, },
cost: {
type: DataTypes.DECIMAL(11, 2),
allowNull: true,
defaultValue: null,
comment: '成本',
primaryKey: false,
field: "cost",
autoIncrement: false
},
}, { }, {
tableName: "patrol_record_issue_handle", tableName: "patrol_record_issue_handle",
comment: "", comment: "",

4
script/1.0.5/schema/3.update_patrol_record_issue_handle.sql

@ -0,0 +1,4 @@
ALTER TABLE "public"."patrol_record_issue_handle"
ADD COLUMN "cost" decimal(11,2);
COMMENT ON COLUMN "public"."patrol_record_issue_handle"."cost" IS '成本';

15
weapp/package/troubleshooting/shootingForm/index.js

@ -34,6 +34,7 @@ Page({
repair: '', repair: '',
repairImgs: [], repairImgs: [],
checkDesc: '', checkDesc: '',
cost: '',
checkImgs: [], checkImgs: [],
// 表单控制 // 表单控制
@ -124,6 +125,7 @@ Page({
if (issue.state > 4) { if (issue.state > 4) {
this.setData({ this.setData({
checkDesc: issue.checkOpinion, checkDesc: issue.checkOpinion,
cost: issue.cost,
checkImgs: issue.checkImage || [], checkImgs: issue.checkImage || [],
}) })
} }
@ -198,8 +200,16 @@ Page({
}, },
onInputChange (e) { onInputChange (e) {
let value = e.detail.value
if (e.target.dataset.type === 'cost' && !/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) {
wx.showToast({
title: '只能输入两位小数',
icon: 'none'
})
value = value.substring(0, value.length - 1);
}
this.setData({ this.setData({
[e.target.dataset.type]: e.detail.value [e.target.dataset.type]: value
}) })
}, },
@ -322,7 +332,7 @@ Page({
maintenancePersonIndex, maintenancePersonDepartmentShow, qualityPersonIndex, planStartTime, planEndTime, planStartTimeShow, planEndTimeShow, maintenanceRequirement, maintenancePersonIndex, maintenancePersonDepartmentShow, qualityPersonIndex, planStartTime, planEndTime, planStartTimeShow, planEndTimeShow, maintenanceRequirement,
userInfo, planApproval, userInfo, planApproval,
repair, repairImgs, repair, repairImgs,
checkDesc, checkImgs checkDesc, cost, checkImgs
} = this.data } = this.data
let nextState = '' let nextState = ''
let confirmData = {} let confirmData = {}
@ -372,6 +382,7 @@ Page({
confirmData = { confirmData = {
...confirmData, ...confirmData,
checkOpinion: checkDesc, checkOpinion: checkDesc,
cost,
checkImage: checkImgs, checkImage: checkImgs,
checkPerson: { id: userInfo.id, name: userInfo.name } checkPerson: { id: userInfo.id, name: userInfo.name }
} }

1
weapp/package/troubleshooting/shootingForm/index.wxml

@ -137,6 +137,7 @@
<span>质检验收</span> <span>质检验收</span>
</view> </view>
<van-field value="{{data.checkPerson.name}}" label="验收人" readonly border="{{ false }}" /> <van-field value="{{data.checkPerson.name}}" label="验收人" readonly border="{{ false }}" />
<van-field value="{{ cost }}" extra-event-params="{{true}}" label="成本(元)" type="digit" placeholder="请输入" border="{{ isCheck }}" bind:input="onInputChange" data-type='cost' readonly="{{!isCheck}}" />
<van-cell border="{{false}}"> <van-cell border="{{false}}">
<view style="display:flex"> <view style="display:flex">
<view class="fs-cell-title" style="">现场图片</view> <view class="fs-cell-title" style="">现场图片</view>

7
web/client/src/sections/issueHandle/components/isuue-handle-mdal.js

@ -178,6 +178,13 @@ export default (props) => {
value={editData?.patrolRecordIssueHandles[0]?.checkPerson?.name} value={editData?.patrolRecordIssueHandles[0]?.checkPerson?.name}
/> />
<ProFormText
name="checkPerson1"
label="成本(元):"
disabled={true}
value={editData?.patrolRecordIssueHandles[0]?.cost}
/>
<Form.Item label="完工图片:"> <Form.Item label="完工图片:">
<Uploads <Uploads
listType='picture-card' listType='picture-card'

Loading…
Cancel
Save