|
|
@@ -20,10 +20,10 @@
|
|
|
<view v-else>
|
|
|
<u-row>
|
|
|
<u-col span="6">
|
|
|
- <u--input placeholder="请输入" type="number" border="surround" v-model="item.purchaseCount"></u--input @input="changeCount(item, index)">
|
|
|
+ <u--input placeholder="请输入" type="number" border="surround" v-model="item.purchaseCount" @input="changeCount(item, index)"></u--input>
|
|
|
</u-col>
|
|
|
<u-col span="6">
|
|
|
- <uni-data-picker v-model="item.purchaseUnit" placeholder="请选择" :localdata="item.packageDispositionList" @change="changeCount(item, index)"></uni-data-picker>
|
|
|
+ <uni-data-picker v-model="item.purchaseUnitId" placeholder="请选择" :localdata="item.packageDispositionList" @change="changeCount(item, index)"></uni-data-picker>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
@@ -48,13 +48,12 @@
|
|
|
<view slot="expectReceiveDate">
|
|
|
<view v-if="isDrawer">{{ item.expectReceiveDate }}</view>
|
|
|
<view v-else>
|
|
|
- <view v-if="item.arrivalWay == 1">
|
|
|
- <uni-datetime-picker type="date" v-model="item.expectReceiveDate"></uni-datetime-picker>
|
|
|
+ <view v-if="item.arrivalWay == 2">
|
|
|
+ <span @click="settingDate(item, index)" style="color: #409eff;">设置分批时间</span>
|
|
|
</view>
|
|
|
<view v-else>
|
|
|
- <span @click="settingDate(item, index)" style="color: #409eff;">设置分批时间</span>
|
|
|
+ <uni-datetime-picker type="date" v-model="item.expectReceiveDate"></uni-datetime-picker>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -63,7 +62,7 @@
|
|
|
<view v-else>
|
|
|
<u-row>
|
|
|
<u-col span="10">
|
|
|
- <u--input placeholder="" disabled border="surround" v-model="item.taskName"></u--input @input="changeCount(item, index)">
|
|
|
+ <u--input placeholder="" disabled border="surround" v-model="item.taskName"></u--input>
|
|
|
</u-col>
|
|
|
<u-col span="2">
|
|
|
<u-button type="primary" size="mini" @click="selectTaskName(item, index)" text="选择"></u-button>
|
|
|
@@ -75,14 +74,15 @@
|
|
|
<view slot="supplierName">
|
|
|
<view v-if="isDrawer">{{ item.supplierName }}</view>
|
|
|
<view v-else>
|
|
|
- <uni-data-picker v-model="item.supplierName" placeholder="请选择" :localdata="arrivalWayList"></uni-data-picker>
|
|
|
+ <uni-data-picker v-model="item.supplierId" placeholder="请选择" :localdata="item.supplierList"></uni-data-picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view slot="provenance">
|
|
|
- <view v-if="isDrawer">{{ item.provenance }}</view>
|
|
|
+ <view v-if="isDrawer">{{ getProvenance(item.provenance) }}</view>
|
|
|
<view v-else>
|
|
|
- <uni-data-picker v-model="item.provenance" placeholder="请选择" :localdata="purchase_origin"></uni-data-picker>
|
|
|
+ <!-- <uni-data-picker v-model="item.provenance" placeholder="请选择" :localdata="purchase_origin"></uni-data-picker> -->
|
|
|
+ <u--input placeholder="请输入" border="surround" v-model="item.provenanceName" @click.native="changeMultiple(item, index, 'provenance', purchase_origin)"></u--input>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -96,29 +96,48 @@
|
|
|
<view slot="modelKey">
|
|
|
<view v-if="isDrawer">{{ item.modelKey }}</view>
|
|
|
<view v-else>
|
|
|
- <!-- <u--input placeholder="请输入" border="surround" disabled v-model="item.modelKey"></u--input> -->
|
|
|
- <uni-data-select
|
|
|
- multiple
|
|
|
+ <u--input placeholder="请输入" border="surround" v-model="item.modelKey" @click.native="changeMultiple(item, index, 'modelKey', product_model_key)"></u--input>
|
|
|
+ <!-- <uni-data-select
|
|
|
+
|
|
|
+ :localdata="product_model_key"
|
|
|
+ v-model="item.modelKey"
|
|
|
+ @change="change"
|
|
|
+ ></uni-data-select> -->
|
|
|
+ <!-- <zxz-uni-data-select
|
|
|
:localdata="product_model_key"
|
|
|
v-model="item.modelKey"
|
|
|
- ></uni-data-select>
|
|
|
+ dataValue="value"
|
|
|
+ format="{text}"
|
|
|
+ dataKey="text"
|
|
|
+ :clear="false"
|
|
|
+ multiple
|
|
|
+ ></zxz-uni-data-select> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view slot="colorKey">
|
|
|
<view v-if="isDrawer">{{ item.colorKey }}</view>
|
|
|
<view v-else>
|
|
|
- <!-- <u--input placeholder="请输入" border="surround" disabled v-model="item.colorKey"></u--input> -->
|
|
|
- <uni-data-select
|
|
|
+ <u--input placeholder="请输入" border="surround" v-model="item.colorKey" @click.native="changeMultiple(item, index, 'colorKey', product_color_key)"></u--input>
|
|
|
+ <!-- <uni-data-select
|
|
|
multiple
|
|
|
:localdata="product_color_key"
|
|
|
v-model="item.colorKey"
|
|
|
- ></uni-data-select>
|
|
|
+ ></uni-data-select> -->
|
|
|
+ <!-- <zxz-uni-data-select
|
|
|
+ :localdata="product_color_key"
|
|
|
+ v-model="item.colorKey"
|
|
|
+ dataValue="value"
|
|
|
+ format="{text}"
|
|
|
+ dataKey="text"
|
|
|
+ :clear="false"
|
|
|
+ multiple
|
|
|
+ ></zxz-uni-data-select> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view slot="remark">
|
|
|
- <view v-if="isDrawer">{{ item.colorKey }}</view>
|
|
|
+ <view v-if="isDrawer">{{ item.remark }}</view>
|
|
|
<view v-else>
|
|
|
<u--input placeholder="请输入" border="surround" v-model="item.remark"></u--input>
|
|
|
</view>
|
|
|
@@ -127,43 +146,6 @@
|
|
|
<fileMain slot="technicalDrawings" :type="isDrawer ? 'view' : ''" v-model="item.technicalDrawings"></fileMain>
|
|
|
<fileMain slot="files" :type="isDrawer ? 'view' : ''" v-model="item.files"></fileMain>
|
|
|
|
|
|
-
|
|
|
- <u--input :disabled="!!contractId" slot="singleWeight" @input="singleWeightChange(item,index)"
|
|
|
- type="number" placeholder="请输入" border="surround" v-model="item.singleWeight"></u--input>
|
|
|
- <u--input :disabled="!!contractId" slot="singlePrice" style="flex:none;width: 50%;"
|
|
|
- @input="getTotalPrice()" type="number" placeholder="请输入" border="surround"
|
|
|
- v-model="item.singlePrice">
|
|
|
- <template slot="suffix">元</template>
|
|
|
- </u--input>
|
|
|
- <uni-datetime-picker :disabled="!!contractId" type="date" slot="customerExpectDeliveryDeadline"
|
|
|
- v-model="item.customerExpectDeliveryDeadline">
|
|
|
- </uni-datetime-picker>
|
|
|
- <u--input :disabled="!!contractId" slot="guaranteePeriod" placeholder="请输入" border="surround"
|
|
|
- v-model="item.guaranteePeriod"></u--input>
|
|
|
- <uni-data-picker :readonly="!!contractId" slot="guaranteePeriodUnitCode"
|
|
|
- v-model="item.guaranteePeriodUnitCode" placeholder="请选择" :localdata="date_unit">
|
|
|
- </uni-data-picker>
|
|
|
- <u--input slot="customerMark" placeholder="请输入" border="surround" v-model="item.customerMark">
|
|
|
-
|
|
|
- </u--input>
|
|
|
- <u--input slot="productBrand" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
- v-model="item.productBrand">
|
|
|
- </u--input>
|
|
|
- <u--input slot="specification" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
- v-model="item.specification">
|
|
|
-
|
|
|
- </u--input>
|
|
|
- <!-- <u--input slot="goodsLevel" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
- v-model="item.goodsLevel">
|
|
|
- </u--input> -->
|
|
|
- <u--input slot="modelType" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
- v-model="item.modelType">
|
|
|
- </u--input>
|
|
|
-
|
|
|
- <!-- <u--input slot="productName" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
- v-model="item.productName">
|
|
|
- </u--input> -->
|
|
|
-
|
|
|
</myCard>
|
|
|
</view>
|
|
|
|
|
|
@@ -177,9 +159,10 @@
|
|
|
<u-action-sheet :actions="addList" :show="show" :closeOnClickOverlay="true" :closeOnClickAction="true"
|
|
|
@close="show=false" @select='select'> </u-action-sheet>
|
|
|
<timePopup ref="timePopupRef" @confirm="handleTimeConfirm"></timePopup>
|
|
|
+ <multipleSelect ref="multipleSelectRef" :range="multipleSelectRange" @confirm="handleMultipleConfirm"></multipleSelect>
|
|
|
</view>
|
|
|
</template>
|
|
|
-<!-- 名称,数量,单位,到货方式,到货日期 -->
|
|
|
+<!-- 名称,数量,到货方式,到货日期 -->
|
|
|
<script>
|
|
|
import {
|
|
|
getByCode
|
|
|
@@ -190,12 +173,14 @@
|
|
|
import fileMain from "@/pages/doc/index.vue"
|
|
|
import { changeCount } from '@/utils/setProduct.js';
|
|
|
import timePopup from './timePopup.vue'
|
|
|
-
|
|
|
- export default {
|
|
|
+ import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
|
|
|
+ import multipleSelect from './multipleSelect.vue'
|
|
|
|
|
|
+ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tableList: [],
|
|
|
+ multipleSelectRange: [],
|
|
|
addList: [
|
|
|
{ name: '选择物品清单', },
|
|
|
{ name: '新增临时产品', }
|
|
|
@@ -219,7 +204,15 @@
|
|
|
btnType: 'error ',
|
|
|
type: '2',
|
|
|
pageUrl: '',
|
|
|
-
|
|
|
+ judge: [{
|
|
|
+ authorities: '',
|
|
|
+ }, {
|
|
|
+ // key: 'status',
|
|
|
+ // value: [0, 3],
|
|
|
+ fn: (row) => {
|
|
|
+ return !this.isDrawer
|
|
|
+ },
|
|
|
+ }],
|
|
|
}],
|
|
|
defaultForm: {
|
|
|
key: null,
|
|
|
@@ -230,7 +223,9 @@
|
|
|
workHour: '',
|
|
|
guaranteePeriodUnitCode: '',
|
|
|
technicalDrawings: [],
|
|
|
- arrivalWay: 1
|
|
|
+ arrivalWay: 1,
|
|
|
+ modelKey: '',
|
|
|
+ colorKey: ''
|
|
|
},
|
|
|
levelList
|
|
|
}
|
|
|
@@ -252,7 +247,9 @@
|
|
|
components: {
|
|
|
myCard,
|
|
|
fileMain,
|
|
|
- timePopup
|
|
|
+ timePopup,
|
|
|
+ baTreePicker,
|
|
|
+ multipleSelect
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['dict', 'getDict', 'getDictValue']),
|
|
|
@@ -414,6 +411,7 @@
|
|
|
[{
|
|
|
label: '备注:',
|
|
|
prop: 'remark',
|
|
|
+ slot: 'remark',
|
|
|
className: 'perce100',
|
|
|
}],
|
|
|
[{
|
|
|
@@ -495,17 +493,137 @@
|
|
|
this.current = {};
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ uni.$off('setPBomList')
|
|
|
+ uni.$on('setPBomList', (data, idx = -1) => {
|
|
|
+ console.log('setPBomList~~', data)
|
|
|
+ data.forEach((item, index) => {
|
|
|
+ let i = idx == -1 ? index : idx;
|
|
|
+ let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
+ row.key = this.tableList.length + 1;
|
|
|
+ let parasm = idx == -1 ? row : this.tableList[i];
|
|
|
+ this.$set(parasm, 'productId', item.id);
|
|
|
+ // this.$set(parasm, 'id', item.id);
|
|
|
+ this.$set(parasm, 'categoryName', item.name);
|
|
|
+ this.$set(parasm, 'productCategoryId', item.categoryLevelId);
|
|
|
+ this.$set(parasm, 'productBrand', item.brandNum);
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'productCategoryName',
|
|
|
+ item.category.categoryLevelPath
|
|
|
+ );
|
|
|
+ this.$set(parasm, 'totalCount', item.dosage);
|
|
|
+ this.$set(parasm, 'productCode', item.code);
|
|
|
+ this.$set(parasm, 'productName', item.name);
|
|
|
+ this.$set(parasm, 'availableCountBase', item.availableCountBase);
|
|
|
+ this.$set(parasm, 'modelType', item.modelType);
|
|
|
+ this.$set(parasm, 'weightUnit', item.unit);
|
|
|
+ this.$set(parasm, 'measuringUnit', item.unit);
|
|
|
+ this.$set(parasm, 'specification', item.specification);
|
|
|
+ this.$set(parasm, 'remark', '');
|
|
|
+ this.$set(parasm, 'imgCode', item.imgCode);
|
|
|
+ this.$set(parasm, 'produceType', item.componentAttribute);
|
|
|
+ this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
|
|
|
+ this.$set(parasm, 'goodsLevel', item.goodsLevel);
|
|
|
+ this.$set(parasm, 'supplierList', item.supplierList);
|
|
|
+ this.$set(parasm, 'supplierCode', item.supplierCode);
|
|
|
+ this.$set(parasm, 'supplierId', item.supplierId);
|
|
|
+ this.$set(parasm, 'supplierName', item.supplierName);
|
|
|
+ // if (item.modelKey) {
|
|
|
+ // this.$set(parasm, 'modelKey', item.modelKey.split(','));
|
|
|
+ // }
|
|
|
+ // if (item.colorKey) {
|
|
|
+ // this.$set(parasm, 'colorKey', item.colorKey.split(','));
|
|
|
+ // }
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'packageDispositionList',
|
|
|
+ item.packageDispositionList?.map(i => {
|
|
|
+ return {
|
|
|
+ ...i,
|
|
|
+ text: i.conversionUnit,
|
|
|
+ value: i.id
|
|
|
+ }
|
|
|
+ }) || []
|
|
|
+ );
|
|
|
+ if (item.packageDispositionList?.length) {
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'purchaseUnitId',
|
|
|
+ item.packageDispositionList[0].id
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'purchaseUnit',
|
|
|
+ item.packageDispositionList[0].conversionUnit
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'packingSpecification',
|
|
|
+ item.extField?.packingSpecification
|
|
|
+ );
|
|
|
+ this.$set(parasm, 'provenance', item.purchaseOrigins || '');
|
|
|
+ this.$set(parasm, 'provenanceName', this.getProvenance(item.provenance));
|
|
|
+
|
|
|
+ if (idx == -1) {
|
|
|
+ this.tableList.push(row);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('setProduceList')
|
|
|
+ uni.$off('setTaskName')
|
|
|
+ uni.$off('setPBomList')
|
|
|
},
|
|
|
watch: {
|
|
|
contractId(val) {
|
|
|
if (val) {
|
|
|
this.btnList = []
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions('dict', ['requestDict']),
|
|
|
+ openPicker() {
|
|
|
+ this.$refs.treePicker._show()
|
|
|
+ },
|
|
|
+ getProvenance(item) {
|
|
|
+ console.log('getProvenance~~~~~', item)
|
|
|
+ // try {
|
|
|
+ // 检查item和provenance是否存在
|
|
|
+ if (!item) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+
|
|
|
+ let arr = item;
|
|
|
+
|
|
|
+ if(!Array.isArray(arr)) {
|
|
|
+ console.log('arr is not array, convert to array')
|
|
|
+ arr = arr.split(',');
|
|
|
+ }
|
|
|
+
|
|
|
+ return arr && arr.length ? arr.map((i) => {
|
|
|
+ return this.purchase_origin.find(p => p.value == i)?.text
|
|
|
+ }).join(',') : '';
|
|
|
+ },
|
|
|
+ changeMultiple(item, index, key, range) {
|
|
|
+ console.log(item, index)
|
|
|
+ this.current = item;
|
|
|
+ this.currentIndex = index;
|
|
|
+ this.multipleSelectRange = range
|
|
|
+ this.$refs.multipleSelectRef.open(item, index, key)
|
|
|
+ },
|
|
|
+ handleMultipleConfirm(data, key) {
|
|
|
+ this.$set(this.tableList[this.currentIndex], key, data)
|
|
|
+ if(key == 'provenance'){
|
|
|
+ this.$set(this.tableList[this.currentIndex], 'provenanceName', this.getProvenance(data))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ change(e){
|
|
|
+ console.log('e:',e);
|
|
|
+ },
|
|
|
settingDate(item, index) {
|
|
|
console.log(item, index)
|
|
|
this.current = item;
|
|
|
@@ -516,11 +634,14 @@
|
|
|
this.$set(this.tableList[this.currentIndex], 'arrivalBatch', data)
|
|
|
},
|
|
|
add() {
|
|
|
+ this.currentIndex = -1;
|
|
|
+ this.current = {};
|
|
|
+ this.c
|
|
|
if (this.isTemporary) {
|
|
|
this.show = true
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/saleManage/components/selectProduce?isAll=' + 1
|
|
|
+ url: '/pages/purchasingManage/components/selectProduce?isAll=' + 1
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -529,7 +650,7 @@
|
|
|
}) {
|
|
|
if (name == '选择物品清单') {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/saleManage/components/selectProduce?isAll=' + 1
|
|
|
+ url: '/pages/purchasingManage/components/selectProduce?isAll=' + 1
|
|
|
})
|
|
|
} else {
|
|
|
this.handlAdd()
|
|
|
@@ -539,7 +660,7 @@
|
|
|
this.current = item;
|
|
|
this.currentIndex = index;
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/saleManage/components/selectProduce?isAll=' + 2
|
|
|
+ url: '/pages/purchasingManage/components/selectProduce?isAll=' + 2
|
|
|
})
|
|
|
},
|
|
|
selectTaskName(item, index) {
|
|
|
@@ -559,7 +680,7 @@
|
|
|
init(list) {
|
|
|
if (list) {
|
|
|
this.tableList = JSON.parse(JSON.stringify(list))
|
|
|
- this.getTotalPrice(list)
|
|
|
+ // this.getTotalPrice(list)
|
|
|
}
|
|
|
},
|
|
|
getValue() {
|