|
@@ -39,12 +39,19 @@
|
|
|
</view>
|
|
</view>
|
|
|
</u-cell>
|
|
</u-cell>
|
|
|
<u-cell title="仓库" arrow-direction="down">
|
|
<u-cell title="仓库" arrow-direction="down">
|
|
|
- <template>
|
|
|
|
|
- <uni-data-picker v-if="form.typeId != '2'" v-model="form.warehouseId" slot="value"
|
|
|
|
|
|
|
+ <template v-if="obtain == '主数据'">
|
|
|
|
|
+ <!-- <uni-data-picker v-if="form.typeId != '2'" v-model="form.warehouseId" slot="value"
|
|
|
:clear-icon='false' placeholder="请选择" :localdata="warehouseList" @change="warehouseOnchange">
|
|
:clear-icon='false' placeholder="请选择" :localdata="warehouseList" @change="warehouseOnchange">
|
|
|
- </uni-data-picker>
|
|
|
|
|
- <u--input v-if="form.typeId == '2'" slot="value" placeholder="请输入" border="surround"
|
|
|
|
|
- v-model="form.warehouseName"></u--input>
|
|
|
|
|
|
|
+ </uni-data-picker> -->
|
|
|
|
|
+ <uni-data-select v-if="form.typeId == '2'" slot="value" v-model="form.warehouseId"
|
|
|
|
|
+ @change="warehouseOnchange" :clear="false" :localdata="warehouseList">
|
|
|
|
|
+ </uni-data-select>
|
|
|
|
|
+ <u--input v-if="form.typeId != '2'" slot="value" placeholder="请输入" border="surround"
|
|
|
|
|
+ v-model="form.warehouseName" disabled></u--input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <u--input slot="value" placeholder="请输入仓库" border="surround" v-model="form.warehouseName"
|
|
|
|
|
+ disabled></u--input>
|
|
|
</template>
|
|
</template>
|
|
|
</u-cell>
|
|
</u-cell>
|
|
|
<u-cell title="库存" arrow-direction="down">
|
|
<u-cell title="库存" arrow-direction="down">
|
|
@@ -86,7 +93,9 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import { getIdWarehouseList } from '@/api/salesServiceManagement/workOrder/index.js'
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getIdWarehouseList
|
|
|
|
|
+ } from '@/api/salesServiceManagement/workOrder/index.js'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -97,7 +106,7 @@
|
|
|
categoryModel: '', // 型号
|
|
categoryModel: '', // 型号
|
|
|
specification: '', // 规格
|
|
specification: '', // 规格
|
|
|
content: '', // 详细内容
|
|
content: '', // 详细内容
|
|
|
- warehouseId: '', // 仓库
|
|
|
|
|
|
|
+ warehouseId: '', // 仓库id\
|
|
|
warehouseNum: '', // 库存
|
|
warehouseNum: '', // 库存
|
|
|
totalCount: '', // 数量
|
|
totalCount: '', // 数量
|
|
|
measureUnit: '', // 单位
|
|
measureUnit: '', // 单位
|
|
@@ -132,16 +141,22 @@
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
uni.$off('updateScheme');
|
|
uni.$off('updateScheme');
|
|
|
- uni.$on('updateScheme', (data) => {
|
|
|
|
|
|
|
+ uni.$on('updateScheme', async (data) => {
|
|
|
this.form = {
|
|
this.form = {
|
|
|
...this.form,
|
|
...this.form,
|
|
|
...data
|
|
...data
|
|
|
};
|
|
};
|
|
|
- this.warehouseList = data.warehouseList.map((el) => {
|
|
|
|
|
- el.text = el.warehouse_name;
|
|
|
|
|
- el.value = el.warehouse_id;
|
|
|
|
|
- return el;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ console.log(this.form, 'data ----')
|
|
|
|
|
+ if (this.obtain == '主数据') {
|
|
|
|
|
+ const res = await getIdWarehouseList({
|
|
|
|
|
+ categoryId: ''
|
|
|
|
|
+ })
|
|
|
|
|
+ res && res.map((el) => {
|
|
|
|
|
+ el.text = el.warehouseName;
|
|
|
|
|
+ el.value = el.warehouseId;
|
|
|
|
|
+ })
|
|
|
|
|
+ this.warehouseList = res || [];
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -167,7 +182,8 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
warehouseOnchange(e) {
|
|
warehouseOnchange(e) {
|
|
|
-
|
|
|
|
|
|
|
+ let name = this.warehouseList.find(item => item.warehouseId == e).warehouseName;
|
|
|
|
|
+ this.form.warehouseName = name;
|
|
|
},
|
|
},
|
|
|
selectProduct() {
|
|
selectProduct() {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -190,15 +206,17 @@
|
|
|
// if (value.startsWith('0') && value.length > 1) {
|
|
// if (value.startsWith('0') && value.length > 1) {
|
|
|
// value = value.replace(/^0+/, '');
|
|
// value = value.replace(/^0+/, '');
|
|
|
// }
|
|
// }
|
|
|
|
|
+ console.log(123)
|
|
|
let value = '';
|
|
let value = '';
|
|
|
if (field == 'singlePrice') {
|
|
if (field == 'singlePrice') {
|
|
|
- value = value.replace(/\./g, ''); // 如果不允许小数点,就移除所有小数点
|
|
|
|
|
|
|
+ value = e.replace(/\./g, ''); // 如果不允许小数点,就移除所有小数点
|
|
|
} else {
|
|
} else {
|
|
|
value = e.replace(/[^\d]/g, '')
|
|
value = e.replace(/[^\d]/g, '')
|
|
|
if (value.startsWith('0') && value.length > 1) {
|
|
if (value.startsWith('0') && value.length > 1) {
|
|
|
value = value.replace(/^0+/, '');
|
|
value = value.replace(/^0+/, '');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(value, 'value')
|
|
|
this.form[field] = value;
|
|
this.form[field] = value;
|
|
|
let num1 = this.form.totalCount ? this.form.totalCount - 0 : 0;
|
|
let num1 = this.form.totalCount ? this.form.totalCount - 0 : 0;
|
|
|
let num2 = this.form.singlePrice ? this.form.singlePrice - 0 : 0;
|
|
let num2 = this.form.singlePrice ? this.form.singlePrice - 0 : 0;
|