|
@@ -19,8 +19,8 @@
|
|
|
<u--input v-model="inputForm.handledByOfficeName" disabled></u--input>
|
|
<u--input v-model="inputForm.handledByOfficeName" disabled></u--input>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
<u-form-item label="入库时间" borderBottom prop="wareHouseDate" :required="true">
|
|
<u-form-item label="入库时间" borderBottom prop="wareHouseDate" :required="true">
|
|
|
- <el-date-picker v-model="inputForm.wareHouseDate" type="date" placeholder="请选择入库时间" style="width:100%"
|
|
|
|
|
- placement="bottom-start" clearable :disabled="nodeFlag">
|
|
|
|
|
|
|
+ <el-date-picker v-model="inputForm.wareHouseDate" type="date" value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="请选择入库时间" style="width:100%" placement="bottom-start" clearable :disabled="nodeFlag">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
|
|
@@ -74,14 +74,10 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="section-wrap">
|
|
<view class="section-wrap">
|
|
|
- <view class="section-title">入库修改详情</view>
|
|
|
|
|
- <view v-for="(item, index) in inputForm.wareHouse" :key="item.id || index"
|
|
|
|
|
- class="detail-card warehouse-card" :class="statusClass(item)">
|
|
|
|
|
|
|
+ <view class="section-title">入库详情</view>
|
|
|
|
|
+ <view v-for="(item, index) in inputForm.wareHouse" :key="item.id || index" class="detail-card">
|
|
|
<view class="detail-card-head">
|
|
<view class="detail-card-head">
|
|
|
<view class="detail-card-title">入库明细 {{ index + 1 }}</view>
|
|
<view class="detail-card-title">入库明细 {{ index + 1 }}</view>
|
|
|
- <view v-if="statusLabel(item)" class="status-badge" :class="statusBadgeClass(item)">
|
|
|
|
|
- {{ statusLabel(item) }}
|
|
|
|
|
- </view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<u-form-item label="入库人" :prop="'wareHouse[' + index + '].wareHouseMan'" :required="true">
|
|
<u-form-item label="入库人" :prop="'wareHouse[' + index + '].wareHouseMan'" :required="true">
|
|
@@ -156,9 +152,6 @@
|
|
|
|
|
|
|
|
<u-form-item label="" v-if="!nodeFlag">
|
|
<u-form-item label="" v-if="!nodeFlag">
|
|
|
<view class="row-action-group">
|
|
<view class="row-action-group">
|
|
|
- <el-button style="width: 100%" type="primary" plain @click="markWareHouseModified(index)">
|
|
|
|
|
- 标记修改
|
|
|
|
|
- </el-button>
|
|
|
|
|
<el-button style="width: 100%" type="danger" plain @click="removeWareHouseRow(index)">
|
|
<el-button style="width: 100%" type="danger" plain @click="removeWareHouseRow(index)">
|
|
|
删除明细
|
|
删除明细
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -244,6 +237,7 @@ export default {
|
|
|
listData: [],
|
|
listData: [],
|
|
|
materialList: [],
|
|
materialList: [],
|
|
|
currentTypeIndex: -1,
|
|
currentTypeIndex: -1,
|
|
|
|
|
+ originalWareHouseRows: [],
|
|
|
inputForm: this.createInputForm(),
|
|
inputForm: this.createInputForm(),
|
|
|
rules: {
|
|
rules: {
|
|
|
wareHouseName: [
|
|
wareHouseName: [
|
|
@@ -253,20 +247,6 @@ export default {
|
|
|
trigger: ['blur', 'change']
|
|
trigger: ['blur', 'change']
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- wareHouseDate: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '入库时间不能为空',
|
|
|
|
|
- trigger: ['change']
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- purchaseNo: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '采购编号不能为空',
|
|
|
|
|
- trigger: ['blur', 'change']
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
updateCause: [
|
|
updateCause: [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
@@ -305,6 +285,16 @@ export default {
|
|
|
deep: false
|
|
deep: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async onLoad(options = {}) {
|
|
|
|
|
+ const id = options.id || options.businessId || ''
|
|
|
|
|
+ if (!id) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ await this.init(id)
|
|
|
|
|
+ if (options.readOnly === 'true' || options.method === 'view') {
|
|
|
|
|
+ this.nodeFlag = true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
createInputForm() {
|
|
createInputForm() {
|
|
|
return {
|
|
return {
|
|
@@ -370,6 +360,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
resetForm() {
|
|
resetForm() {
|
|
|
this.inputForm = this.createInputForm()
|
|
this.inputForm = this.createInputForm()
|
|
|
|
|
+ this.originalWareHouseRows = []
|
|
|
this.fillUserInfo()
|
|
this.fillUserInfo()
|
|
|
},
|
|
},
|
|
|
async init(id) {
|
|
async init(id) {
|
|
@@ -386,6 +377,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.inputForm = this.normalizeFormData(this.recover(this.createInputForm(), data))
|
|
this.inputForm = this.normalizeFormData(this.recover(this.createInputForm(), data))
|
|
|
|
|
+ if (this.isEmpty(this.inputForm.id)) {
|
|
|
|
|
+ this.inputForm.id = id
|
|
|
|
|
+ }
|
|
|
|
|
+ this.originalWareHouseRows = this.cloneRows(this.inputForm.wareHouse)
|
|
|
this.fillUserInfo()
|
|
this.fillUserInfo()
|
|
|
this.nodeFlag = await this.resolveNodeFlag(data)
|
|
this.nodeFlag = await this.resolveNodeFlag(data)
|
|
|
this.calculateDetailTotalPrice()
|
|
this.calculateDetailTotalPrice()
|
|
@@ -412,22 +407,27 @@ export default {
|
|
|
normalizeFormData(data) {
|
|
normalizeFormData(data) {
|
|
|
const form = data || this.createInputForm()
|
|
const form = data || this.createInputForm()
|
|
|
if (this.isNotEmpty(form.wareHouseDate)) {
|
|
if (this.isNotEmpty(form.wareHouseDate)) {
|
|
|
- form.wareHouseDate = new Date(form.wareHouseDate)
|
|
|
|
|
|
|
+ form.wareHouseDate = this.formatDate(form.wareHouseDate)
|
|
|
}
|
|
}
|
|
|
form.detailInfos = (form.detailInfos || []).map(item => ({
|
|
form.detailInfos = (form.detailInfos || []).map(item => ({
|
|
|
...item,
|
|
...item,
|
|
|
fileInfoLost: item.fileInfoLost || [],
|
|
fileInfoLost: item.fileInfoLost || [],
|
|
|
priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
|
|
priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
|
|
|
}))
|
|
}))
|
|
|
- form.wareHouse = (form.wareHouse || []).map(item => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- fileInfoLost: item.fileInfoLost || [],
|
|
|
|
|
- upFlag: item.upFlag || '0',
|
|
|
|
|
- produceDate: this.isNotEmpty(item.produceDate) ? new Date(item.produceDate) : '',
|
|
|
|
|
- priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
|
|
|
|
|
- }))
|
|
|
|
|
|
|
+ form.wareHouse = (form.wareHouse || [])
|
|
|
|
|
+ .filter(item => item.upFlag !== '1' && item.upFlag !== '2')
|
|
|
|
|
+ .map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ fileInfoLost: item.fileInfoLost || [],
|
|
|
|
|
+ upFlag: item.upFlag || '0',
|
|
|
|
|
+ produceDate: this.isNotEmpty(item.produceDate) ? new Date(item.produceDate) : '',
|
|
|
|
|
+ priceSum: this.computePriceSum(item.tradePrice, item.tradeNumber)
|
|
|
|
|
+ }))
|
|
|
return form
|
|
return form
|
|
|
},
|
|
},
|
|
|
|
|
+ cloneRows(rows) {
|
|
|
|
|
+ return JSON.parse(JSON.stringify(rows || []))
|
|
|
|
|
+ },
|
|
|
buildTree(nodes, parentId = '0') {
|
|
buildTree(nodes, parentId = '0') {
|
|
|
const tree = []
|
|
const tree = []
|
|
|
for (const node of nodes || []) {
|
|
for (const node of nodes || []) {
|
|
@@ -456,6 +456,16 @@ export default {
|
|
|
isNotEmpty(value) {
|
|
isNotEmpty(value) {
|
|
|
return !this.isEmpty(value)
|
|
return !this.isEmpty(value)
|
|
|
},
|
|
},
|
|
|
|
|
+ resolveBusinessId() {
|
|
|
|
|
+ return this.inputForm.id || this.businessId || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ ensureBusinessId() {
|
|
|
|
|
+ const id = this.resolveBusinessId()
|
|
|
|
|
+ if (this.isNotEmpty(id) && this.isEmpty(this.inputForm.id)) {
|
|
|
|
|
+ this.inputForm.id = id
|
|
|
|
|
+ }
|
|
|
|
|
+ return id
|
|
|
|
|
+ },
|
|
|
computePriceSum(price, number) {
|
|
computePriceSum(price, number) {
|
|
|
if (this.isEmpty(price) || this.isEmpty(number)) {
|
|
if (this.isEmpty(price) || this.isEmpty(number)) {
|
|
|
return ''
|
|
return ''
|
|
@@ -482,6 +492,65 @@ export default {
|
|
|
this.inputForm.wareHouseTotalPrice = totalPrice ? totalPrice.toFixed(2) : ''
|
|
this.inputForm.wareHouseTotalPrice = totalPrice ? totalPrice.toFixed(2) : ''
|
|
|
this.inputForm.wareHouseActualPrice = totalActual ? totalActual.toFixed(2) : ''
|
|
this.inputForm.wareHouseActualPrice = totalActual ? totalActual.toFixed(2) : ''
|
|
|
},
|
|
},
|
|
|
|
|
+ getOriginalWareHouseRow(row) {
|
|
|
|
|
+ const rowId = row && row.id
|
|
|
|
|
+ if (this.isEmpty(rowId)) {
|
|
|
|
|
+ return null
|
|
|
|
|
+ }
|
|
|
|
|
+ return (this.originalWareHouseRows || []).find(item => item.id === rowId) || null
|
|
|
|
|
+ },
|
|
|
|
|
+ isWareHouseRowChanged(row, originalRow) {
|
|
|
|
|
+ if (!row || !originalRow) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ const fields = [
|
|
|
|
|
+ 'wareHouseManId',
|
|
|
|
|
+ 'wareHouseMan',
|
|
|
|
|
+ 'deptId',
|
|
|
|
|
+ 'wareHouseManOffice',
|
|
|
|
|
+ 'wareHouseTypeId',
|
|
|
|
|
+ 'wareHouseType',
|
|
|
|
|
+ 'tradeName',
|
|
|
|
|
+ 'supplierId',
|
|
|
|
|
+ 'supplierName',
|
|
|
|
|
+ 'isSupplier',
|
|
|
|
|
+ 'tradeNumber',
|
|
|
|
|
+ 'company',
|
|
|
|
|
+ 'spec',
|
|
|
|
|
+ 'tradePrice',
|
|
|
|
|
+ 'actualPrice',
|
|
|
|
|
+ 'produceDate',
|
|
|
|
|
+ 'shelfLife',
|
|
|
|
|
+ 'shelfLifeUnit',
|
|
|
|
|
+ 'remarks'
|
|
|
|
|
+ ]
|
|
|
|
|
+ return fields.some(field => {
|
|
|
|
|
+ let nextValue = row[field]
|
|
|
|
|
+ let oldValue = originalRow[field]
|
|
|
|
|
+ if (field === 'produceDate') {
|
|
|
|
|
+ nextValue = this.formatDate(nextValue)
|
|
|
|
|
+ oldValue = this.formatDate(oldValue)
|
|
|
|
|
+ }
|
|
|
|
|
+ return String(nextValue || '') !== String(oldValue || '')
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ markChangedRowsForSubmit() {
|
|
|
|
|
+ ;(this.inputForm.wareHouse || []).forEach((row, index) => {
|
|
|
|
|
+ if (this.isEmpty(row.id) || this.isNotEmpty(row.sourceId)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const originalRow = this.getOriginalWareHouseRow(row)
|
|
|
|
|
+ if (this.isWareHouseRowChanged(row, originalRow)) {
|
|
|
|
|
+ this.$set(this.inputForm.wareHouse[index], 'upFlag', '1')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ normalizeWareHouseAmounts() {
|
|
|
|
|
+ ;(this.inputForm.wareHouse || []).forEach((row, index) => {
|
|
|
|
|
+ this.$set(this.inputForm.wareHouse[index], 'priceSum', this.computePriceSum(row.tradePrice, row.tradeNumber))
|
|
|
|
|
+ })
|
|
|
|
|
+ this.calculateWareHouseTotals()
|
|
|
|
|
+ },
|
|
|
openUserPullForm(index) {
|
|
openUserPullForm(index) {
|
|
|
if (this.nodeFlag) {
|
|
if (this.nodeFlag) {
|
|
|
return
|
|
return
|
|
@@ -696,14 +765,44 @@ export default {
|
|
|
return `${year}-${month}-${day}`
|
|
return `${year}-${month}-${day}`
|
|
|
},
|
|
},
|
|
|
toSubmitData() {
|
|
toSubmitData() {
|
|
|
|
|
+ const businessId = this.ensureBusinessId()
|
|
|
|
|
+ this.normalizeWareHouseAmounts()
|
|
|
|
|
+ this.markChangedRowsForSubmit()
|
|
|
const data = JSON.parse(JSON.stringify(this.inputForm))
|
|
const data = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
|
|
+ data.id = data.id || businessId
|
|
|
data.wareHouseDate = this.formatDate(this.inputForm.wareHouseDate)
|
|
data.wareHouseDate = this.formatDate(this.inputForm.wareHouseDate)
|
|
|
|
|
+ data.tradeTotalPrice = this.normalizeOptionalNumber(data.tradeTotalPrice)
|
|
|
|
|
+ data.wareHouseTotalPrice = this.normalizeOptionalNumber(data.wareHouseTotalPrice)
|
|
|
|
|
+ data.wareHouseActualPrice = this.normalizeOptionalNumber(data.wareHouseActualPrice)
|
|
|
data.wareHouse = (this.inputForm.wareHouse || []).map(item => ({
|
|
data.wareHouse = (this.inputForm.wareHouse || []).map(item => ({
|
|
|
...JSON.parse(JSON.stringify(item)),
|
|
...JSON.parse(JSON.stringify(item)),
|
|
|
- produceDate: this.formatDate(item.produceDate)
|
|
|
|
|
|
|
+ produceDate: this.formatDate(item.produceDate),
|
|
|
|
|
+ priceSum: this.normalizeOptionalNumber(this.computePriceSum(item.tradePrice, item.tradeNumber)),
|
|
|
|
|
+ tradeTotalPrice: this.normalizeOptionalNumber(item.tradeTotalPrice),
|
|
|
|
|
+ actualPrice: this.normalizeOptionalNumber(item.actualPrice)
|
|
|
}))
|
|
}))
|
|
|
return data
|
|
return data
|
|
|
},
|
|
},
|
|
|
|
|
+ normalizeOptionalNumber(value) {
|
|
|
|
|
+ if (this.isEmpty(value)) {
|
|
|
|
|
+ return null
|
|
|
|
|
+ }
|
|
|
|
|
+ return value
|
|
|
|
|
+ },
|
|
|
|
|
+ validateBaseForm() {
|
|
|
|
|
+ if (this.isEmpty(this.inputForm.wareHouseDate)) {
|
|
|
|
|
+ this.$message.error('入库时间不能为空')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+ },
|
|
|
|
|
+ validateBusinessId() {
|
|
|
|
|
+ if (this.isEmpty(this.ensureBusinessId())) {
|
|
|
|
|
+ this.$message.error('入库数据ID为空,请返回列表重新进入')
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+ },
|
|
|
validateWareHouseRows() {
|
|
validateWareHouseRows() {
|
|
|
if (this.isEmpty(this.inputForm.wareHouse)) {
|
|
if (this.isEmpty(this.inputForm.wareHouse)) {
|
|
|
return true
|
|
return true
|
|
@@ -747,6 +846,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
async saveForm(callback) {
|
|
async saveForm(callback) {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if (!this.validateBaseForm()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.validateBusinessId()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
await this.$refs.inputForm.validate()
|
|
await this.$refs.inputForm.validate()
|
|
|
if (!this.validateWareHouseRows()) {
|
|
if (!this.validateWareHouseRows()) {
|
|
|
return
|
|
return
|
|
@@ -767,8 +872,9 @@ export default {
|
|
|
async startForm(callback) {
|
|
async startForm(callback) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
try {
|
|
try {
|
|
|
- if (this.isNotEmpty(this.inputForm.id)) {
|
|
|
|
|
- const data = await this.wareHouseService.findById(this.inputForm.id)
|
|
|
|
|
|
|
+ const id = this.ensureBusinessId()
|
|
|
|
|
+ if (this.isNotEmpty(id)) {
|
|
|
|
|
+ const data = await this.wareHouseService.findById(id)
|
|
|
if (this.isNotEmpty(data.status) && !['0', '1', '3', '5'].includes(data.status)) {
|
|
if (this.isNotEmpty(data.status) && !['0', '1', '3', '5'].includes(data.status)) {
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('invalid status')
|
|
throw new Error('invalid status')
|
|
@@ -780,6 +886,12 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async startFormTrue(callback) {
|
|
async startFormTrue(callback) {
|
|
|
|
|
+ if (!this.validateBaseForm()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.validateBusinessId()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
await this.$refs.inputForm.validate()
|
|
await this.$refs.inputForm.validate()
|
|
|
if (!this.validateWareHouseRows()) {
|
|
if (!this.validateWareHouseRows()) {
|
|
|
return
|
|
return
|
|
@@ -798,7 +910,12 @@ export default {
|
|
|
async reapplyForm(callback) {
|
|
async reapplyForm(callback) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
try {
|
|
try {
|
|
|
- const data = await this.wareHouseService.findById(this.inputForm.id)
|
|
|
|
|
|
|
+ const id = this.ensureBusinessId()
|
|
|
|
|
+ if (this.isEmpty(id)) {
|
|
|
|
|
+ this.$message.error('入库数据ID为空,请返回列表重新进入')
|
|
|
|
|
+ throw new Error('missing business id')
|
|
|
|
|
+ }
|
|
|
|
|
+ const data = await this.wareHouseService.findById(id)
|
|
|
if (data.status !== '4') {
|
|
if (data.status !== '4') {
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('invalid status')
|
|
throw new Error('invalid status')
|
|
@@ -811,6 +928,12 @@ export default {
|
|
|
async agreeForm(callback) {
|
|
async agreeForm(callback) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if (!this.validateBaseForm()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.validateBusinessId()) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
await this.$refs.inputForm.validate()
|
|
await this.$refs.inputForm.validate()
|
|
|
if (!this.validateWareHouseRows()) {
|
|
if (!this.validateWareHouseRows()) {
|
|
|
return
|
|
return
|
|
@@ -831,8 +954,13 @@ export default {
|
|
|
async updateStatusById(type, callback) {
|
|
async updateStatusById(type, callback) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
try {
|
|
try {
|
|
|
|
|
+ const id = this.ensureBusinessId()
|
|
|
|
|
+ if (this.isEmpty(id)) {
|
|
|
|
|
+ this.$message.error('入库数据ID为空,请返回列表重新进入')
|
|
|
|
|
+ throw new Error('missing business id')
|
|
|
|
|
+ }
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
- const data = await this.wareHouseService.findById(this.inputForm.id)
|
|
|
|
|
|
|
+ const data = await this.wareHouseService.findById(id)
|
|
|
if (data.status !== '2') {
|
|
if (data.status !== '2') {
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('invalid status')
|
|
throw new Error('invalid status')
|
|
@@ -841,57 +969,21 @@ export default {
|
|
|
this.inputForm.status = status
|
|
this.inputForm.status = status
|
|
|
await this.wareHouseService.updateStatusById({
|
|
await this.wareHouseService.updateStatusById({
|
|
|
status,
|
|
status,
|
|
|
- id: this.inputForm.id
|
|
|
|
|
|
|
+ id
|
|
|
})
|
|
})
|
|
|
callback()
|
|
callback()
|
|
|
} else if (type === 'hold') {
|
|
} else if (type === 'hold') {
|
|
|
- const data = await this.wareHouseService.findById(this.inputForm.id)
|
|
|
|
|
|
|
+ const data = await this.wareHouseService.findById(id)
|
|
|
if (data.status !== '4') {
|
|
if (data.status !== '4') {
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('invalid status')
|
|
throw new Error('invalid status')
|
|
|
}
|
|
}
|
|
|
- await this.wareHouseService.backSourceData(this.inputForm.id)
|
|
|
|
|
|
|
+ await this.wareHouseService.backSourceData(id)
|
|
|
callback()
|
|
callback()
|
|
|
}
|
|
}
|
|
|
} finally {
|
|
} finally {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- statusLabel(row) {
|
|
|
|
|
- if (row.upFlag === '1') {
|
|
|
|
|
- return '修改前'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '2') {
|
|
|
|
|
- return '已删除'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
|
|
|
|
|
- return '修改后'
|
|
|
|
|
- }
|
|
|
|
|
- return ''
|
|
|
|
|
- },
|
|
|
|
|
- statusClass(row) {
|
|
|
|
|
- if (row.upFlag === '1') {
|
|
|
|
|
- return 'warehouse-card--before'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '2') {
|
|
|
|
|
- return 'warehouse-card--deleted'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
|
|
|
|
|
- return 'warehouse-card--after'
|
|
|
|
|
- }
|
|
|
|
|
- return ''
|
|
|
|
|
- },
|
|
|
|
|
- statusBadgeClass(row) {
|
|
|
|
|
- if (row.upFlag === '1') {
|
|
|
|
|
- return 'status-badge--before'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '2') {
|
|
|
|
|
- return 'status-badge--deleted'
|
|
|
|
|
- }
|
|
|
|
|
- if (row.upFlag === '0' && this.isNotEmpty(row.sourceId)) {
|
|
|
|
|
- return 'status-badge--after'
|
|
|
|
|
- }
|
|
|
|
|
- return ''
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -959,40 +1051,6 @@ export default {
|
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.warehouse-card--before {
|
|
|
|
|
- background: #f3f4f6;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.warehouse-card--after {
|
|
|
|
|
- background: #f0fdf4;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.warehouse-card--deleted {
|
|
|
|
|
- background: #fef2f2;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.status-badge {
|
|
|
|
|
- padding: 8rpx 16rpx;
|
|
|
|
|
- border-radius: 999rpx;
|
|
|
|
|
- font-size: 22rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.status-badge--before {
|
|
|
|
|
- color: #475569;
|
|
|
|
|
- background: #e2e8f0;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.status-badge--after {
|
|
|
|
|
- color: #166534;
|
|
|
|
|
- background: #dcfce7;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.status-badge--deleted {
|
|
|
|
|
- color: #b91c1c;
|
|
|
|
|
- background: #fee2e2;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.row-action-group {
|
|
.row-action-group {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 16rpx;
|
|
gap: 16rpx;
|
|
@@ -1007,12 +1065,15 @@ export default {
|
|
|
|
|
|
|
|
.shelf-life-input {
|
|
.shelf-life-input {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.shelf-life-unit {
|
|
.shelf-life-unit {
|
|
|
- width: 200rpx;
|
|
|
|
|
|
|
+ flex: 0 0 128rpx;
|
|
|
|
|
+ width: 128rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@media (max-width: 768px) {
|
|
@media (max-width: 768px) {
|
|
|
.detail-grid {
|
|
.detail-grid {
|
|
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|